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. 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
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
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