Skip to main content

Mozilla Firefox Accounts Page Object Model

Project description

Selenium WebDriver compatible page object model and utilities for Firefox Accounts

License PyPI Travis Issues Requirements

Overview

This package contains a utility to create a test Firefox Account on either the dev or prod instance of Firefox Accounts, as well as a set of page objects that can be used to interact with Firefox Accounts’ sign in screens.

Installation

python setup.py develop

If running on a Mac, you may need the following before running the above command:

pip install cryptography

Usage

To create a test Firefox Account, simply create an instance of the FxATestAccount object. You can pass the url for the Firefox Accounts API server into the constructor or, if you know you want to create a development Account, you can omit that argument.

There are two constants available to you to specify the url for either the development environment or the production environment, which are:

  • fxapom.DEV_URL - the url for the development environment

  • fxapom.PROD_URL - the url for the production environment

FxAPOM is now able to handle tests written using both Selenium WebDriver and Marionette. Based on the type of driver being used, the package will automatically handle the tests in the way best suited for that driver including all error handling.

Example of creating an account on the development environment, using the default:

from fxapom.fxapom import FxATestAccount
account = FxATestAccount()

Example of creating an account on the development environment, specifying the DEV_URL:

from fxapom.fxapom import DEV_URL, FxATestAccount
account = FxATestAccount(DEV_URL)

To sign in via Firefox Accounts, use the sign_in method in the WebDriverFxA object, passing in the email address and password:

from fxapom.fxapom import WebDriverFxA
fxa = WebDriverFxA(driver)
fxa.sign_in(email_address, password)

Note that we are passing driver into the constructor of WebDriverFxA, which it then uses to interact with the Firefox Accounts web pages. This driver will be identified as either an instance of Selenium or Marionette and the tests will be handled accordingly.

To create an account and then use it to sign in, use both tools described above:

from fxapom.fxapom import FxATestAccount, WebDriverFxA
account = FxATestAccount()
fxa = WebDriverFxA(driver)
fxa.sign_in(account.email, account.password)

Running The Tests

Resources

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

fxapom-1.9.1rc1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

fxapom-1.9.1rc1-py2-none-any.whl (13.4 kB view details)

Uploaded Python 2

File details

Details for the file fxapom-1.9.1rc1.tar.gz.

File metadata

  • Download URL: fxapom-1.9.1rc1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fxapom-1.9.1rc1.tar.gz
Algorithm Hash digest
SHA256 a307b7fded6d07bc2dc6211c306f107913ec898fae4ef8b24586010bacd25e78
MD5 c0fbc051a4674fdb9a83a9004e2b7498
BLAKE2b-256 afefcf5bd3f61ba8437122a5ec621ca18227a70da740d949727be2cfafb6dd2a

See more details on using hashes here.

File details

Details for the file fxapom-1.9.1rc1-py2-none-any.whl.

File metadata

File hashes

Hashes for fxapom-1.9.1rc1-py2-none-any.whl
Algorithm Hash digest
SHA256 6ff26f00e5b1fd90442b7b01fe557521a4510d453bb61c0ad611c56bd14a15b2
MD5 14cb7d62c6e44af6a15bad323694861e
BLAKE2b-256 bb24fefbedfb5a786cca1761ce7fa4e3a7db5d13af43e951afc917c47d1ad28d

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