QA SoftVision Team/WebQA Automation: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with "<div style="clear:both; margin-bottom:20px;"><div style="width:20%; height:105px; float:left; padding: 2px; border: 4px solid rgb(40, 40, 40); background: #dddddd; -moz-border-ra...")
 
No edit summary
 
(28 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<div style="clear:both; margin-bottom:20px;"><div style="width:20%; height:105px; float:left; padding: 2px; border: 4px solid rgb(40, 40, 40); background: #dddddd; -moz-border-radius: 10px; text-align:center; margin-top:15px; margin-right:15px;">
[[Image:WebQAlogo.jpg|thumb|left|200px|WebQAlogo.jpg]]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Welcome to the '''the WebQA Team ''' wiki page.<br>
 
</div><div style="width:72%; float:right; padding: 11px; background: #ffffff; -moz-border-radius: 10px; text-align:left; margin-top:15px; margin-left:0px;">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. </div> </div> <div style="clear:both; margin-bottom:20px;"></div>  
*Welcome to the the Web QA Team wiki page!
= Management and Communication  =
*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.
 
<br>  
 
 
 
 
 
 
 
= Communication  =


=== Project Updates  ===
=== Project Updates  ===
{| class="fullwidth-table"
|-
| style="background: none repeat scroll 0% 0% rgb(239, 239, 239); width: 25%;" | '''Name'''
| style="background: none repeat scroll 0% 0% rgb(239, 239, 239); width: 30%;" | <span style="font-weight: bold;">Email Address</span>
| style="background: none repeat scroll 0% 0% rgb(239, 239, 239); width: 15%;" | '''IRC nick'''
| style="background: none repeat scroll 0% 0% rgb(239, 239, 239); width: 30%;" | '''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
|}


*List of [https://wiki.mozilla.org/QA/Execution/Web_Testing#Team_Members_and_Assignments Team Members]  
*List of [https://wiki.mozilla.org/QA/Execution/Web_Testing#Team_Members_and_Assignments Team Members]  
Line 11: Line 44:
=== Meetings  ===
=== Meetings  ===


*'''Weekly Waverly Meetings '''
*'''Bi-weekly Waverly Meetings '''


  Tuesdays, 8am PT / 4pm GMT
Tuesdays, 8am PT / 4pm GMT
  Dial in: 1-800-707-2533 (pin 369) Conf #245
  Dial in: 1-800-707-2533 (pin 369) Conf #245


*[https://wiki.mozilla.org/QA/Fennec/Waverley#Weekly_Meetings Archive for Weekly Waverly meeting]
*[https://wiki.mozilla.org/QA/Fennec/Waverley#Weekly_Meetings Archive for Weekly Waverly meeting]


*'''Bi-monthly status meetings'''
*'''WebQA meetings'''


  Every other Friday at 9am PDT
Every Thursday, 9am PT
  Dial in: 1-800-707-2533 (pin 369) Conf# 303
  Dial in: 1-800-707-2533 (pin 369) Conf# 303
  [irc://irc.mozilla.org/ irc.mozilla.org #mozwebqa] for backchannel
  [irc://irc.mozilla.org/ irc.mozilla.org #mozwebqa] for backchannel
Line 35: Line 68:
*mozwebqa@mozilla.org
*mozwebqa@mozilla.org


= WebQA =
= Web QA =


== First Steps  ==
== First Steps  ==
Line 44: Line 77:
**[http://seleniumhq.org/docs/ SeleniumHQ Documentation]  
**[http://seleniumhq.org/docs/ SeleniumHQ Documentation]  
**[http://www.developsense.com/blog/2009/08/testing-vs-checking/ The difference between tests and checks]  
**[http://www.developsense.com/blog/2009/08/testing-vs-checking/ The difference between tests and checks]  
*Here are the GitHub locations for AMO, Socorro, SUMO, and Input:  
** [http://css.maxdesign.com.au/selectutorial/index.htm CSS locators]
**[https://github.com/mozilla/Addon-Tests AMO repository]  
*Here are the GitHub locations for all the Web QA projects:
**[https://github.com/mozilla/socorro-tests Socorro repository]  
**[https://github.com/mozilla/Addon-Tests AMO]  
**[https://github.com/mozilla/input-tests Input repository]  
**[https://github.com/mozilla/socorro-tests Socorro]  
**[https://github.com/mozilla/input-tests Input]
**[https://github.com/mozilla/mozillians-tests Mozillians]
**[https://github.com/mozilla/FlightDeck-selenium Flight-Deck]
**[https://github.com/mozilla/mcom-tests Mozilla.com]
**[https://github.com/mozilla/Affiliates-Tests Affiliates]
**[https://github.com/mozilla/caseconductor-tests CaseConductor]
**[https://github.com/mozilla/sumo-tests Sumo]
**[https://github.com/mozilla/mdn-tests MDN]
**[https://github.com/mozilla/BrowserID-Tests BrowserID]
**[https://github.com/mozilla/qmo-tests QMO]
*Each project’s GitHub repository has a README.md that will you help you set up an environment and get tests running for that particular project.  
*Each project’s GitHub repository has a README.md that will you help you set up an environment and get tests running for that particular project.  
*We also have some general [https://wiki.mozilla.org/QA/Execution/Web_Testing/Docs/Automation/Testcases/Guidelines test-writing guidelines] that should be followed.  
*We also have some general [https://wiki.mozilla.org/QA/Execution/Web_Testing/Docs/Automation/Testcases/Guidelines test-writing guidelines] that should be followed.  
*As you begin writing checks, please adhere as closely as possible to the [https://wiki.mozilla.org/QA/Execution/Web_Testing/Docs/Automation/StyleGuide Style Guide].
*As you begin writing checks, please adhere as closely as possible to the [https://wiki.mozilla.org/QA/Execution/Web_Testing/Docs/Automation/StyleGuide Style Guide].
== Accounts ==
* Before you get started, you must have accounts on the following pages:
** http://github.com/ - web-based hosting service for software development projects that use the Git revision control system
** https://www.pivotaltracker.com/ - is a free, web-based project planning tool
** http://litmus.mozilla.org/ - is a web-based, open source, test case management/QA tool
** http://bugzilla.mozilla.com - bug tracking tool
** http://wiki.mozilla.org
** http://mozqa.sync.in account for Scrumpads
== Setup the Work Environment on Win7  ==
=== Git  ===
*Install GitHub on your local machine http://help.github.com/win-set-up-git/
*Create a [http://help.github.com/fork-a-repo/ fork] of the Mozilla github repository on your git repo for the [https://github.com/mozilla/Addon-Tests/ 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 [http://www.python.org/ftp/python/2.6.6/ Python 2.6 (32-bit version)] and include the folder path (''C:\Python26'') into the System Variables: ''System Properties-&gt;Environment Variables-&gt;System Variables-&gt; Path''.
=== Pip Install  ===
*Download the last pip version from [http://pypi.python.org/pypi/pip#downloads here] and uncompress it.
*Install the [http://pypi.python.org/pypi/setuptools#files 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 [http://www.eclipse.org/downloads/ Eclipse].
==== Configure Ecplise for Python  ====
*Launch Eclipse.
*Download PyDev from within Eclipse&nbsp;:
**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 ''PyDe''v and select ''Interpreter-Python''.
**Click ''New...'' and type ''Python26''for 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 [http://code.google.com/p/selenium/downloads/list 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
** py.test --api=rc --baseurl=https://example.com --browser="*firefox"


== Tasks  ==
== Tasks  ==


*Our main task is to convert Litmus tests into automated tests, but we also do code review and merge pull requests.  
*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 [https://www.pivotaltracker.com/projects/310523 Pivotal Traker].
*We receive our tasks in [https://www.pivotaltracker.com/projects/310523 Pivotal Tracker].
*We are involved in the [https://wiki.mozilla.org/Web_Testing/Automation/CodeReviewProcess code review process].
*Handle [https://wiki.mozilla.org/Web_Testing/Automation/CodeReviewProcess#How_to_do_a_merge.3F 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  =
= Additional Information  =

Latest revision as of 21:32, 10 December 2012

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