Skip to content

Commit 4866a7d

Browse files
Configure Travis to get latest geckodriver, and set to test Firefox
on PR and Cron. Adds Known Issue Firefox to a test. Add variable ROBOT_OPTIONS to allow exclude Known Issue $BROWSER tests. Update tests to be excluded with "Known Issue Firefox". Corrected excluded tag for Firefox and set to Latest.
1 parent 091e359 commit 4866a7d

File tree

7 files changed

+97
-138
lines changed

7 files changed

+97
-138
lines changed

.travis.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ language: python
22
sudo: required
33
dist: trusty
44
addons:
5+
firefox: latest
6+
# firefox: latest-esr
57
apt:
68
sources:
79
- google-chrome
@@ -13,6 +15,15 @@ before_install:
1315
- unzip chromedriver_linux64.zip
1416
- sudo chmod u+x chromedriver
1517
- sudo mv chromedriver /usr/bin/
18+
# Firefox latest
19+
- FDVERSION=`curl -s -L https://github.com/mozilla/geckodriver/releases/latest | grep -E href=\"\(.*\)geckodriver-v\(.*\)-linux64.tar.gz\"`
20+
- VFILE=`echo $FDVERSION | sed -E "s/^.*<a href=\"/https:\/\/github.com/" -- | sed -E "s/\" rel=\"nofollow\">//" --`
21+
# Firefox latest-esr
22+
# - VFILE=https://github.com//mozilla/geckodriver/releases/download/v0.17.0/geckodriver-v0.17.0-linux64.tar.gz
23+
- wget $VFILE
24+
- tar xzf geckodriver*-linux64.tar.gz
25+
- sudo chmod u+x geckodriver
26+
- sudo mv geckodriver /usr/bin/
1627
install:
1728
- pip install .
1829
- pip install -r requirements.txt
@@ -24,30 +35,41 @@ matrix:
2435
- BROWSER=chrome
2536
- SELENIUM=3.5.0
2637
- ROBOTFRAMEWORK=3.0.2
38+
- ROBOT_OPTIONS=
2739
- python: "2.7" # For PR and cron
2840
env:
2941
- BROWSER=chrome
3042
- SELENIUM=2.53.6
3143
- ROBOTFRAMEWORK=2.9.2
44+
- ROBOT_OPTIONS=
3245
- python: "2.7" # For PR and cron
3346
env:
3447
- BROWSER=chrome
3548
- SELENIUM=3.5.0
3649
- ROBOTFRAMEWORK=2.8.7
50+
- ROBOT_OPTIONS=
3751
- python: "3.3" # For PR and cron
3852
env:
3953
- BROWSER=chrome
4054
- SELENIUM=2.53.6
4155
- ROBOTFRAMEWORK=3.0.2
42-
- python: "3.3" # For cron only
56+
- ROBOT_OPTIONS=
57+
- python: "3.6" # For PR and cron
4358
env:
4459
- BROWSER=firefox
4560
- SELENIUM=3.5.0
4661
- ROBOTFRAMEWORK=3.0.2
62+
- ROBOT_OPTIONS="--exclude 'Known Issue Firefox'"
63+
- python: "2.7" # For PR and cron
64+
env:
65+
- BROWSER=firefox
66+
- SELENIUM=3.5.0
67+
- ROBOTFRAMEWORK=2.8.7
68+
- ROBOT_OPTIONS="--exclude 'Known Issue Firefox'"
4769
before_script:
4870
- "export DISPLAY=:99.0"
4971
- "sh -e /etc/init.d/xvfb start"
5072
- pip install selenium==$SELENIUM
5173
- pip install robotframework==$ROBOTFRAMEWORK
5274
script:
53-
- python test/run_tests.py $BROWSER
75+
- python test/run_tests.py $BROWSER $ROBOT_OPTIONS

test/acceptance/keywords/click_element_at_coordinates.robot

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ Resource ../resource.robot
77
*** Test Cases ***
88
Click Element At Coordinates
99
[Documentation] LOG 2 Click clicking element 'Clickable' in coordinates '10', '20'.
10-
[Tags] Known Issue Firefox
11-
... Known Issue Internet Explorer
12-
... Known Issue Safari
10+
[Tags] Known Issue Internet Explorer Known Issue Safari
1311
Click Element At Coordinates Clickable ${10} ${20}
1412
Element Text Should Be outputX 110
1513
Element Text Should Be outputY 120

