Ready, Test, Go
Paul VillavicencioMarch 12th, 2019In application development changes are made constantly. To make sure new features don’t break existing functionalities, running automated tests regularly helps catch any issues early on.
At Flo Apps Ltd we run weekly tests on our systems. We check out the latest changes from version control, run end-to-end and integration tests (to ensure the application is performing as designed from start to finish), and verify that all URL paths in the application have correct access restrictions. As our test tools, we use a combination of Behat, Selenium and Selenoid.

Behat is a framework for PHP that uses a human-readable format for writing tests. Tests are defined by describing steps of a web application scenario that will be performed in the browser. For example, logging into the application would require the steps of filling in the user field, then filling in the password and finally clicking the “Log in” button. The test would pass or fail, depending on if the resulting page is what was expected.
Selenium is a great tool for end-to-end tests; it automates tasks on browsers. Selenium runs as a service on the local machine and coordinates the calls from the tests to the configured browsers. While Selenium is great when creating the tests, running a whole suit of test scenarios with it is not adequate since it opens a new browser window or tab on every test, consuming resources of the machine it runs on.
Here is where Selenoid comes in. Selenoid is a replacement to Selenium which runs browsers in Docker containers. The Selenoid service itself runs in a Docker container and provides a view of the tests currently running through a web interface. This allows us to have a better view of how tests are running without interruptions or having to worry about the tests using up resources.
Organizing End-to-End and Integration tests
Behat helps us separate and organize the tests according to feature sets. For example, application features, API tests, integrations with external services, and testing of different application configurations should be separated. We can have a Behat configuration file for each of these feature sets.
.
├── behat
│ ├── bootstrap
│ ├── behat-app.yml
│ ├── behat-api.yml
│ ├── behat-app-configurations.yml
│ ├── behat-integration.yml
│ └── features
│ ├── API
│ ├── App
│ ├── AppConfiguration1
│ ├── AppConfiguration2
│ ├── Integration
…
Know thy URL paths
As applications grow, keeping track of the URL paths’ access rules is important, especially from a security perspective. Access to each URL path should be reviewed.
Most application frameworks have a specific way of defining URL paths in the source code via using Controllers and Actions to define a URL path. We can extract all the exposed URL paths by crawling the source code looking for all the Controller actions. This way we know exactly which URL paths our application is serving and we can then verify that access rules to each route are applied correctly.
Tests allow us to expand our application while keeping the functionalities secure. Tests also help avoid problems when introducing new features. Behat, Selenium and Selenoid are great tools that help us to run tests and keep them organized.
Tags: FloMembers, TestingCategories
- Categories
Archives
- October 2020 (1)
- April 2020 (1)
- October 2019 (1)
- March 2019 (1)
- October 2018 (1)
- February 2018 (1)
- August 2017 (1)
- December 2016 (1)
- June 2016 (1)
- February 2016 (1)
- December 2015 (1)
- September 2015 (1)
- July 2015 (1)
- March 2015 (1)
- December 2014 (1)
- September 2014 (1)
- August 2014 (1)
- May 2014 (1)
- April 2014 (1)
- January 2014 (1)
- November 2013 (1)
- September 2013 (1)
- August 2013 (1)
- May 2013 (2)
- March 2013 (1)
- February 2013 (1)
- June 2012 (1)
- April 2012 (1)
- March 2012 (1)
- February 2012 (1)
- January 2012 (1)
- November 2011 (1)
- October 2011 (1)
- September 2011 (1)
- August 2011 (1)
- July 2011 (1)
- June 2011 (1)
- April 2011 (1)
- March 2011 (3)
- January 2011 (1)
- December 2010 (1)
- November 2010 (2)
- October 2010 (1)
- September 2010 (1)
- August 2010 (1)
Latest comments
Tapio Nurminen on Vuoden 2013 kuntakartta SVG-muodossa
Kartta on vapaasti hyödynnettävissä, mutta lisenssiehdot kannattaa varmistaa Kuntaliitolta.
Arvi Leino on Vuoden 2013 kuntakartta SVG-muodossa
Kartalle on latauslinkki. Onko kartta vapaasti hyödynnettävissä esim. CC By 4.0 käyttöluvalla? ht...