Magento Selenium2 testingAutomated browser testing by elgentos
What is automated testing?• Functionality testing• Not to be confused with unit testing (code  coverage)• Leverage new tec...
Why use automated testing?• Magento is complex, and so are its workflows• It is hard to keep track of all depencies after ...
Stuff needed• Selenium2                   (v2.25) http://seleniumhq.org• Magento Mink extension by jreinke https://github....
Basic flow~/magento/shell/mink.php       Elgentos_Testsuite_Test_Mink_Tests                                               ...
Scenarios handled•   Visit homepage•   Visit random category•   Visit random product•   Place product in cart (all types)•...
Notification types•   E-mail notification•   Text message notification•   Airbrake notifications•   Codebase Exceptions•  ...
How to start it?• Comment out line 130 and 343 in  app/code/community/JR/Mink/Test/Mink.php when using Chromedriver;  Sele...
Confused? Don’t worry! We’ll handle it all for you!                   Introducing:MagentoMonitoring.com
Upcoming SlideShare
Loading in …5
×

Magento selenium testing

4,161 views

Published on

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,161
On SlideShare
0
From Embeds
0
Number of Embeds
73
Actions
Shares
0
Downloads
22
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Magento selenium testing

  1. 1. Magento Selenium2 testingAutomated browser testing by elgentos
  2. 2. What is automated testing?• Functionality testing• Not to be confused with unit testing (code coverage)• Leverage new technologies (Behat/Mink) to repeatedly simulate a webshop customer
  3. 3. Why use automated testing?• Magento is complex, and so are its workflows• It is hard to keep track of all depencies after deployment of your newly written code• Run tests after deployment to ensure everything works as expected• Manual testing takes too long and is boring
  4. 4. Stuff needed• Selenium2 (v2.25) http://seleniumhq.org• Magento Mink extension by jreinke https://github.com/jreinke/magento-mink• Mink Selenium2 driver (v1.0.0) https://github.com/Behat/MinkSelenium2Driver• Google Chrome (v21.0.11180.89) http://code.google.com/p/selenium/wiki/ChromeDriver• Chromedriver (v23.0.1240.0) http://askubuntu.com/questions/79280/how-to-install-chrome-browser-properly-via-command-line#79284• Xvfb (v2:1.7.7-14) sudo apt-get install xvfb
  5. 5. Basic flow~/magento/shell/mink.php Elgentos_Testsuite_Test_Mink_Tests X Virtual FrameBuffer
  6. 6. Scenarios handled• Visit homepage• Visit random category• Visit random product• Place product in cart (all types)• Create account• Place order as guest (OneStepCheckout supported)• Place order as customer while previously logged in• Place order as customer while logging in in checkout• Send mail through contact form• Find product through Search
  7. 7. Notification types• E-mail notification• Text message notification• Airbrake notifications• Codebase Exceptions• Magento system.log
  8. 8. How to start it?• Comment out line 130 and 343 in app/code/community/JR/Mink/Test/Mink.php when using Chromedriver; Selenium2 doesn’t support setting headers & requesting status codes• Add ‘$status = 200;’ on line 131 to trick Selenium.• Give Selenium2Driver() function ‘chrome’ as first argument on line 298• Run Xvfb to set up your virtual screen; Xvfb :99 –screen 0 1280x1024x24 &• Run Selenium; DISPLAY=:99 java-jar selenium-server-standalone-2.25.0.jar &• Take screenshots every second by running watch –n 1 “DISPLAY=:99 import –window root screenshot.png”• Start the testsuite by running php ~/magento/shell/mink.php
  9. 9. Confused? Don’t worry! We’ll handle it all for you! Introducing:MagentoMonitoring.com

×