Skip to content

Commit 3530fad

Browse files
authored
Merge pull request #125 from seleniumbase/fix-travis-deploy-script
Update deploy script, jQuery version, reliability
2 parents 2f0365a + 5c3cf1a commit 3530fad

File tree

7 files changed

+28
-17
lines changed

7 files changed

+28
-17
lines changed

.travis.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,33 @@ language: python
22
sudo: false
33
python:
44
- "2.7"
5+
addons:
6+
firefox: "46.0.1"
7+
chrome: stable
58
install:
69
- "pip install --upgrade pip"
710
- "pip install -r server_requirements.txt"
811
- "python server_setup.py install"
12+
- "sudo rm -f /etc/boto.cfg"
913
before_script:
1014
- "flake8 seleniumbase/*.py"
1115
- "flake8 seleniumbase/*/*.py"
1216
- "flake8 seleniumbase/*/*/*.py"
1317
- "flake8 seleniumbase/*/*/*/*.py"
1418
- "export DISPLAY=:99.0"
1519
- "sh -e /etc/init.d/xvfb start"
16-
- "export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH"
17-
- "if [ $(phantomjs --version) != '2.1.1' ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi"
18-
- "if [ $(phantomjs --version) != '2.1.1' ]; then wget https://assets.membergetmember.co/software/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2; fi"
19-
- "if [ $(phantomjs --version) != '2.1.1' ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi"
20+
- "wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2;"
21+
- "tar -xvf ./phantomjs-2.1.1-linux-x86_64.tar.bz2;"
22+
- "export PATH=$PWD/phantomjs-2.1.1-linux-x86_64/bin:$PATH;"
2023
- "phantomjs --version"
24+
- "firefox --version"
25+
- wget http://chromedriver.storage.googleapis.com/2.32/chromedriver_linux64.zip
26+
- unzip chromedriver_linux64.zip
27+
- sudo cp chromedriver /usr/local/bin/
28+
- sudo chmod +x /usr/local/bin/chromedriver
2129
script:
30+
- "nosetests examples/my_first_test.py --with-selenium --browser=chrome -s"
31+
- "pytest examples/my_first_test.py --with-selenium --browser=firefox -s"
2232
- "pytest examples/my_first_test.py --with-selenium --browser=phantomjs"
23-
env:
24-
matrix:
25-
- BROWSER=phantomjs
2633
notifications:
2734
email: false

seleniumbase/fixtures/base_case.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ class MyTestClass(BaseCase):
4444
from seleniumbase.fixtures import page_utils
4545
from seleniumbase.fixtures import xpath_to_css
4646
from selenium.common.exceptions import (StaleElementReferenceException,
47-
TimeoutException)
47+
TimeoutException,
48+
WebDriverException)
4849
from selenium.webdriver.remote.webdriver import WebDriver
4950
from selenium.webdriver.common.by import By
5051
from selenium.webdriver.common.keys import Keys
@@ -507,7 +508,7 @@ def activate_jquery(self):
507508
pass
508509
self.execute_script(
509510
'''var script = document.createElement("script"); '''
510-
'''script.src = "http://code.jquery.com/jquery-3.1.0.min.js"; '''
511+
'''script.src = "http://code.jquery.com/jquery-3.2.1.min.js"; '''
511512
'''document.getElementsByTagName("head")[0]'''
512513
'''.appendChild(script);''')
513514
for x in range(30):
@@ -1281,7 +1282,10 @@ def _scroll_to_element(self, element):
12811282
scroll_script = "window.scrollTo(0, %s);" % element_location
12821283
# The old jQuery scroll_script required by=By.CSS_SELECTOR
12831284
# scroll_script = "jQuery('%s')[0].scrollIntoView()" % selector
1284-
self.execute_script(scroll_script)
1285+
try:
1286+
self.execute_script(scroll_script)
1287+
except WebDriverException:
1288+
pass # Older versions of Firefox experienced issues here
12851289
self._demo_mode_pause_if_active(tiny=True)
12861290

12871291
def _slow_scroll_to_element(self, element):

seleniumbase/resources/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
If you want to run SeleniumBase automation on local web pages while offline, that's possible if you copy the resource files here to a location where your local web server is able to access those files as long as you make the necessary updates to your local copy of SeleniumBase. You might not even need to use them depending on what you're doing.
44

5-
**jquery-3.1.0.min.js** - This file is used by [base_case.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py) in activate_jquery(). The activate_jquery() method uses the version at [http://code.jquery.com/jquery-3.1.0.min.js](http://code.jquery.com/jquery-3.1.0.min.js). You only need this file if you're making jQuery calls in your automation (some base_case methods use jQuery).
5+
**jquery-3.2.1.min.js** - This file is used by [base_case.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/fixtures/base_case.py) in activate_jquery(). The activate_jquery() method uses the version at [http://code.jquery.com/jquery-3.2.1.min.js](http://code.jquery.com/jquery-3.2.1.min.js). You only need this file if you're making jQuery calls in your automation (some base_case methods use jQuery).
66

77
**favicon.ico** - This file is used by [style_sheet.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/core/style_sheet.py) for the favicon icon. All it does is make the report page a little more professional-looking. Currently, SeleniumBase uses the version at [https://raw.githubusercontent.com/seleniumbase/SeleniumBase/master/seleniumbase/resources/favicon.ico](https://raw.githubusercontent.com/seleniumbase/SeleniumBase/master/seleniumbase/resources/favicon.ico).

seleniumbase/resources/jquery-3.1.0.min.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

seleniumbase/resources/jquery-3.2.1.min.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setup(
1010
name='seleniumbase',
11-
version='1.4.7',
11+
version='1.4.8',
1212
description='Test Automation Framework - http://seleniumbase.com',
1313
long_description='Automation Framework for Simple & Reliable Web Testing',
1414
platforms='Mac * Windows * Linux * Docker',

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name='seleniumbase',
10-
version='1.4.7',
10+
version='1.4.8',
1111
description='Test Automation Framework - http://seleniumbase.com',
1212
long_description='Automation Framework for Simple & Reliable Web Testing',
1313
platforms='Mac * Windows * Linux * Docker',

0 commit comments

Comments
 (0)