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

  • Install the requirements using pip install -r requirements.txt

  • Run the tests using a local Firefox browser via py.test --driver=Firefox tests

Change Log

1.8.0

  • Pulled in PyFxA 0.2.0, to fix mock-import issue

1.7.2

  • Pulled in latest pyfxa 0.1.3

1.7.1

  • Fix regressions caused by removing implicit waits and Marionette functionality

1.7

1.6

  • Remove the requirement to pass base_url into pages in the page object model.

  • Update readme to remove outdated references to mozwebqa.

1.5

  • Switch the test suite to use pytest-selenium

  • Remove implicit waits from the tests and page objects

1.4

  • Accounts created via FxATestAccount are now automatically deleted when the object leaves scope

  • The create_account method has been removed from FxATestAccount as accounts are now automatically created on instantiation

  • This is a breaking change

1.3.1

  • Change the README to rst format

1.3

  • Change FxATestAccount constructor to accept the url to the FxA API server

  • This is a breaking change

1.2

  • Update required version of PyFxA in setup.py to 0.0.5

1.1

  • Update required version of PyFxA in requirements.txt to 0.0.5

1.0

  • Initial release

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.8.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

fxapom-1.8.0-py2-none-any.whl (17.4 kB view details)

Uploaded Python 2

File details

Details for the file fxapom-1.8.0.tar.gz.

File metadata

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

File hashes

Hashes for fxapom-1.8.0.tar.gz
Algorithm Hash digest
SHA256 0c2608cd76499aba81f2709cac1d56e60b5ffef9de200dd825b287b20001a75c
MD5 1232dc2221e4c8c1d625788ed5b373d2
BLAKE2b-256 87030712a70ed9e1a9706aa978c0763f5cc284959f6b16e2bd88ef51d0757388

See more details on using hashes here.

Provenance

File details

Details for the file fxapom-1.8.0-py2-none-any.whl.

File metadata

File hashes

Hashes for fxapom-1.8.0-py2-none-any.whl
Algorithm Hash digest
SHA256 43fc797f815656be03a3aa38346610253973269160f0cee9ec462ebb4c982077
MD5 abbc966d151b97a9602519408bafb60a
BLAKE2b-256 9504e386e8582cdbe37600b908fa6dd2a1138a63465adaf7d2339316131a3854

See more details on using hashes here.

Provenance

Supported by

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