3 Ways for Faster Software Testing: Cypress, Playwright, and E2E Tests!

Johnston Harris
5 min readDec 23, 2020

Test Automation takes a Long Time!

E2E Automated test frameworks such as Cypress.io, Playwright, and Selenium can take a long time to complete. No wonder why development teams are frequently researching methods for faster automated testing.

Whether your test suite consists of UI tests, End-to-End Tests, Integration tests, any amount of time the team spends waiting on test results hurts output. It’s no surprise automated test suites are the culprit for slower cycle times, delayed releases, laborious rework,…and ultimately team frustration. Achieving true TestOps is not always a straight forward path.

After 15 years in the software testing space, here we will dive into three options available in the market we’ve implemented in the past to improve timely feedback from testing. Parallel Testing, Machine Learning for Prioritized Testing, and Narrow-Scope Testing.

1. Running your tests in Parallel

Parallel testing is a method to execute several test scripts concurrently, with each test consuming different resources. The objective of parallel testing is to resolve the constraints of time by distributing tests across available resources. In theory, the more threads you have the more tests you can run simultaneously. Speed, Better Coverage, Optimization of your CI/CD Processes are all accomplished when parallelism is meticulously executed. This method works especially well with opensource test frameworks, such as Selenium, Appium, and or Serenity.

CON:

Many testers find it difficult to run tests in parallel because of dependencies between various test cases. If tests are dependent on each other, they need to be run in a particular order — AKA not in parallel or else things begin to break. So even if you wanted multiple threads running tests in sync, it doesn’t do much good because many tests rely on each other passing. Therefore there is a cap on how much you can test in parallel. And the more threads you open make no difference in time saved.

CON:

The more threads you have running, be prepared for a major resource demand from your test infrastructure. To achieve faster feedback by running more processes simultaneously, something’s gotta give. And in this case it’s very high CPU and Memory utilization. If you are testing locally, allocate additional resources and make sure systems are up to date. If you push up to the cloud, expect high utilization and a sobering monthly bill.

2. Use AI to Prioritize Automated Tests:

There’s been vast improvements in leveraging machine learning in the QA software testing space in the last 18–24 months. One area of significant value AI can play is building out a classification model that learns from prior test failures. By analyzing failures, AI can build a surprisingly accurate risk-based testing model to predict the likelihood of future failures. After any change to the code, the AI model can accurately predict and automatically run just the subset of affected tests associated with the code change area. Essentially saying, why run 500 Cypress tests when only 50–60 were affected?

Teams now only run a small portion of their full test suite after each developer commit for faster automated software testing. For example, by only running 10% of their Cypress test-suite after each change, teams can expect to get results back in 90% less time than it would take for the whole test-suite to complete.

Additionally, AI adds value to pre-existing test strategies such as Parallelism and Narrow-Scope Testing. There are certain AI Risk based testing tools currently available, such as Appsurify, that are completely agonistic to current test practices. TestBrain can simply plug into the background for faster smarter software testing to achieve a shift left testing strategy.

CON:

Software testers will likely be concerned the AI model will miss defects.

AI tools are meant to help QA get higher quality feedback to the team rapidly after each commit — thereby saving precious downtime waiting for results and alleviating the bottleneck test suites create. The tradeoff occurs at the confidence level you want to select the AI model tool to run. Appsurify, for example, is able to catch 98.5% of bugs by only running 10% of the test-suite.

A good AI tool for testing is meant to enhance existing test practices so that QA can test more frequently and accurately throughout the day. Best practice would have teams running the prioritized tests throughout the day, and then only running the whole test suite once a week, or month, or before major release. This is how tech titans, such as Google and Facebook, conduct their testing.

3. Narrow Scope Testing:

If time is something your team has, then reducing the scope of what you are testing helps speed up results.

Software testers target important features of the application and build test scripts around them. This method reduces the amount of tests that need to be run on a frequent basis, and helps get feedback to the team in a more orderly fashion. For this method to be performed accurately, the QA team should look into investing in strong Test Management Tools to help prioritize areas of focus for all contributing members.

CON:

Nothing says these narrow scripts will remain relevant. If a change takes place, prepare for the test scope to be adjusted. To reliably and consistently yield strong results, the scope needs to be routinely monitored and updated. This can take more time and resources than originally anticipated.

Carving out target areas and building test scripts around them is a very manual, high maintenance, and time-intensive process for opensource frameworks, such as Cypress, Playwright, and Selenium.

In Conclusion

Various strategies exist to enhance current test practices and speed up results from opensource test frameworks. Some may be more advanced, realistic, and easier to adopt than others for their open source test frameworks. After years of experience with Selenium, Appium, and Cucumber, we’ve found either parallelism, narrow-scope, and or AI to be the more economical and effective approaches.

With so many issues arising from long test suites, adopting one of these strategies will only help your productivity. Delayed feedback, context switching, dealing with a flaky test, can all be alleviated through enhanced software testing practices. AI has the potential to address the bulk of these issues in an economical and easily implemented fashion. Appsurify was developed to give time and resources back to the software development community.

--

--