TimeOut BDD Platform |
A BDD platform was introduced to accurately test that essential functionality and user journeys through the site were working as specified by the product team. The platform utilised an array of technologies including:
A suite of BDD tests were introduced and ran in the local Vagrant environment before a pull request was made. The tests then ran on Jenkins at the pull request stage and again on Jenkins against the master branch after pull request approval. Every new feature had to be accompanied with tests to ensure the features integrity.
On Jenkins, the BDD tests ran against the purpose built, in-house selenium grid. This contained a combination of browsers and operating systems. To ensure the sites integrity, every test ran against the most popular browser/OS combinations used by the sites users according the site analytics. Tests ran in parallel to dramatically reduce the execution time of running the test suite against the various combinations.
A mock webserver was installed in both the Vagrant and Jenkins environments to provide real, mocked, HTTP responses during testing.
Screenshots were also taken and saved for both passed and failed tests. This allowed developers to easily see how the page looked including any error messages or layout issues. The screenshots also proved invaluable when testing the responsiveness of the application. The screenshots were then reviewed by the QA team as part of their approval process. The QA team were also trained to write BDD tests. This added tremendous resource for implementing BDD tests for previously unit-test-only approved functionality written before I implemented the platform. Full documentation on the platform and tutorials were included in a dedicated wiki. Setup instructions were included in the README of the github repository. HTML reports were also generated after every test session.
Behat, Mink and various extensions were used to code the actual tests. The BDD platform provided a solid wall against both backend and frontend bugs with many cross browser issues being identified that previously went undetected by unit tests alone. By having an in-house selenium grid massive financial savings were made due to not having to pay the expensive enterprise level subscription fees of the slower performing cloud services like Saucelabs and Browerstack.
Technologies Used
Selenium Grid | Jenkins | Ansible | |||
Behat | Wiremock | Vagrant |