QA SoftVision Team/WebQA Automation: Difference between revisions

no edit summary
No edit summary
 
(26 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"
{| class="fullwidth-table"
|-
|-
Line 13: Line 24:
|-
|-
| Teodosia Pop  
| Teodosia Pop  
| teodosia.pop@softvision.ro
| teodosia.pop@softvision.ro  
| teodosia
| teodosia  
| AMO 90%, Socorro 10%
| WebQA
|-
|-
| Florin Strugariu
| Florin Strugariu  
| florin.strugariu@softvision.ro
| florin.strugariu@softvision.ro  
| Bebe
| Bebe  
| AMO 90%, Socorro 10%
| WebQA
|-
|-
| Alin Trif
| Andrei Alin Trif
| alin.trif@softvision.ro
| alin.trif@softvision.ro  
| AlinT
| AlinT  
| AMO 50%, Socorro 50%
| 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]  
*[https://wiki.mozilla.org/QA/Execution/Web_Testing/Etherpads Weekly Scrum Pads]
*[https://wiki.mozilla.org/QA/Execution/Web_Testing/Etherpads Weekly Scrum Pads]
Line 32: Line 44:
=== Meetings  ===
=== Meetings  ===


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


  Tuesdays, 8am PT / 4pm GMT
  Tuesdays, 8am PT / 4pm GMT
Line 39: Line 51:
*[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, 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 56: Line 68:
*mozwebqa@mozilla.org
*mozwebqa@mozilla.org


= WebQA =
= Web QA =


== First Steps  ==
== First Steps  ==
Line 65: 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  ==
== Setup the Work Environment on Win7  ==
Line 80: Line 111:
*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].  
*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.
*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  ===
=== 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''.
*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''.
* [http://code.google.com/p/selenium/source/browse/trunk/selenium/src/py/selenium.py?r=8154  Download the selenium.py file] and save it into the Python folder's location (''C:\Python26'').
 
=== 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  ====


=== Pip Install ===
*Launch Eclipse.
* 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 Python] 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 ===
*Download PyDev from within Eclipse&nbsp;:
* Install the latest version of the Java Runtime Environment.
**Go to ''Help → Install New Software''
* Download and install [http://www.eclipse.org/downloads/ Eclipse].
**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 Ecplise for Python ====
*Configure PyDev:
* Launch Eclipse.
**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.


* Download PyDev from within Eclipse :
*Switch to the Python perspective:  
** Go to ''Help Install New Software''
**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''.
** 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:
* Run tests
** Python must be installed to configure PyDev.
** In Eclipse, go to ''Window->Preferences->Pydev->PyUnit'' and ''--api=rc --baseurl=https://name --browser="*firefox"'' into ''Parameters for test runner''.
** Go to ''Window Preferences''. In the ''Preferences'' window, expand ''PyDe''v and select ''Interpreter-Python''.
** Click ''New...' and type ''Python32'' 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:
==== Configure Eclipse for PEP8 ====
** 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''.
 
==== Configure Eclipse for PEP8 ====  
*Select ''Run-External Tools-External Tools Configurations...''  
* Select ''Run-External Tools-External Tools Configurations...''  
*Select ''Program'' root node.  
* Select ''Program'' root node.  
*Press ''New launch configuration button''.  
* Press ''New launch configuration button''.  
*Enter ''Name'' for your launch configuration.  
* Enter ''Name'' for your launch configuration.
*Fill following fields:  
** Fill following fields:
**''Location'' - ''C:\Python26\Scripts\pep8.exe''  
** Location - ''C:\Python26\Scripts\pep8.exe''
**''Working directory'' - ''${container_loc}''  
** ''Working directory'' - ''${container_loc}''
**''Arguments'' - ''${resource_name}''  
** ''Arguments'' - ''${resource_name}''
*Go to ''Common'' tab and make sure that ''Allocate Console'' checkbox is checked.
* 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  ==
Line 136: Line 184:
*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.  
*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 Tracker].
*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  =
Confirmed users
9,511

edits