In 2011 Mozilla developed and released a pytest plugin that simplified the task of maintaining functional UI tests for over a dozen web applications. It has served us well, but its uses outside of Mozilla are limited - unless you happen to have exactly the same requirements as us. To address this, the plugin has been shattered into three: pytest-selenium provides a Selenium instance and browser (with some nice new features); pytest-html provides a handy HTML report; and pytest-variables provides a useful way to inject variables into your tests.
4. pytest-mozwebqa
The clue is in the name...
✓ share common code
✓ transition to WebDriver
✓ custom HTML reports
✓ sauce labs integration
✓ credentials injection
๏ bespoke to Mozilla’s needs
๏ solves too many problems
๏ slow release process
๏ inadequate documentation
๏ incompatible with “live servers”
Working for Mozilla for the last 5 years as an automation engineer on Firefox, Firefox OS, and Web.
Contributor to the Selenium project and past organiser of the London Selenium meetups.
Our mission is to provide data, services and tools to positively impact the quality of Mozilla websites.
Six team members across North America, Canada, and UK. Most of us here tonight.
Foundation of our framework
Selenium - Mature, reliable browser automation. Originally Selenium RC, later WebDriver.
Python - Familiarity of the language within Mozilla. Expressive and maintainable compared to Java.
pytest - We wanted to run tests in parallel, nose had a problem with jUnit XML reports. Extensible through fixtures and plugins.
Common code - same code for launching browsers, etc in over a dozen projects
Credentials - supporting private variables in public test repositories
Bespoke - custom and unfocused, hence the terrible name for the plugin
Release process - change in the HTML report didn’t necessarily justify a release/update
Live servers - local instance of the application created by the test harness (flaskr, django)
Providing one or more JSON files on the command line to be accessible as a dictionary in your tests.
Elegant HTML reports for any users of pytest that can be extended.
Environment and links can be augmented.
Since initial release in April we’ve had seven pull requests from two contributors and eight releases!
This is a screenshot from one of those contributors.
Selenium RC is ‘legacy’ and likely to removed from the project in the near future.
Documentation is in readthedocs.