test/acceptance/keywords/content_assertions.robot

Lines changed: 49 additions & 107 deletions
Large diffs are not rendered by default.

test/acceptance/keywords/forms_and_buttons.robot

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,10 @@ Click button created with <button> by tag content
5959

6060
Choose File
6161
[Documentation] Choose File
62+
[Tags] Known Issue Firefox Known Issue Internet Explorer Known Issue Safari
6263
[Setup] Navigate To File Upload Form And Create Temp File To Upload
63-
[Tags] Known Issue Internet Explorer Known Issue Safari
6464
Choose File file_to_upload ${CURDIR}${/}temp.txt
65-
${dep_browser}= Set Variable If
66-
... '${BROWSER}'.lower() == 'ff' or '${BROWSER}'.lower() == 'firefox'
67-
... temp.txt C:\\fakepath\\temp.txt #Needs to be checked in Windows and OS X
65+
${dep_browser}= Set Variable If '${BROWSER}'.lower() == 'ff' or '${BROWSER}'.lower() == 'firefox' temp.txt C:\\fakepath\\temp.txt #Needs to be checked in Windows and OS X
6866
Textfield Value Should Be name= file_to_upload ${dep_browser}
6967
[Teardown] Remove File ${CURDIR}${/}temp.txt
7068

test/acceptance/keywords/javascript.robot

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ Alert Should Be Present
1919
Click Link Click Me Too!
2020
Alert Should Be Present MULTILINE ALERT!
2121
Click Link Click Me!
22-
Run Keyword And Expect Error Alert text should have been 'foo bar' but was 'ALERT!'
23-
... Alert Should Be Present foo bar
22+
Run Keyword And Expect Error Alert text should have been 'foo bar' but was 'ALERT!' Alert Should Be Present foo bar
2423

2524
Get Alert Message
2625
[Documentation] Get Alert Message
@@ -52,7 +51,7 @@ Input Text Into Prompt
5251

5352
Mouse Down On Link
5453
[Documentation] Mouse Down On Link
55-
[Tags] Known Issue Safari Known Issue Firefox
54+
[Tags] Known Issue Safari
5655
[Setup] Go To Page "javascript/mouse_events.html"
5756
Mouse Down On Image image_mousedown
5857
Text Field Should Contain textfield onmousedown
@@ -94,21 +93,21 @@ Execute Javascript from File
9493

9594
Open Context Menu
9695
[Documentation] Open Context Menu
97-
[Tags] Known Issue Safari Known Issue Firefox
96+
[Tags] Known Issue Safari
9897
Go To Page "javascript/context_menu.html"
9998
Open Context Menu myDiv
10099

101100
Drag and Drop
102101
[Documentation] Drag and Drop
103-
[Tags] Known Issue Internet Explorer Known Issue Safari
102+
[Tags] Known Issue Internet Explorer Known Issue Safari
104103
[Setup] Go To Page "javascript/drag_and_drop.html"
105104
Element Text Should Be id=droppable Drop here
106105
Drag and Drop id=draggable id=droppable
107106
Element Text Should Be id=droppable Dropped!
108107

109108
Drag and Drop by Offset
110109
[Documentation] Drag and Drop by Offset
111-
[Tags] Known Issue Internet Explorer Known Issue Safari
110+
[Tags] Known Issue Firefox Known Issue Internet Explorer Known Issue Safari
112111
[Setup] Go To Page "javascript/drag_and_drop.html"
113112
Element Text Should Be id=droppable Drop here
114113
Drag and Drop by Offset id=draggable ${1} ${1}
@@ -117,9 +116,9 @@ Drag and Drop by Offset
117116
Element Text Should Be id=droppable Dropped!
118117

119118
Verify Console Log Can be Caught
120-
[Tags] Known Issue - Firefox
121-
${message} Set Variable Sample Console Error
122-
Execute Javascript console.error('${message}')
123-
${logs}= Get Log browser
124-
${err}= Convert To string ${logs}
125-
Should Contain ${err} ${message}
119+
[Tags] Known Issue Firefox
120+
${message} Set Variable Sample Console Error
121+
Execute Javascript console.error('${message}')
122+
${logs}= Get Log browser
123+
${err}= Convert To string ${logs}
124+
Should Contain ${err} ${message}

