Selenium testing metapackage
Project description
Selenium based automated testing.
Installation
This package requires Python 3.5!
$ pip install edw.seleniumtesting $ seleniumtesting -h
Usage
By itself this product doesn’t do anything. You must provide test suites to be run in the form of pkg_resource plugins. The edw.seleniumtesting.sample suite is registered in such a way to provide an example.
In your own package, after writing the suite (refer to edw.seleniumtesting.sample) you must the following to the setup.py of your package (the sample suite is registered in the same way):
entry_points={ 'edw.seleniumtesting': [ 'my.package.test1 = my.package.test1:suite', 'my.package.test2 = my.package.test2:suite', 'my.package.test3 = my.package.test3:suite', [...] ] }
and pip install my.package. Modifying the list of tests defined in the entry_points will require a re-installation of your package (re-run pip/setuptools/buildout).
To run the my.package.test1, my.package.test2 and my.package.test3 tests in Firefox, specifying the path to geckodriver at the default 1024x768 resolution:
$ seleniumtesting -v -B firefox -P /usr/bin/geckodriver https://localhost my.package.test1 my.package.test2 my.package.test3
To run all tests in phantomjs in glorious 4K resolution:
$ seleniumtesting -v -B phantomjs -P /usr/bin/phantomjs -sw 3840 -sh 2160 https://localhost
Failed tests and tests that encounter an error will save a screenshot in the current working directory.
Browser arguments
Supported for Chrome and Firefox. Can be provided using -A. For example, to run Chrome with the --headless option:
$ seleniumtesting -v -B chrome -P /usr/lib/chromium-browser/chromedriver -A='--headless' https://localhost
Extra arguments
Some test suites might make use of extra arguments (e.g. to provide user account credentials). These can be given using the -ea or --extra-arg parameter. For example:
seleniumtesting http://localhost ns.some.test -ea labels login "Login Button" -ea users testuser testuserpwd
The arguments will be passed to suite as extra_args. Make sure to instantiate your BrowserTestCase subclass with extra_args as well. You will then be able to read the args in the test from self.extra_args.
For the example provided above, self.extra_args will look like this:
{ 'labels': { 'login': 'Login Button' }, 'users': { 'testuser': 'testuserpwd' } }
Contribute
Issue Tracker: https://github.com/eaudeweb/edw.seleniumtesting/issues
Source Code: https://github.com/eaudeweb/edw.seleniumtesting
Documentation: https://github.com/eaudeweb/edw.seleniumtesting/wiki
License
The project is licensed under the GPLv3.
Contributors
David Bătrânu, b’david.batranu@eaudeweb.ro’
Changelog
1.1 (2018-04-25)
Support for browser options (e.g. –headless) [david-batranu]
1.0 (2017-02-17)
Initial release. [david-batranu]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file edw.seleniumtesting-1.1-py3.6.egg
.
File metadata
- Download URL: edw.seleniumtesting-1.1-py3.6.egg
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff444b5449ef2baad5a1b88af0e2b5d46dc0091e20313c68c7b2af8afd579843 |
|
MD5 | b0446ede1e4e1671633ae55fcd9a5827 |
|
BLAKE2b-256 | 8dd57ab363e459aa3ad2a0b551c37cc3a8d5dc65ad42ddc2ef9131cf90ab3236 |
File details
Details for the file edw.seleniumtesting-1.1-py3-none-any.whl
.
File metadata
- Download URL: edw.seleniumtesting-1.1-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b15ad3a3b74d44bb1608b9b2a27dfd14fb22a4ee9b5c8c95b4dbc5ab3d1741b |
|
MD5 | 130a8625018dda6709579bcf447e499a |
|
BLAKE2b-256 | ddcd6bb52e8ea43f007d3ff3b83a8c4e2993f4a0b122f35e36f8af0eb0ea86a7 |