Git Product home page Git Product logo

addon-tests's Introduction

Tests for addons.mozilla.org (amo)

Thank you for checking out Mozilla's Addon-Tests test suite. This repository contains Selenium tests used to test the website addons.mozilla.org.

license travis dev stage prod requirements

Getting involved

We love working with contributors to fill out the Selenium test coverage for Addon-Tests, but it does require a few skills. By contributing to our test suite you will have an opportunity to learn and/or improve your skills with Python, Selenium WebDriver, GitHub, Virtualenv, the Page Object Model, and more.

For some resources for learning about these technologies, take a look at our documentation on Running Web QA automated tests.

The following contributors have submitted pull requests to Addon-Tests:

https://github.com/mozilla/Addon-Tests/contributors

Questions are always welcome

While we take pains to keep our documentation updated, the best source of information is those of us who work on the project.
Don't be afraid to join us in irc.mozilla.org #mozwebqa to ask questions about our Selenium tests. We also have a mailing list available that you are welcome to join and post to.

How to run the tests locally

We maintain a detailed guide to running our automated tests which can be found on the MDN website. If you want to get started quickly, you can try following the steps in our quick-start instructions below:

###Clone the repository If you have cloned this project already then you can skip this, otherwise you'll need to clone this repo using Git. If you do not know how to clone a GitHub repository, check out this [help page] (https://help.github.com/articles/cloning-a-repository/) from GitHub.

If you think you would like to contribute to the tests by writing or maintaining them in the future, it would be a good idea to create a fork of this repository first, and then clone that. GitHub also has great instructions for [forking a repository] (https://help.github.com/articles/fork-a-repo/).

###Create or activate a Python virtual environment You should install this project's dependencies (which is described in the next step) into a virtual environment in order to avoid impacting the rest of your system, and to make problem solving easier. If you already have a virtual environment for these tests, then you should activate it, otherwise you should create a new one. For more information on working with virtual environments see our [our quickstart guide] (https://wiki.mozilla.org/QA/Execution/Web_Testing/Automation/Virtual_Environments) and also [this blog post] (http://www.silverwareconsulting.com/index.cfm/2012/7/24/Getting-Started-with-virtualenv-and-virtualenvwrapper-in-Python).

Install dependencies

Install the Python packages that are needed to run our tests using pip. In a terminal, from the the project root, issue the following command:

pip install -Ur requirements.txt

Create a variables.json file

Some of the tests in this repo need to log into the add-ons website and/or PayPal. We store the credentials (i.e., username and password) to access those sites in a file called variables.json, which we then pass to the tests via the command line. If you want to be able to run any of those tests, you will need your own copy of the variables.json file, which you will update to contain your own credentials. To do that, make a copy of the variables.json file which exists in the project root and update that with your own credentials. You will then pass the name of that file on the command line. For the purposes of the examples below, assume you named your copy of the file my_variables.json.

Run the tests

Tests are run using the command line. Below are a couple of examples of running the tests:

To run all of the desktop tests against the default environment, which is the add-ons development environment:

py.test --driver=firefox --variables=my_variables.json tests/desktop

To run against a different environment, pass in a value for --baseurl, like so:

py.test --baseurl=https://addons.allizom.org --driver=firefox --variables=my_variables.json tests/desktop

The pytest plugin that we use for running tests has a number of advanced command-line options available. To see the options available, try running:

py.test --help

The full documentation for the plugin can be found at the [pytest-mozwebqa GitHub project page] [pymozwebqa]. [pymozwebqa]: https://github.com/mozilla/pytest-mozwebqa

addon-tests's People

Contributors

alexlakatos avatar alint avatar amitverma12 avatar automatedtester avatar bebef1987 avatar bobsilverberg avatar chirarobert avatar davehunt avatar dchunwong avatar els-pnw avatar geoelectric avatar janderssn avatar klrmn avatar m8ttyb avatar marlena avatar mattbasta avatar p0deje avatar pcheng avatar rbillings avatar retornam avatar roarange avatar robert-chira avatar sashakruglov avatar stephendonner avatar stupchiy avatar teodosia avatar tissan avatar tobbi avatar viorelaioia avatar ziranov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.