Skip to main content

Wrapper around selenium driver to ease testing of Aurelia based applications.

Project description

Wrapper around selenium drivers to ease testing of Aurelia based applications.

Inspired by the aurelia plugin for protractor.

API

The AureliaDriver class takes one positionnal parameter: a selenium webdriver. The full list of drivers is available here.

Options of AureliaDriver

The AureliaDriver class takes the following keyword arguments:

  • script_timeout (default:: 10): the timeout for execute_async_script. This is used internally to wait for the application to be loaded or to complete navigation.

  • default_wait_time (default: 2): the time to wait by default in seconds. This is used by AureliaDriver.wait if no time is supplied and to wait for the in AureliaDriver.load_url to wait for Aurelia to complete the initialization of the page.

  • started_condition (default: None): it is possible that your app will be loaded before the AureliaDriver has the time to register the proper callback in the browser. In this case, load_url will fail because of a time out. To prevent this, you can specify a custom condition you know is fulfilled when Aurelia is started on your application. For instance, if your application has a spinner with the splash class, you can use: document.querySelector("[aurelia-app]").children[0].getAttribute('class') === 'splash'.

load_url

Load the given url and wait for Aurelia to be full initiazed.

  • parameters:

    • url: the url to open.

wait

Sleep for the specified amount of time. If no argument is provided or if seconds is lower or equal than 0, AureliaDriver.default_wait_time will be used.

  • keyword arguments:

    • seconds (default: 0): number of seconds for which to sleep.

find_element_by_binding

Return the first element matching the specified binding.

  • parameters:

    • attr: the name of the attribute used in the binding. For instance, in src.bind="heroSrc" it is src.

    • value: the value for which to look for. For instance, in src.bind="heroSrc", it is heroSrc.

  • keyword arguments:

    • bind_type (default: ‘bind’): the type of binding to use. Possible values are: bind, one-way, two-way.

find_elements_by_binding

Return the list of all the elements matching the specified binding. See find_element_by_binding for details.

Full Example

You can have a look at the example script in selenium_aurelia/test/example.py.

Issues

You can report issues on the issues tracker.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

selenium-aurelia-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

selenium_aurelia-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file selenium-aurelia-0.1.0.tar.gz.

File metadata

File hashes

Hashes for selenium-aurelia-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3743e56e9b3a0c3885a1d99eedc6ea11c864466fb31c5902047c6f164b2b142b
MD5 91e4d8e4595b33f2f98b78bf16773d2b
BLAKE2b-256 a53c2efb7ba5bc7ae39e264bcb86baf90e6b320fd85e600393ac78880afdca57

See more details on using hashes here.

File details

Details for the file selenium_aurelia-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for selenium_aurelia-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7501f48588c260f784e2bf7acfbf369ee3aa54aae43acb0379bc3f1f695b9596
MD5 42295990157121c91553a31fa557f11d
BLAKE2b-256 6cafc678f92c55d0aaa25aee3fe5abf7eed0e19f5fe9fa1d9d5a5415c4cb577f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page