Skip to content

Commit de3d1aa

Browse files
authored
Enables to Selenium Grid in Travis (robotframework#1400)
Fixes robotframework#1282
1 parent c03239d commit de3d1aa

File tree

10 files changed

+113
-75
lines changed

10 files changed

+113
-75
lines changed

.travis.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dist: trusty
44
env:
55
global:
66
- JYTHON=false
7+
- GRID=False
78
addons:
89
apt:
910
sources:
@@ -55,6 +56,14 @@ matrix:
5556
- ROBOTFRAMEWORK=3.0.4
5657
- ROBOT_OPTIONS=--dotted
5758
- INTERPRETER=python2
59+
- python: "3.7-dev"
60+
env:
61+
- BROWSER=headlesschrome
62+
- SELENIUM=3.141.0
63+
- ROBOTFRAMEWORK=3.1.2
64+
- ROBOT_OPTIONS=--dotted
65+
- INTERPRETER=python3
66+
- GRID=true
5867
before_script:
5968
- "export DISPLAY=:99.0"
6069
- "sh -e /etc/init.d/xvfb start"
@@ -69,11 +78,16 @@ before_script:
6978
- $INTERPRETER -m pip install .
7079
- if [ "$JYTHON" == "true" ]; then
7180
$INTERPRETER -m pip install mockito;
81+
python -m pip install requests;
7282
python -m pip install robotstatuschecker;
7383
else
7484
$INTERPRETER -m pip install -r requirements-dev.txt;
7585
fi
86+
- if [ "$GRID" == "true" ]; then
87+
wget --output-document=./selenium-server-standalone.jar http://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.59.jar;
88+
sudo chmod u+x ./selenium-server-standalone.jar;
89+
fi
7690
- $INTERPRETER -m pip install selenium==$SELENIUM
7791
- $INTERPRETER -m pip install robotframework==$ROBOTFRAMEWORK
7892
script:
79-
- python atest/run.py $BROWSER --interpreter $INTERPRETER $ROBOT_OPTIONS
93+
- python atest/run.py $BROWSER --interpreter $INTERPRETER --grid $GRID $ROBOT_OPTIONS

atest/acceptance/2-event_firing_webdriver/event_firing_webdriver.robot

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
*** Settings ***
22
Library SeleniumLibrary event_firing_webdriver=${CURDIR}/MyListener.py
3+
Suite Setup Open Browser ${FRONT PAGE} ${BROWSER} alias=event_firing_webdriver
4+
... remote_url=${REMOTE_URL} desired_capabilities=${DESIRED_CAPABILITIES}
35
Suite Teardown Close All Browsers
46

57
*** Variable ***
@@ -12,6 +14,7 @@ ${FRONT_PAGE}= ${ROOT}/
1214

1315
*** Test Cases ***
1416
Open Browser To Start Page
17+
[Tags] NoGrid
1518
[Documentation]
1619
... LOG 1:12 DEBUG Wrapping driver to event_firing_webdriver.
1720
Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL}
@@ -24,6 +27,7 @@ Event Firing Webdriver Go To (WebDriver)
2427
Go To ${ROOT}/forms/named_submit_buttons.html
2528

2629
Event Firing Webdriver Input Text (WebElement)
30+
[Tags] NoGrid
2731
[Documentation]
2832
... LOG 1:5 INFO Before clear and send_keys
2933
... LOG 1:9 INFO After clear and send_keys
@@ -32,6 +36,7 @@ Event Firing Webdriver Input Text (WebElement)
3236
Input Text //input[@name="textfield"] FooBar
3337

3438
Event Firing Webdriver Click Element (WebElement)
39+
[Tags] NoGrid
3540
[Documentation]
3641
... LOG 1:5 INFO Before click
3742
... LOG 1:9 INFO After click

atest/acceptance/keywords/content_assertions.robot

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

77
*** Test Cases ***
88
Title Should Be
9+
[Tags] NoGrid
910
[Documentation] LOG 2:4 Page title is '(root)/index.html'.
1011
Title Should Be (root)/index.html
1112
Run Keyword And Expect Error
@@ -16,6 +17,7 @@ Title Should Be
1617
... Title Should Be not a title message=Page title was not expected
1718

1819
Page Should Contain
20+
[Tags] NoGrid
1921
[Documentation] The last step fails and doesn't contain the html content.
2022
... FAIL Page should have contained text 'non existing text' but did not.
2123
... LOG 2:7 Current page contains text 'needle'.
@@ -31,13 +33,15 @@ Page Should Contain With Text Having Internal Elements
3133
Page Should Contain Relative with text after
3234

3335
Page Should Contain With Custom Log Level DEBUG
36+
[Tags] NoGrid
3437
[Documentation] Html content is shown at DEBUG level.
3538
... FAIL Page should have contained text 'non existing text' but did not.
3639
... LOG 2:14 DEBUG REGEXP: (?i)<html.*</html>
3740
... LOG 2:15 FAIL Page should have contained text 'non existing text' but did not.
3841
Page Should Contain non existing text DEBUG
3942

4043
Page Should Contain With Custom Log Level TRACE
44+
[Tags] NoGrid
4145
[Documentation] Html content is shown at DEBUG level.
4246
... FAIL Page should have contained text 'non existing text' but did not.
4347
... LOG 3:15 TRACE REGEXP: (?i)<html.*</html>
@@ -59,6 +63,7 @@ Page Should Contain With Frames
5963
Page Should Contain You're looking at right.
6064

