Skip to main content

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.

  • wait_on_navigation wait for default_wait_time after each navigation before continuing the script.

  • 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.

navigate

Context manager in which you can to your navigation operation to ensure the app navigated to the new URL and was updated before continuing your tests. Use like this:

with driver.navigate():
    link.click()

assert no_new_page
  • keyword arguments:

    • wait (default: 0): time to wait after navigation before continuing. There are several cases to consider:

      1. If wait is greater than 0, the driver will wait for the specified time.

      2. If self.wait_on_navigation is True and wait is lower or equal than 0, the driver will wait for self.default_wait_time.

      3. If self.wait_on_navigation is False and wait is lower or equal than 0, the driver will not wait.

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.

Changelog

v0.1.1

  • Add option to wait after navigation (wait_on_navigation in constructor and wait in the navigate method).

v0.1.0

Initial release.

Metadata

Release files for selenium-aurelia 0.1.1

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

Source distribution (sdist)

Source distribution for selenium-aurelia 0.1.1
File Size Uploaded Provenance Actions
selenium-aurelia-0.1.1.tar.gz 6.6 kB Without provenance Details for selenium-aurelia-0.1.1.tar.gz

Release files / selenium-aurelia-0.1.1.tar.gz

Download URL selenium-aurelia-0.1.1.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
673d7b6da34f823c392d48f2c3365724b13af9ceeb66fb6a94326e298be0cb09
BLAKE2b-256 checksum
How to use checksums
4595795f2dcc3259a1941a8c7cd2f3b2d789bbc8b1e9e2b25e03e3488f118fc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for selenium-aurelia 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file No provenance

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