Created
October 29, 2012 00:30
-
-
Save distracteddev/3970661 to your computer and use it in GitHub Desktop.
Revisions
-
distracteddev revised this gist
Oct 29, 2012 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -29,6 +29,7 @@ setTimeout(function simulate() { // SAMPLE CODE THAT SIMULATES GOING TO STEP 3 OF THE // 6th APPLICATION AVAILABLE simulateClick('a!Apps'); // click the 6th button with the text 'Deploy Now' simulateClick('button!Deploy Now', 6); simulateClick('button!Next'); simulateClick('button!Next'); -
distracteddev revised this gist
Oct 29, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ // @param {string} query # A string in the following format: {element}!{text} // @param {int} count # Use count to select the Nth element that matches the query window.click = function click(query, count) { element = query.split('!')[0]; text = query.split('!')[1]; -
distracteddev revised this gist
Oct 29, 2012 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,6 +24,8 @@ setTimeout(function simulate() { }, delay*step); step++; } // SAMPLE CODE THAT SIMULATES GOING TO STEP 3 OF THE // 6th APPLICATION AVAILABLE simulateClick('a!Apps'); simulateClick('button!Deploy Now', 6); simulateClick('button!Next'); -
distracteddev revised this gist
Oct 29, 2012 . 1 changed file with 30 additions and 34 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,35 +1,31 @@ window.click = function click(query, count) { element = query.split('!')[0]; text = query.split('!')[1]; $(element).each(function(i, el) { $el = $(el); var condition = $el.text() === text; if (count) { condition = ($el.text() === text && count === i); } if (condition) { $el[0].click(); } }); }; setTimeout(function simulate() { var delay = 300; var step = 1; function simulateClick(query, count) { var args = arguments; setTimeout(function() { currentStep = step; window.click.apply(window, args); }, delay*step); step++; } simulateClick('a!Apps'); simulateClick('button!Deploy Now', 6); simulateClick('button!Next'); simulateClick('button!Next'); }, 1000); -
distracteddev revised this gist
Oct 29, 2012 . No changes.There are no files selected for viewing
-
distracteddev created this gist
Oct 29, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ window.click = function click(query, count) { element = query.split('!')[0]; text = query.split('!')[1]; $(element).each(function(i, el) { $el = $(el); var condition = $el.text() === text; if (count) { condition = ($el.text() === text && count === i); } if (condition) { $el[0].click(); } }); }; setTimeout(function simulate() { var delay = 300; var step = 1; function simulateClick(query, count) { var args = arguments; setTimeout(function() { currentStep = step; window.click.apply(window, args); }, delay*step); step++; } simulateClick('a!Apps'); simulateClick('button!Deploy Now', 6); simulateClick('button!Next'); simulateClick('button!Next'); }, 1000); // Complete callback callback(div); });