6165
Page Should Not Contain
66+
[Tags] NoGrid
6267
[Documentation] Default log level does not have html output.
6368
... FAIL Page should not have contained text 'needle'.
6469
... LOG 2:11 Current page does not contain text 'non existing text'.
@@ -67,6 +72,7 @@ Page Should Not Contain
6772
Page Should Not Contain needle
6873

6974
Page Should Not Contain With Custom Log Level
75+
[Tags] NoGrid
7076
[Documentation] LOG 2.1:10 DEBUG REGEXP: (?i)<html.*</html>
7177
Run Keyword And Expect Error
7278
... Page should not have contained text 'needle'.
@@ -177,6 +183,7 @@ Get Text
177183
... Get Text missing_id
178184

179185
Page Should Contain Checkbox
186+
[Tags] NoGrid
180187
[Documentation] LOG 2:7 Current page contains checkbox 'can_send_email'.
181188
[Setup] Go To Page "forms/prefilled_email_form.html"
182189
Page Should Contain Checkbox can_send_email
@@ -186,6 +193,7 @@ Page Should Contain Checkbox
186193
... Page Should Contain Checkbox non-existing
187194

188195
Page Should Not Contain Checkbox
196+
[Tags] NoGrid
189197
[Documentation] LOG 2:7 Current page does not contain checkbox 'non-existing'.
190198
[Setup] Go To Page "forms/prefilled_email_form.html"
191199
Page Should Not Contain Checkbox non-existing
@@ -276,6 +284,7 @@ Page Should Not Contain Text Field
276284
... Page Should Not Contain Text Field website
277285

278286
TextField Should Contain
287+
[Tags] NoGrid
279288
[Documentation] LOG 2:10 Text field 'name' contains text ''.
280289
[Setup] Go To Page "forms/email_form.html"
281290
TextField Should contain name ${EMPTY}
@@ -292,6 +301,7 @@ TextField Should Contain
292301
... TextField Should contain website https://w3.org
293302

294303
TextField Value Should Be
304+
[Tags] NoGrid
295305
[Documentation] LOG 2:10 Content of text field 'name' is ''.
296306
[Setup] Go To Page "forms/email_form.html"
297307
textfield Value Should Be name ${EMPTY}

atest/acceptance/keywords/cookies.robot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Test Get Cookie Object Value
104104
Should Be Equal ${cookie.value} value
105105

106106
Test Get Cookie Keyword Logging
107+
[Tags] NoGrid
107108
[Documentation]
108109
... LOG 2:4 ${cookie} = name=another
109110
... value=value

atest/acceptance/keywords/counting_elements.robot

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ Page Should Contain Element When Limit Is None
5252
Page Should Contain Element name: div_name limit=${None}
5353

5454
Page Should Contain Element When Limit Is Number
55+
[Tags] NoGrid
5556
[Documentation] LOG 2:4 INFO Current page contains 2 element(s).
5657
[Setup] Go To Page "links.html"
5758
Page Should Contain Element name: div_name limit=2
5859

5960
Page Should Contain Element Log Level Does Not Affect When Keyword Passes
61+
[Tags] NoGrid
6062
[Documentation] LOG 2:4 INFO Current page contains 2 element(s).
6163
[Setup] Go To Page "links.html"
6264
Page Should Contain Element name: div_name loglevel=debug limit=2
@@ -77,6 +79,7 @@ Page Should Contain Element When Limit Is Not Number
7779
... Page Should Contain Element name: div_name limit=AA
7880

7981
Page Should Contain Element When Error With Limit And Different Loglevels
82+
[Tags] NoGrid
8083
[Documentation] Only at DEBUG loglevel is the html placed in the log.
8184
... FAIL Page should have contained "99" element(s), but it did contain "2" element(s).
8285
... LOG 2.1:7 FAIL Page should have contained "99" element(s), but it did contain "2" element(s).

atest/acceptance/keywords/location.robot

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Resource ../resource.robot
55

66
*** Test Cases ***
77
Location Should Be
8+
[Tags] NoGrid
89
[Documentation] LOG 2:4 Current location is '${FRONT PAGE}'.
910
Location Should Be ${FRONT PAGE}
1011
Location Should Be ${FRONT PAGE} message=taco
@@ -20,6 +21,7 @@ Location Should Be
2021
... Location Should Be non existing message=None
2122

2223
Location Should Contain
24+
[Tags] NoGrid
2325
[Documentation] LOG 2:4 Current location contains 'html'.
2426
Location Should Contain html
2527
Location Should Contain html message=foobar

atest/acceptance/keywords/screenshots.robot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Force Tags Known Issue Internet Explorer
66

77
*** Test Cases ***
88
Capture page screenshot to default location
9+
[Tags] NoGrid
910
[Documentation]
1011
... LOG 2:4 </td></tr><tr><td colspan="3"><a href="selenium-screenshot-1.png"><img src="selenium-screenshot-1.png" width="800px"></a>
1112
... LOG 8:4 </td></tr><tr><td colspan="3"><a href="selenium-screenshot-2.png"><img src="selenium-screenshot-2.png" width="800px"></a>

atest/acceptance/open_and_close.robot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Open Browser desired_capabilities As Dictionary
8080
... remote_url=${REMOTE_URL} desired_capabilities=${caps}
8181

8282
When Closing Browsers Causes An Error
83+
[Tags] NoGrid
8384
[Documentation]
8485
... FAIL AttributeError: 'NoneType' object has no attribute 'quit'
8586
... LOG 3:8 ERROR When closing browser, received exception: 'NoneType' object has no attribute 'quit'

0 commit comments

Comments
 (0)