Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ matrix:
- python: "3.6"
env:
- BROWSER=chrome
- SELENIUM=3.7.0
- SELENIUM=3.8.0
- ROBOTFRAMEWORK=3.0.2
- ROBOT_OPTIONS=--dotted
- python: "2.7"
Expand All @@ -45,7 +45,7 @@ matrix:
- python: "2.7"
env:
- BROWSER=chrome
- SELENIUM=3.7.0
- SELENIUM=3.8.0
- ROBOTFRAMEWORK=2.8.7
- ROBOT_OPTIONS=
- python: "3.3"
Expand All @@ -57,7 +57,7 @@ matrix:
- python: "3.3"
env:
- BROWSER=firefox
- SELENIUM=3.7.0
- SELENIUM=3.8.0
- ROBOTFRAMEWORK=3.0.2
- ROBOT_OPTIONS="--exclude Known_Issue_Firefox --dotted"
before_script:
Expand Down
29 changes: 4 additions & 25 deletions test/acceptance/keywords/async_javascript.robot
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ Resource ../resource.robot

*** Test Cases ***
Should Not Timeout If Callback Invoked Immediately
[Documentation] Should Not Timeout If Callback Invoked Immediately
${result} = Execute Async Javascript arguments[arguments.length - 1](123);
Should Be Equal ${result} ${123}

Should Be Able To Return Javascript Primitives From Async Scripts Neither None Nor Undefined
[Documentation] Should Be Able To Return Javascript Primitives From Async Scripts
... Neither None Nor Undefined
${result} = Execute Async Javascript arguments[arguments.length - 1](123);
Should Be Equal ${result} ${123}
${result} = Execute Async Javascript arguments[arguments.length - 1]('abc');
Expand All @@ -23,27 +20,22 @@ Should Be Able To Return Javascript Primitives From Async Scripts Neither None N
Should Be Equal ${result} ${true}

Should Be Able To Return Javascript Primitives From Async Scripts Null And Undefined
[Documentation] Should Be Able To Return Javascript Primitives From Async Scripts
... Null And Undefined
${result} = Execute Async Javascript arguments[arguments.length - 1](null);
Should Be Equal ${result} ${None}
${result} = Execute Async Javascript arguments[arguments.length - 1]();
Should Be Equal ${result} ${None}

Should Be Able To Return An Array Literal From An Async Script
[Documentation] Should Be Able To Return An Array Literal From An Async Script
${result} = Execute Async Javascript arguments[arguments.length - 1]([]);
Should Not Be Equal ${result} ${None}
Length Should Be ${result} 0

Should Be Able To Return An Array Object From An Async Script
[Documentation] Should Be Able To Return An Array Object From An Async Script
${result} = Execute Async Javascript arguments[arguments.length - 1](new Array());
Should Not Be Equal ${result} ${None}
Length Should Be ${result} 0

Should Be Able To Return Arrays Of Primitives From Async Scripts
[Documentation] Should Be Able To Return Arrays Of Primitives From Async Scripts
${result} = Execute Async Javascript
... arguments[arguments.length - 1]([null, 123, 'abc', true, false]);
Should Not Be Equal ${result} ${None}
Expand All @@ -61,42 +53,29 @@ Should Be Able To Return Arrays Of Primitives From Async Scripts
Length Should Be ${result} 0

Should Timeout If Script Does Not Invoke Callback
[Documentation] Should Timeout If Script Does Not Invoke Callback
Run Keyword And Expect Error TimeoutException:* Execute Async Javascript return 1 + 2;

Should Timeout If Script Does Not Invoke Callback With A Zero Timeout
[Documentation] Should Timeout If Script Does Not Invoke Callback With A Zero Timeout
Run Keyword And Expect Error TimeoutException:* Execute Async Javascript
... window.setTimeout(function() {}, 0);

Should Not Timeout If Script Callsback Inside A Zero Timeout
[Documentation] Should Not Timeout If Script Callsback Inside A Zero Timeout
${result} = Execute Async Javascript
... var callback = arguments[arguments.length - 1];
... window.setTimeout(function() { callback(123); }, 0)

Should Timeout If Script Does Not Invoke Callback With Long Timeout
[Documentation] Should Timeout If Script Does Not Invoke Callback With Long Timeout
Set Selenium Timeout 0.5 seconds
Run Keyword And Expect Error TimeoutException:* Execute Async Javascript
... var callback = arguments[arguments.length - 1]; window.setTimeout(callback, 1500);

Should Detect Page Loads While Waiting On An Async Script And Return An Error
[Documentation] Should Detect Page Loads While Waiting On An Async Script
... And Return An Error
Set Selenium Timeout 0.5 seconds
Run Keyword And Expect Error WebDriverException:* Execute Async Javascript
${status} ${error} Run Keyword And Ignore Error Execute Async Javascript
... window.location = 'javascript/dynamic';
Should Match Regexp ${error} (WebDriverException\:|JavascriptException\:)

Should Catch Errors When Executing Initial Script
[Documentation] Should Catch Errors When Executing Initial Script
Run Keyword And Expect Error WebDriverException:* Execute Async Javascript
${status} ${error} Run Keyword And Ignore Error Execute Async Javascript
... throw Error('you should catch this!');
#TODO Implement Selenium asynchronous javascript test
#Should Be Able To Execute Asynchronous Scripts
# # To Do
#TODO EdManlove Add support for arguement passing to selenium javascript calls
#Should Be Able To Pass Multiple Arguments To Async Scripts
# ${result} = Execute Async Javascript
#... arguments[arguments.length - 1](arguments[0] + arguments[1]); 1 2
# Should Be Equal ${result} ${3}
Should Match Regexp ${error} (WebDriverException\:|JavascriptException\:)