Skip to content

Update deploy script, jQuery version, reliability #125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Oct 8, 2017
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
21 changes: 14 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,33 @@ language: python
sudo: false
python:
- "2.7"
addons:
firefox: "46.0.1"
chrome: stable
install:
- "pip install --upgrade pip"
- "pip install -r server_requirements.txt"
- "python server_setup.py install"
- "sudo rm -f /etc/boto.cfg"
before_script:
- "flake8 seleniumbase/*.py"
- "flake8 seleniumbase/*/*.py"
- "flake8 seleniumbase/*/*/*.py"
- "flake8 seleniumbase/*/*/*/*.py"
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "export PATH=$PWD/travis_phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH"
- "if [ $(phantomjs --version) != '2.1.1' ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi"
- "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"
- "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"
- "wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2;"
- "tar -xvf ./phantomjs-2.1.1-linux-x86_64.tar.bz2;"
- "export PATH=$PWD/phantomjs-2.1.1-linux-x86_64/bin:$PATH;"
- "phantomjs --version"
- "firefox --version"
- wget http://chromedriver.storage.googleapis.com/2.32/chromedriver_linux64.zip
- unzip chromedriver_linux64.zip
- sudo cp chromedriver /usr/local/bin/
- sudo chmod +x /usr/local/bin/chromedriver
script:
- "nosetests examples/my_first_test.py --with-selenium --browser=chrome -s"
- "pytest examples/my_first_test.py --with-selenium --browser=firefox -s"
- "pytest examples/my_first_test.py --with-selenium --browser=phantomjs"
env:
matrix:
- BROWSER=phantomjs
notifications:
email: false
10 changes: 7 additions & 3 deletions seleniumbase/fixtures/base_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class MyTestClass(BaseCase):
from seleniumbase.fixtures import page_utils
from seleniumbase.fixtures import xpath_to_css
from selenium.common.exceptions import (StaleElementReferenceException,
TimeoutException)
TimeoutException,
WebDriverException)
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
Expand Down Expand Up @@ -507,7 +508,7 @@ def activate_jquery(self):
pass
self.execute_script(
'''var script = document.createElement("script"); '''
'''script.src = "http://code.jquery.com/jquery-3.1.0.min.js"; '''
'''script.src = "http://code.jquery.com/jquery-3.2.1.min.js"; '''
'''document.getElementsByTagName("head")[0]'''
'''.appendChild(script);''')
for x in range(30):
Expand Down Expand Up @@ -1281,7 +1282,10 @@ def _scroll_to_element(self, element):
scroll_script = "window.scrollTo(0, %s);" % element_location
# The old jQuery scroll_script required by=By.CSS_SELECTOR
# scroll_script = "jQuery('%s')[0].scrollIntoView()" % selector
self.execute_script(scroll_script)
try:
self.execute_script(scroll_script)
except WebDriverException:
pass # Older versions of Firefox experienced issues here
self._demo_mode_pause_if_active(tiny=True)

def _slow_scroll_to_element(self, element):
Expand Down
2 changes: 1 addition & 1 deletion seleniumbase/resources/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

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.

**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).
**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).

**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).
4 changes: 0 additions & 4 deletions seleniumbase/resources/jquery-3.1.0.min.js

This file was deleted.

4 changes: 4 additions & 0 deletions seleniumbase/resources/jquery-3.2.1.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='seleniumbase',
version='1.4.7',
version='1.4.8',
description='Test Automation Framework - http://seleniumbase.com',
long_description='Automation Framework for Simple & Reliable Web Testing',
platforms='Mac * Windows * Linux * Docker',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name='seleniumbase',
version='1.4.7',
version='1.4.8',
description='Test Automation Framework - http://seleniumbase.com',
long_description='Automation Framework for Simple & Reliable Web Testing',
platforms='Mac * Windows * Linux * Docker',
Expand Down