Letractively / aost

Automatically exported from code.google.com/p/aost
Other
1 stars 0 forks source link

need to escape special characters when export code from Tellurium IDE #463

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
For example: "\", "$".

/**
 *      This Groovy DSL script is automatically generated by Tellurium IDE 0.8.0.
 *
 *      To run the script, you need Tellurium rundsl.groovy script. 
 *      The detailed guide is available at:
 *              http://code.google.com/p/aost/wiki/UserGuide070TelluriumBasics#Run_DSL_Script
 *
 *      For any problems, please report to Tellurium User Group at: 
 *              http://groups.google.com/group/tellurium-users
 *
 */

                ui.Container(uid: "Mt", clocator: [tag: "table", id: "mt"]){
                                UrlLink(uid: "Downloads", clocator: [tag: "a", text: "Downloads"])
                                UrlLink(uid: "RegexpProjectsHome", clocator: [tag: "a", text: "regexp:Project\\sHome"])
                                UrlLink(uid: "Wiki", clocator: [tag: "a", text: "Wiki"])
                                UrlLink(uid: "Issues", clocator: [tag: "a", text: "Issues"])
                                UrlLink(uid: "Source", clocator: [tag: "a", text: "Source"])
                                UrlLink(uid: "Administer", clocator: [tag: "a", text: "Administer"])
                        }

                ui.Form(uid: "Form", clocator: [tag: "form", method: "GET", action: "list"]){
                                Selector(uid: "Can", clocator: [tag: "select", direct: "true", name: "can", id: "can"])
                                InputBox(uid: "Searchq", clocator: [tag: "input", type: "text", name: "q", id: "searchq"])
                                SubmitButton(uid: "Search", clocator: [tag: "input", direct: "true", type: "submit", value: "Search"])
                        }

                connectSeleniumServer()
                connectUrl "http://code.google.com/p/aost/wiki/UserGuide070Introduction?tm=6"
                click "Mt.Downloads"
                waitForPageToLoad 30000

                select "Form.Can", "label=regexp:\\sCurrent downloads"
                select "Form.Can", "label=regexp:\\sFeatured downloads"
                type "Form.Searchq", "test"
                click "Form.Search"
                waitForPageToLoad 30000

Original issue reported on code.google.com by John.Jian.Fang@gmail.com on 11 Aug 2010 at 8:03

GoogleCodeExporter commented 8 years ago
(function() {
    te_special = /[\$\\]/;
    teJQuery.escape = function jQuery$escape(s) {
        var left = s.split(te_special, 1)[0];
        if (left == s) return s;
        return left + '\\' +
                s.substr(left.length, 1) +
                teJQuery.escape(s.substr(left.length + 1));
    }
})();

Original comment by John.Jian.Fang@gmail.com on 12 Aug 2010 at 1:54