The Tech Tales. A Tale of Transformation: Accelerating Testing Efficiency with Playwright at OpenPayd

Our Thinking

Posted on May 23, 2024
The Tech Tales. A Tale of Transformation: Accelerating Testing Efficiency with Playwright at OpenPayd
This piece was written by Hasan Gürhan, our senior QA engineer. Hasan is a specialist in quality assurance in financial services, and below explains the testing software and approaches OpenPayd uses.
OpenPayd Editorial Team
OpenPayd Editorial Team
May 23, 2024

At OpenPayd, we believe our excellence in development is only ever as good as the quality and reliability of our platform. When it comes to quality assurance in banking services, you have to be following best practices. We therefore place the utmost importance on a rigorous approach to testing – it’s a cornerstone of our software development lifecycle.

We streamline the testing process by leveraging test automation, enabling the rapid execution of predefined test cases to thoroughly examine the functionality and performance of our platform. This proactive approach not only facilitates early detection and resolution of bugs, but also fosters a culture of continuous improvement, increasing the efficiency of our development efforts and reducing the cost of development.

As our platform has evolved to meet the changing needs and expectations of our users, so too have the complexities of our testing requirements. The expansion of our panel and the corresponding proliferation of user workflows necessitated reevaluating our testing infrastructure. It became increasingly apparent that our traditional testing methodologies were struggling to keep pace with the expanding scope and complexity of our platform. Lengthy test execution times and sporadic test failures were becoming a hindrance to our development velocity and overall productivity.

In response to these challenges, we sought to modernise our testing framework, with a primary focus on improving speed, reliability, and scalability. After careful consideration, we made the strategic decision to move from Selenium to Playwright — driven by the fact that Playwright is a state-of-the-art framework that excels in all the key areas we prioritised.

One of the most compelling features of Playwright was its remarkable execution speed, which significantly outpaced that of Selenium. This enhanced speed not only expedited our test cycles but also enabled us to achieve faster feedback loops, empowering our development teams to iterate more swiftly and efficiently. Additionally, Playwright’s built-in support for automatic waiting and intelligent element identification proved invaluable in reducing flakiness and improving the robustness of our tests.

Furthermore, the ability to capture videos and screenshots of test failures directly within Playwright, without the need for additional development efforts, represented a significant enhancement in our debugging capabilities. This feature not only facilitated more effective issue diagnosis and resolution but also simplified the communication of test results across teams, fostering greater collaboration and transparency throughout the development process.

However, the journey towards a modernised testing infrastructure did not end with the adoption of Playwright. Recognising the importance of scalability and parallelism in further optimising our testing processes, we embraced Playwright’s built-in support for parallel test execution and sharding. By distributing test execution across multiple instances and leveraging cloud-based infrastructure, we were able to achieve unprecedented levels of concurrency, dramatically reducing test execution times and unlocking new levels of scalability.

In conclusion, our transition to Playwright represents a significant milestone in our ongoing quest for excellence in software development and quality assurance. By embracing modern technologies and best practices, we have overcome the challenges posed by our evolving platform while laying a solid foundation for future growth and innovation. Going forward, we are committed to staying at the forefront of technological advancements and continuously improving our testing processes to deliver bug-free software to our users. Below, I provide a little more detail about the parallelism and sharding that Playwright offers.
________

PARALLELISM 

Parallelism refers to the execution of multiple tasks simultaneously, significantly accelerating the testing process. This approach is particularly advantageous in large-scale testing scenarios, where reducing testing time is paramount. To illustrate, let’s consider a scenario where we have 10 test cases, each taking 10 minutes to complete. Without parallel execution, it would require 100 minutes to run all tests sequentially. However, by running tests in 5 parallel streams, we can complete the entire suite in just 20 minutes — 1/5th of the original time.

Imagine a bustling kitchen where multiple chefs work concurrently on different components of a meal. Each chef focuses on their assigned tasks simultaneously, speeding up the preparation process. Parallelism works in the same way, with QA engineers as the chefs enhancing efficiency and reducing overall testing time.

________

SHARDING 

Sharding is the process of distributing test cases across multiple environments to divide the workload. Instead of expanding the existing infrastructure, it involves creating new environments to test different portions.

Continuing with our cooking analogy, a kitchen can only accommodate a certain number of chefs at an optimum level; when faced with increased orders, we need to open a second kitchen area. Each kitchen operates independently, with its own chefs and resources. This division of tasks allows us to manage the increased workload without overburdening a single kitchen.

Similarly, during testing, sharding involves creating multiple testing environments (kitchens). Each of these environments can execute a test case simultaneously. This division of tasks ensures the optimal utilisation of resources and minimises processing time.

For example, if each of the 10 test cases takes 10 minutes to complete, running them in 5 parallel streams would take a total of 20 minutes. With sharding, two groups of test cases, each distributed to its testing environment, can be created. Consequently, each environment executes the test cases simultaneously. This division of tasks saves time and enhances overall testing efficiency.

________

Top tips summary 

  1. Your testing methodologies need to evolve with your tech, especially for software testing in financial services. Continuing to test in the same way when your product or service has grown would be like giving a child the same maths exam they did a year ago when they’ve since been learning French.
  2. The faster you can test (without losing any accuracy) the quicker you can spot bugs and make optimisations. Look at software you can use for paralleling and sharding to improve testing speeds.
  3. Playwright is a highly useful tool for QA in banking, helping to segregate testing in an efficient manner and foster collaboration.