Why we have been starting optimize our autotests?

Roman Strokach
Spin.AI Engineering Blog
2 min readSep 27, 2023

1.Reason.
To start with our framework we had only base process auto coverage. It was not a big project in about 50 tests. For this count of tests we had normal stability and project with ‘helper ‘ classes looked good. Sometimes we wrote new tests in the same style and usually not find time to refactor and optimization but more and more often thought that something needs to be changed. After our product greatly increased functionality and our AQA command grew to 3 people we definitely decided to put project in order.

2.Process.
On this topic I write a little improvements what we had done for optimization.
Firstly, if we decide to refactor the framework we thought about tools. We chose from Selenium, Selenide, Playwright.
In result Selenide is a library for Selenium with small community (for our opinion). Playwright better for automation on JS.
Selenium is a core library with a good community, regular update and a lot of examples in the internet. Obviously, we decided to stay on Selenium.

After searching approach, we agree to use Page Object Model it help to structure the code and support them easier. Also moving to POM to afford us write new tests on independent structure and gradually transfer the old coverage without stop executing.

Test writing style we chose by chains. This method in our opinion makes tests more flexible and readable, although in our case we need to create several similar classes (this is a feature of our product) for divide different provider this method has already proven itself well.

Also, I want to say that we have rewritten jobs in CI to pipeline because such business requirements were received.

3.Result.
In result on now days we have all new tests in new structures and parallel run test in the old structure. Can notice that tests became more stable and supported, also the more we move to a new structure it becomes easier to write all the tests and also read the code. In the screenshot below you can see examples of some tests on different structures. That’s all I wanted to share, thank you for your attention!

--

--