Repository navigation
Modified how Travis CI is used with the project. #716
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
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
25bd96e
Modified how Travis CI is used with the project.
aaltat 5ec33ef
Changed selenium 3 run from Python 3 to Python 2.
aaltat 4cf8106
Changed chrome browser always to run from Travis
aaltat 22b4c55
Downloading chrome driver and putting it to path
aaltat adf2b06
Allowing Sauce Labs to choose chrome version and the OS
aaltat a175b0b
Updated based on review
aaltat 5edfe7d
Enhanced documation and Robot Framework command line args
aaltat 60b2cc3
Added support for "py -2" for windows and test/README.rst
aaltat 377adf6
Removed env.py
aaltat 50fc8da
Spell checks performed
aaltat 2475ba3
Fixed documentation based on comments
aaltat 6bdbbb0
Added doc string to the module
aaltat fe5e179
Fixed based on comments
aaltat f19b194
Fixed based on comments
aaltat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,52 +1,43 @@ | ||
| addons: | ||
| firefox: latest-esr | ||
| language: python | ||
| sudo: false | ||
| sudo: required | ||
| dist: trusty | ||
| addons: | ||
| apt: | ||
| sources: | ||
| - google-chrome | ||
| packages: | ||
| - google-chrome-stable | ||
| before_install: | ||
| - CDVERSION=`curl http://chromedriver.storage.googleapis.com/LATEST_RELEASE` | ||
| - wget http://chromedriver.storage.googleapis.com/$CDVERSION/chromedriver_linux64.zip | ||
| - unzip chromedriver_linux64.zip | ||
| - sudo chmod u+x chromedriver | ||
| - sudo mv chromedriver /usr/bin/ | ||
| install: | ||
| - pip install . | ||
| - pip install -r requirements.txt | ||
| - pip install -r requirements-dev.txt | ||
| before_script: | ||
| - "export DISPLAY=:99.0" | ||
| - "sh -e /etc/init.d/xvfb start" | ||
| script: | ||
| - "if [[ -n ${SELENIUM_VERSION+x} ]]; then pip install -U selenium==${SELENIUM_VERSION}; fi" | ||
| - "python test/run_tests.py python \"$BROWSER\"" | ||
| env: | ||
| global: | ||
| - secure: "QyY0j8C+hVhsGLv4YU0UMvLm5wBDg6xT5J0Ee77C/JAQ6vcdCMpTfWI8oDxTZb7pBhpDkYuNe747yCYF5PrdBYQbO08FilxctReuJfMXcH44rZC5q49mUmPamkvg1LkzIWuC1s9uKnjlvyDT5ojuPXZl2Vn0gIhSIg+yOyBkM1U=" | ||
| - secure: "HJaJTYauaBZODMDkbnRVsiCk+t2uVtztkkJ5V4dXSnE1uIBms2PVbufQwb+YNvzHkGheLtpnt/hLM1HhmSFgUtOCf+eumQ6kaLR2KRVEysXwWJzgZoLBidNBOy5rvAIsc9JJbDaIgYVGzyaJGTP9AMb8CyvIPE//lH10sf+GB7g=" | ||
| matrix: | ||
| include: | ||
| - os: linux | ||
| env: | ||
| - BROWSER=firefox | ||
| - SELENIUM_VERSION=2.53.6 | ||
| addons: | ||
| firefox: "47.0.1" | ||
| python: "2.7" | ||
| - os: linux | ||
| - python: "2.7" # For PR and cron | ||
| env: | ||
| - BROWSER=chrome | ||
| addons: | ||
| sauce_connect: true | ||
| python: "2.7" | ||
| - os: linux | ||
| - SELENIUM=2.53.6 | ||
| - python: "3.3" # For PR and cron | ||
| env: | ||
| - BROWSER=firefox | ||
| - SELENIUM_VERSION=2.53.6 | ||
| addons: | ||
| sauce_connect: true | ||
| python: "3.4" | ||
| - os: linux | ||
| - BROWSER=chrome | ||
| - SELENIUM=2.53.6 | ||
| - python: "2.7" # For PR and cron | ||
| env: | ||
| - BROWSER="internet explorer" | ||
| addons: | ||
| sauce_connect: true | ||
| python: "2.7" | ||
| - os: linux | ||
| - BROWSER=chrome | ||
| - SELENIUM=3.0.2 | ||
| - python: "3.3" # For cron only | ||
| env: | ||
| - BROWSER=safari | ||
| addons: | ||
| sauce_connect: true | ||
| python: "2.7" | ||
| - BROWSER=firefox | ||
| - SELENIUM=2.53.6 | ||
| before_script: | ||
| - "export DISPLAY=:99.0" | ||
| - "sh -e /etc/init.d/xvfb start" | ||
| - pip install selenium==$SELENIUM | ||
| script: | ||
| - python test/run_tests.py $BROWSER |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| Testing and debugging | ||
| ===================== | ||
| Requirements | ||
| ------------ | ||
| Before running the test, install the dependencies:: | ||
|
|
||
| pip install -r requirements.txt | ||
| pip install -r requirements-dev.txt | ||
|
|
||
|
|
||
| Unit and Acceptance Tests | ||
| ------------------------- | ||
|
|
||
| The test directory contains everything needed to run Selenium2Library | ||
| tests with Robot Framework. This includes: | ||
|
|
||
| - Unit tests under `unit` directory. | ||
| - Acceptance tests written with Robot Framework under `acceptance` | ||
| directory | ||
| - A very simple `httpserver.py` which is used to serve the html for tests in | ||
| `resources/testserver` | ||
| - A collection of simple html files under `resources/html` directory | ||
| - Start-up scripts for executing the tests: `run_tests.py` and | ||
| `run_unit_tests.py` | ||
|
|
||
| To run unit and acceptance tests, run:: | ||
|
|
||
| python test/run_tests.py <browser> | ||
|
|
||
| Tests are executed using Robot Framework and results verified automatically | ||
| afterwards using `robotstatuschecker` tool. The tool can be installed using | ||
| `pip install robotstatuschecker` and more information about it can be found | ||
| from: https://github.com/robotframework/statuschecker/. Notice that initially | ||
| some tests fail. | ||
|
|
||
| Running test with different interpreter | ||
| --------------------------------------- | ||
|
|
||
| By default the interpreter is set to `python` and it depends on the operating | ||
| system settings, which python is used by default. It is possible to run test | ||
| by using different interpreter by using the `--interpreter` command line | ||
| argument. | ||
|
|
||
| Starting from version 2.0 onwards the Selenium2Library is tested by using | ||
| Python 2 and 3. Other interpreters are not tested by the development team. | ||
|
|
||
|
|
||
| Robot Framework command line arguments | ||
| -------------------------------------- | ||
|
|
||
| It is possible to pass Robot Framework command line arguments to the test | ||
| execution as last arguments to the `run_tests.py` command. It is recommended | ||
| to use arguments to select required suite or test for the execution when | ||
| developing new functionality for the library. Example like --test, --suite, | ||
| --include and --exclude. | ||
|
|
||
|
|
||
| Using Sauce Labs for acceptance tests | ||
| ------------------------------------- | ||
|
|
||
| When running test by using browser from Sauce labs, it is required that the | ||
| Sauce Connect is used. The Sauce Connect allows the browser from Sauce Labs | ||
| reach the acceptance test web server. The acceptance test uses tunnel with | ||
| name `localtunnel` and therefore when establishing the Sauce Connect tunnel | ||
| use the following command:: | ||
|
|
||
| bin/sc -u YOUR_USERNAME -k YOUR_ACCESS_KEY -i localtunnel | ||
|
|
||
| More details and to download Sauce Connect visit: | ||
| https://wiki.saucelabs.com/display/DOCS/High+Availability+Sauce+Connect+Setup | ||
|
|
||
|
|
||
| Examples | ||
| -------- | ||
|
|
||
| Examples:: | ||
|
|
||
| run_tests.py chrome | ||
| run_tests.py --interpreter jython firefox --suite javascript | ||
| run_tests.py chrome --sauceusername your_username --saucekey account_key --suite javascript | ||
| run_tests.py --interpreter "py -2" chrome --suite javascript | ||
|
|
||
| To run just the unit tests, run:: | ||
|
|
||
| python test/run_unit_tests.py | ||
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There probably should be an empty row after
::.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done