Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 139 lines (86 sloc) 7.059 kB
4989420 @Marlena updated readme...A LOT.
Marlena authored
1 Selenium Tests for addons.mozilla.org (amo)
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
2 ====================
f0fafbe @AutomatedTester initial design of Page Objects and 4 tests'
AutomatedTester authored
3
bea72f9 @Marlena pull request fixes
Marlena authored
4 This repository contains Selenium tests written in Python for testing the website addons.mozilla.org.
f0fafbe @AutomatedTester initial design of Page Objects and 4 tests'
AutomatedTester authored
5
4989420 @Marlena updated readme...A LOT.
Marlena authored
6 Skills needed for contributing effectively
7 ------------------------------------------
8
bea72f9 @Marlena pull request fixes
Marlena authored
9 We love working with contributors to fill out the Selenium test coverage for addons, but it does require a few skills. If you want to contribute automated tests to AMO, you will need to know some Python, some Selenium and you will need some basic familiarity with Github.
4989420 @Marlena updated readme...A LOT.
Marlena authored
10
ce45ae0 @stephendonner Minor, minor typos (extra whitespace char + missing period).
stephendonner authored
11 If you know some Python, it's worth having a look at the Selenium framework to understand the basic concepts of browser based testing and especially page objects. We've got a branch which uses [Selenium RC][SeRC] and a branch which uses [Selenium Webdriver][webdriver].
4989420 @Marlena updated readme...A LOT.
Marlena authored
12
13 If you need to brush up on programming but are eager to start contributing immediately, please consider helping us find bugs in Mozilla [Firefox][firefox] or find bugs in the Mozilla web-sites tested by the [WebQA][webqa] team.
14
ce45ae0 @stephendonner Minor, minor typos (extra whitespace char + missing period).
stephendonner authored
15 To brush up on Python skills before engaging with us, [Dive Into Python][dive] is an excellent resource. MIT also has [lecture notes on Python][mit] available through their open courseware.The programming concepts you will need to know include functions, working with classes, and some object oriented programming basics.
4989420 @Marlena updated readme...A LOT.
Marlena authored
16
17 [mit]: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-189-a-gentle-introduction-to-programming-using-python-january-iap-2011/
18 [dive]: http://diveintopython.nfshost.com/toc/index.html
19 [webqa]: http://quality.mozilla.org/teams/web-qa/
20 [firefox]: http://quality.mozilla.org/teams/desktop-firefox/
21 [SeRC]: http://seleniumhq.org/docs/05_selenium_rc.html
22 [webdriver]: http://seleniumhq.org/docs/03_webdriver.html
23
24 Questions are always welcome
25 ----------------------------
bea72f9 @Marlena pull request fixes
Marlena authored
26 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. Mozilla also hosts the #mozillians chat room to answer your general questions about contributing to Mozilla.
27
28 [mozwebqa]:http://02.chat.mibbit.com/?server=irc.mozilla.org&channel=#mozwebqa
29 [mozillians]:http://02.chat.mibbit.com/?server=irc.mozilla.org&channel=#mozillians
4989420 @Marlena updated readme...A LOT.
Marlena authored
30
31 How to Set up and Build AMO Tests Locally
32 -----------------------------------------
bea72f9 @Marlena pull request fixes
Marlena authored
33 This repository contains Selenium tests used to test the website addons.mozilla.org. This readme file describes who to set up your environment to run the Selenium tests on your local machine. [This wiki page][softvision] has instructions specific to windows.
4989420 @Marlena updated readme...A LOT.
Marlena authored
34
35 [softvision]: https://wiki.mozilla.org/QA_SoftVision_Team/WebQA_Automation
36
37 ###You will need to install the following:
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
38
39 ### Java
40 You will need a version of the [Java Runtime Environment][JRE] installed
41
42 [JRE]: http://www.oracle.com/technetwork/java/javase/downloads/index.html
43
44 ### Python
45 Before you will be able to run these tests you will need to have Python 2.6 installed.
46
4989420 @Marlena updated readme...A LOT.
Marlena authored
47 ### Requirements.txt
bea72f9 @Marlena pull request fixes
Marlena authored
48 This will install several Python libraries needed for running our tests including pytest and our own mozwebqa plugin.
4989420 @Marlena updated readme...A LOT.
Marlena authored
49
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
50 Run
51
52 easy_install pip
53
54 followed by
55
f16d58c @teodosia Updated the README.md to reflect the new folders format of the repo.
teodosia authored
56 sudo pip install -r requirements.txt
c3076b3 @davehunt Updated README.
davehunt authored
57
58 __note__
59
60 If you are running on Ubuntu/Debian you will need to do following first
61
62 sudo apt-get install python-setuptools
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
63
64 to install the required Python libraries.
65
4989420 @Marlena updated readme...A LOT.
Marlena authored
66 ###Virtualenv and Virtualenvwrapper
67 While most of us have had some experience using virtual machines, [virtualenv][venv] is something else entirely. It's used to keep libraries that you install from clashing and messing up your local environment. After installing virtualenv, installing [virtualenvwrapper][wrapper] will give you some nice commands to use with virtualenvwrapper.
68
69 [venv]: http://pypi.python.org/pypi/virtualenv
70 [wrapper]: http://www.doughellmann.com/projects/virtualenvwrapper/
71
72 ### Moz-grid-config
73
bea72f9 @Marlena pull request fixes
Marlena authored
74 [Moz-grid-config][moz-grid] is a separate repository containining our Selenium grid configuration. We recommend git cloning the repository for a couple of reasons:
4989420 @Marlena updated readme...A LOT.
Marlena authored
75
76 1. It will give you access to a profile containing certificate exceptions which you will need.
bea72f9 @Marlena pull request fixes
Marlena authored
77 2. It contains a jar file of the latest Selenium in it's lib directory
4989420 @Marlena updated readme...A LOT.
Marlena authored
78
bea72f9 @Marlena pull request fixes
Marlena authored
79 (If you prefer to download Selenium it's own, you can do that from [here][Selenium Downloads])
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
80
bea72f9 @Marlena pull request fixes
Marlena authored
81 To start the Selenium jar file with the moz-grid-config firefox profile, run the following command line:
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
82
4989420 @Marlena updated readme...A LOT.
Marlena authored
83 java -jar <your path here>/moz-grid-config/lib/selenium-server-standalone-<current version>.jar -firefoxProfileTemplate <your path here>/moz-grid-config/firefoxprofiles/certificateExceptions/
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
84
4989420 @Marlena updated readme...A LOT.
Marlena authored
85 You will need to make sure that the name of your Firefox application matches one of the names in moz-grid-config/grid_configuration.yml. As an example: even though Firefox typically installs without a version number in the name, moz-grid-config requires it to be named "Firefox <version number>".app on mac.
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
86
87 [Selenium Downloads]: http://code.google.com/p/selenium/downloads/list
bea72f9 @Marlena pull request fixes
Marlena authored
88 [moz-grid]:https://github.com/mozilla/moz-grid-config
c3076b3 @davehunt Updated README.
davehunt authored
89 ### Running tests locally
90
4989420 @Marlena updated readme...A LOT.
Marlena authored
91 Tests are run using the py.test library. You will find examples here for running all of the tests, tests in one file and running a single test.
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
92
4989420 @Marlena updated readme...A LOT.
Marlena authored
93 An example of running all tests:
860dec9 @Marlena fix pytest examples
Marlena authored
94
4989420 @Marlena updated readme...A LOT.
Marlena authored
95 py.test --browser="Firefox 7 on Mac OS X" --credentials=/credentials.yaml
96
97 An example of running all of the tests in one file:
860dec9 @Marlena fix pytest examples
Marlena authored
98
4989420 @Marlena updated readme...A LOT.
Marlena authored
99 py.test --browser="Firefox 7 on Mac OS X" --credentials=/credentials.yaml -q tests/test_details_page.py
100
101 An example of running one test in a file:
860dec9 @Marlena fix pytest examples
Marlena authored
102
4989420 @Marlena updated readme...A LOT.
Marlena authored
103 py.test --browser="Firefox 7 on Mac OS X" --credentials=/credentials.yaml -q tests/test_details_page.py -k test_that_external_link_leads_to_addon_website
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
104
f4b2f82 Updated the readme with the new command line options
bebef1987 authored
105 To run the user accounts tests:
106
02eca23 typo fix
bebef1987 authored
107 1. Create an account on the AMO instance
f4b2f82 Updated the readme with the new command line options
bebef1987 authored
108 2. Edit the credentials.yaml with your credentials
109 3. Run the tests with:
110
ae88b54 @davehunt Added mozwebqa.cfg
davehunt authored
111 py.test --credentials=~/credentials.yaml
f4b2f82 Updated the readme with the new command line options
bebef1987 authored
112
113 For more command line options access https://github.com/davehunt/pytest-mozwebqa
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
114
115 Writing Tests
116 -------------
117
118 If you want to get involved and add more tests then there's just a few things
119 we'd like to ask you to do:
120
121 1. Use the [template files][GitHub Templates] for all new tests and page objects
122 2. Follow our simple [style guide][Style Guide]
123 3. Fork this project with your own GitHub account
f16d58c @teodosia Updated the README.md to reflect the new folders format of the repo.
teodosia authored
124 4. Add your test into the "tests" folder and the necessary methods for it into the appropriate file in "pages"
125 5. Make sure all tests are passing, and submit a pull request with your changes
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
126
d26b995 @edunham Fixing broken link in README
edunham authored
127 [GitHub Templates]: https://github.com/mozilla/mozwebqa-test-templates
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
128 [Style Guide]: https://wiki.mozilla.org/QA/Execution/Web_Testing/Docs/Automation/StyleGuide
129
130 License
131 -------
4f8cc9e @teodosia Upgrade license to MPL 2
teodosia authored
132 This software is licensed under the [MPL] 2.0:
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
133
4f8cc9e @teodosia Upgrade license to MPL 2
teodosia authored
134 This Source Code Form is subject to the terms of the Mozilla Public
135 License, v. 2.0. If a copy of the MPL was not distributed with this
136 file, You can obtain one at http://mozilla.org/MPL/2.0/.
1072741 @AutomatedTester Updated README to make it consistent
AutomatedTester authored
137
4f8cc9e @teodosia Upgrade license to MPL 2
teodosia authored
138 [MPL]: http://www.mozilla.org/MPL/2.0/
Something went wrong with that request. Please try again.