test/acceptance/keywords/mouse.robot

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
*** Settings ***
22
Documentation Tests mouse
33
Test Setup Go To Page "mouse/index.html"
4-
Resource ../resource.robot
54
Force Tags Known Issue Internet Explorer
5+
Resource ../resource.robot
66

77
*** Test Cases ***
88
Mouse Over
99
[Documentation] Mouse Over
10-
[Tags] Known Issue Safari Known Issue Firefox
10+
[Tags] Known Issue Safari
1111
Mouse Over el_for_mouseover
1212
Textfield Value Should Be el_for_mouseover mouseover el_for_mouseover
1313
Run Keyword And Expect Error ERROR: Element not_there not found. Mouse Over not_there
1414

1515
Mouse Out
1616
[Documentation] Mouse Out
17-
[Tags] Known Issue Safari Known Issue Firefox
17+
[Tags] Known Issue Safari
1818
Mouse Out el_for_mouseout
1919
Textfield Value Should Be el_for_mouseout mouseout el_for_mouseout
2020
Run Keyword And Expect Error ERROR: Element not_there not found. Mouse Out not_there
2121

2222
Mouse Down
2323
[Documentation] Mouse Down
24-
[Tags] Known Issue Safari Known Issue Firefox
24+
[Tags] Known Issue Safari
2525
Mouse Down el_for_mousedown
2626
Textfield Value Should Be el_for_mousedown mousedown el_for_mousedown
2727
Run Keyword And Expect Error ERROR: Element not_there not found. Mouse Down not_there

test/run_tests.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
SRC_DIR = os.path.normpath(os.path.join(ROOT_DIR, "..", "src"))
5858
TEST_LIBS_DIR = os.path.join(RESOURCES_DIR, "testlibs")
5959
HTTP_SERVER_FILE = os.path.join(RESOURCES_DIR, "testserver", "testserver.py")
60-
# Travis settins for pull request
60+
# Travis settings for pull request
6161
TRAVIS = os.environ.get("TRAVIS", False)
6262
TRAVIS_EVENT_TYPE = os.environ.get("TRAVIS_EVENT_TYPE", None)
6363
TRAVIS_JOB_NUMBER = os.environ.get("TRAVIS_JOB_NUMBER", "localtunnel")
@@ -146,7 +146,7 @@ def log_start(command_list, *hiddens):
146146

147147

148148
def get_sauce_conf(browser, sauce_username, sauce_key):
149-
if browser == 'chrome' and TRAVIS:
149+
if browser in ['chrome', 'firefox'] and TRAVIS:
150150
return []
151151
return [
152152
'--variable', 'SAUCE_USERNAME:{}'.format(sauce_username),
@@ -208,21 +208,21 @@ def sauce_credentials(sauce_username, sauce_key):
208208
parser.add_argument(
209209
'--sauceusername',
210210
'-U',
211-
help='Username to order browser from SaucuLabs'
211+
help='Username to order browser from SauceLabs'
212212
)
213213
parser.add_argument(
214214
'--saucekey',
215215
'-K',
216-
help='Access key to order browser from SaucuLabs'
216+
help='Access key to order browser from SauceLabs'
217217
)
218218
args, rf_options = parser.parse_known_args()
219219
browser = args.browser.lower().strip()
220-
if TRAVIS and browser != 'chrome' and TRAVIS_EVENT_TYPE != 'cron':
220+
if TRAVIS and browser not in ['chrome', 'firefox'] and TRAVIS_EVENT_TYPE != 'cron':
221221
print(
222222
'Can not run test with browser "{}" from SauceLabs with PR.\n'
223223
'SauceLabs can be used only when running with cron and from '
224224
'SeleniumLibrary master branch, but your event type '
225-
'was "{}". Only Chrome is supported with PR and when using '
225+
'was "{}". Only Chrome and Firefox are supported with PR and when using '
226226
'Travis'.format(browser, TRAVIS_EVENT_TYPE)
227227
)
228228
sys.exit(0)

0 commit comments

Comments
 (0)