Skip to main content

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

License

The project is licensed under the GPLv3.

Contributors

Changelog

1.1 (2018-04-25)

  • Support for browser options (e.g. –headless) [david-batranu]

1.0 (2017-02-17)

  • Initial release. [david-batranu]

Release files for edw.seleniumtesting 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for edw.seleniumtesting 1.1
File Interpreter ABI Platform
edw.seleniumtesting-1.1-py3.6.egg Legacy Egg format - - Details
edw.seleniumtesting-1.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.3 kB

Release files / edw.seleniumtesting-1.1-py3.6.egg

Download URL edw.seleniumtesting-1.1-py3.6.egg
Size 12.8 kB
Tags Egg
SHA-256 checksum
How to use checksums
ff444b5449ef2baad5a1b88af0e2b5d46dc0091e20313c68c7b2af8afd579843
BLAKE2b-256 checksum
How to use checksums
8dd57ab363e459aa3ad2a0b551c37cc3a8d5dc65ad42ddc2ef9131cf90ab3236
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / edw.seleniumtesting-1.1-py3-none-any.whl

Download URL edw.seleniumtesting-1.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b15ad3a3b74d44bb1608b9b2a27dfd14fb22a4ee9b5c8c95b4dbc5ab3d1741b
BLAKE2b-256 checksum
How to use checksums
ddcd6bb52e8ea43f007d3ff3b83a8c4e2993f4a0b122f35e36f8af0eb0ea86a7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1 This release

2 release files

1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page