Skip to content

Commit b448e76

Browse files
authored
Update Selenium 3.8.0 (#1013)
Selenium 3.8.0 uses new exception when JavaScript error is raised. Commit provides support for new and old Selenium version when JavaScript errors are checked.
1 parent 34f854c commit b448e76

File tree

2 files changed

+7
-28
lines changed

2 files changed

+7
-28
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ matrix:
3333
- python: "3.6"
3434
env:
3535
- BROWSER=chrome
36-
- SELENIUM=3.7.0
36+
- SELENIUM=3.8.0
3737
- ROBOTFRAMEWORK=3.0.2
3838
- ROBOT_OPTIONS=--dotted
3939
- python: "2.7"
@@ -45,7 +45,7 @@ matrix:
4545
- python: "2.7"
4646
env:
4747
- BROWSER=chrome
48-
- SELENIUM=3.7.0
48+
- SELENIUM=3.8.0
4949
- ROBOTFRAMEWORK=2.8.7
5050
- ROBOT_OPTIONS=
5151
- python: "3.3"
@@ -57,7 +57,7 @@ matrix:
5757
- python: "3.3"
5858
env:
5959
- BROWSER=firefox
60-
- SELENIUM=3.7.0
60+
- SELENIUM=3.8.0
6161
- ROBOTFRAMEWORK=3.0.2
6262
- ROBOT_OPTIONS="--exclude Known_Issue_Firefox --dotted"
6363
before_script:

test/acceptance/keywords/async_javascript.robot

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ Resource ../resource.robot
66

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

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

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

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

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)