QA SoftVision Team/WebQA Automation

From MozillaWiki
Jump to: navigation, search
WebQAlogo.jpg
  • Welcome to the the Web QA Team wiki page!
  • This page is considered a ramp up page and gives a centralization of our tasks. Please contact one of us before changing the content of the page.





Communication

Project Updates

Name Email Address IRC nick Project Assignments
Teodosia Pop teodosia.pop@softvision.ro teodosia WebQA
Florin Strugariu florin.strugariu@softvision.ro Bebe WebQA
Andrei Alin Trif alin.trif@softvision.ro AlinT WebQA

Meetings

  • Bi-weekly Waverly Meetings
Tuesdays, 8am PT / 4pm GMT
Dial in: 1-800-707-2533 (pin 369) Conf #245
  • WebQA meetings
Every Thursday, 9am PT
Dial in: 1-800-707-2533 (pin 369) Conf# 303
irc.mozilla.org #mozwebqa for backchannel

IRC

Mailing Lists

Web QA

First Steps

Accounts

Setup the Work Environment on Win7

Git

  • Install GitHub on your local machine http://help.github.com/win-set-up-git/
  • Create a fork of the Mozilla github repository on your git repo for the AMO project.
  • Clone the the above fork locally, on your machine.
  • The Windows GitHub GUI application cannot successfully authenticate. Use the http version instead of the ssh version.

Python

  • Install Python 2.6 (32-bit version) and include the folder path (C:\Python26) into the System Variables: System Properties->Environment Variables->System Variables-> Path.

Pip Install

  • Download the last pip version from here and uncompress it.
  • Install the 32-bit version of the SetupTools using the provided .exe installer.
  • In cmd, go to the uncompressed pip directory and run python setup.py install
  • Add your C:\Python26\Scripts to the System Variables path.
  • Now you can use the command pip install package on Win.
  • In cmd run pip install pep8.

Java and Eclipse

  • Install the latest version of the Java Runtime Environment.
  • Download and install Eclipse.

Configure Ecplise for Python

  • Launch Eclipse.
  • Download PyDev from within Eclipse :
    • Go to Help → Install New Software
    • Enter http://pydev.org/updates in the Work with: field.
    • After several seconds, two options should appear. Select the PyDev for Eclipse option. Do not select the PyDev Mylyn Integration flag.
    • Click "Next" and "OK" to continue installing PyDev.
    • Select "I accept the terms of the license agreement", then click Finish. The installer will begin to download the plug-in.
    • Note: When you see the Selection Needed dialog box, you must manually check the box before pressing okay. If you do not, it appears that the installation is continuing, but it is not. You must uninstall PyDev, then reinstall.
    • A security warning may appear asking whether you trust the software being installed- click Ok, then ensure the correct items are selected and click Yes. The instillation process will continue.
    • When the installation is complete, you will be asked if you want to restart Eclipse. Select Yes. You may see a Subclipse Usage dialog, just uncheck the box and continue.
  • Configure PyDev:
    • Python must be installed to configure PyDev.
    • Go to Window → Preferences. In the Preferences window, expand PyDev and select Interpreter-Python.
    • Click New... and type Python26for the Interpreter name. For the Interpreter executable, browse to your copy of Python (C:\Program Files\Python26\python.exe), and press Open.
    • Click OK and the Selection Needed Window will appear.
    • Select all but the PySrc and python26.zip and click OK as many times as necessary to exit the preferences. The default selection should be fine.
    • The Interpreter is now set up so that the code you write can be interpreted for the computer to run. You are now ready to start running code.
  • Switch to the Python perspective:
    • Go to Window → Open Perspective → Other and choose PyDev, then click OK. If you look at the upper right corner you will see that the perspective has changed from Java to PyDev.
  • Run tests
    • In Eclipse, go to Window->Preferences->Pydev->PyUnit and --api=rc --baseurl=https://name --browser="*firefox" into Parameters for test runner.

Configure Eclipse for PEP8

  • Select Run-External Tools-External Tools Configurations...
  • Select Program root node.
  • Press New launch configuration button.
  • Enter Name for your launch configuration.
  • Fill following fields:
    • Location - C:\Python26\Scripts\pep8.exe
    • Working directory - ${container_loc}
    • Arguments - ${resource_name}
  • Go to Common tab and make sure that Allocate Console checkbox is checked.

Selenium

  • Download the latest Selenium standalone server here. The filename will be something like selenium-server-standalone-2.5.0.jar.

How To Run Tests

  • Start the Selenium server by running the following command:
    • java -jar selenium-server-standalone-2.5.0.jar -firefoxProfileTemplate path:\firefoxprofiles\certificateExceptions
  • To run tests locally it's a simple case of calling py.test from the project's directory

Tasks

  • Our main task is to convert the manual tests for AMO in Litmus into automated tests, but we also do code review and merge pull requests.
  • We receive our tasks in Pivotal Tracker.
  • We are involved in the code review process.
  • Handle merges when the pulls are ready to be pushed into the repo.

Tips & Tricks

  • When you are using locators, the order to use in the following order :
    • id
    • name
    • CSS
    • Xpath (Use Xpath if there is no other way.)
  • Run PEP8 before you push the code.
  • Do not use complicated code, there is always an easier way.
  • Readability is everything. Pay attention to your variable/class/function names.
  • Add comments in your code if you consider it to be unclear and that the code would be more readable that way.
  • All your code must be in *_page.py. In tests you mainly use Asserts and functions from *_page.py.
  • DO NOT push anything to Mozilla. If you are not sure of something please ask.

Additional Information