Why we switched to Selenide, simultaneously writing more than 200 new autotests /Maxilect company blog /Habr
Hi, I’m a test automation tool for one of the projects of a large company. In this article, I will explain why we decided to switch from Serenity to Selenide. We have a large-scale task, and although changing the technological stack took some time, later it more than paid off by speeding up the writing of tests and performing regression.
step annotations. Step . I had to update the model, the nesting of elements in each other, the order of calling test steps. Some tests were completely deleted, some were rewritten from scratch, and somewhere just updating the locators was enough. In fact, moving has become a trivial task that most UI automators face when designing a web application.
After updating the technological stack, they took up the tests themselves. By the way, part of this work has already been completed as part of the transition to a new stack.
Given the accumulated lag behind the functionality of projects, they would still have to be rewritten anyway - it is more profitable in time than to look for inconsistencies in such a volume of code.
In total, about 220 autotests have been written at the moment for both the front-end and the back-end. The emphasis in further development will be on the backend, since most of the functional elements on the front end are already involved in autotests. At the same time, it is constantly changing, so the more tests appear on the front-end, the more forces have to be spent on their support.
Having infinite time resources, we always try to direct efforts to what will allow us to reduce labor costs for support, covering functionality as much as possible. Now the coverage of autotests slightly exceeded 50%.
The rewritten tests on Selenide became more compact and accurate due to repeated reuse of the code - all thanks to the capabilities of the library itself.
Updating the tests, we took into account that they need to be run simultaneously (in several threads). Tests were previously run on separate virtual machines. But the transition to Selenide allowed us to parallelize the task even more, running them in several threads.
Roughly speaking, the transition to a new framework itself increased the number of simultaneously launched threads from 3 to ? and the subsequent optimization of tests - up to 50. As a result, 100 UI tests run in just 10 minutes.
Multithreading, by the way, is another advantage for which we chose Selenide. This is not a big layer of boilerplate, you write a minimum of code. There is no superfluous writing that Selenium needs to prepare the project for launch. Everything you need to run the tests is already out of the box.
In parallel with updating and writing new tests, I conducted training for the guys from the testing department, helping them to switch from manual to full-stack testing, so it arrived in the automation regiment on the project. The used technology stack has a lower entry threshold, and the Internet is full of documentation and videos on how to solve certain problems. A month later, I was joined by a couple of testers who could perform tasks related to automation.
Already a whole team, we were able to optimize regression testing. If earlier the regression took 7 days from the team, now the same tasks are performed for 4 days, i.e. We reduced the time of the tests by almost 2 times.
There are many scenarios ahead that have yet to be automated. We automated the Smoke tests almost completely, but now we have switched to the most labor-intensive testing scenarios. This will help further reduce the regression time.
Naturally, we will develop a testing infrastructure. Plans to introduce a Mock server. Now we are testing everything on a real stand, generating test data. It takes time and resources. A mock server will allow you to run autotests without this preliminary preparation (we wrote about A mock server for another project.).
We also plan to implement an autotest record so that you can write a TestRail script based on a workpiece obtained by directly clicking on the interface in the browser. At the output, we get a kind of prototype autotest.
Article author: Yuri Kudryavtsev, Automated Software Testing Specialist.
P.S. We publish our articles on several Runet sites. Subscribe to our pages at VK , FB , Instagram or Telegram channel to learn about all of our publications and other Maxilect news.
It may be interesting
Situs QQ Online
Situs QQ Online