Testing web applications

Example scenario: automating regression tests for frequent releases

The team wants to prepare releases more frequently, but before each one it needs to repeat the same user journeys. Manual testing consumes a significant portion of its capacity, and the result arrives late. Automating repeatable checks may free time for new and unforeseen risks. Human assessment remains part of the plan.

Starting point

The web application or online store changes in short cycles. Before a release, the team verifies sign-in, search, ordering, payment, and other important flows. When the deadline gets shorter, so does the list of checks, or the team tests mainly what has changed.

A defect can also appear in a seemingly unrelated area. The team therefore has to choose between waiting longer for the release and taking a greater risk in production. If automated tests already exist, some of them may fail intermittently, which means that the results need repeated manual investigation.

How the situation can be addressed

1. Map the risk and the current time spent

First, list the scenarios being checked, how long they take, and the impact of a potential defect. Use this information to select the first journeys suitable for automation. They may include sign-in, ordering, or payment, but not automatically everything.

2. Prepare the conditions for stable tests

Tests need a stable way to find elements, their own data, and an environment in which they can safely complete the entire scenario. We describe these conditions in how to prepare a website for automated tests.

Repeated parts of the interface are separated from the scenarios themselves, for example with the Page Object Model or component objects. Large numbers of combinations can be checked at the API level where appropriate, because those tests are often faster and easier to diagnose.

3. Introduce tests gradually

The first small suite can run in CI/CD on agreed changes and regularly in the test environment. When a test fails, the team should receive enough information to make a decision, such as an error message and, depending on the configuration, a trace, screenshot, or video. More scenarios are added only after the results are stable and the team responds to them.

4. Measure the result

Compare the time spent on the manual check, the duration of the automated run, the number of intermittent failures, and the maintenance time. Only measurement will show whether feedback has shortened from days to hours or from hours to minutes. The same data helps determine what to automate next.

Establish what the release is actually waiting for

This is an illustrative situation, rather than a particular project’s result. Before changing the process, record when data preparation and checks begin, when the last result arrives and when the release decision is made. Waiting for an environment, rerunning an unclear test and manual verification have different costs. Rewriting steps as a script will not resolve an unavailable environment if that consumes most of the time.

Measure human effort too. A five-hour check by one tester differs from five hours of work shared among several people. Summed test durations need not equal the wait for a whole suite. Compare the same journeys, data, environments and required checks.

Divide checks by risk and required layer

The following table illustrates a possible division, rather than a mandatory initial suite for every shop:

Illustrative check What to automate What remains separate
Signing in with a prepared account A short journey and correct sign-in outcome Other roles, access recovery and untested configurations
Price and order creation Rule combinations at a lower layer and a selected UI journey New unclear business rules and exploration
A declined payment Our response to a controlled error and final state Agreed gateway integration checks and assessment of clarity

Give each omitted question an owner and verification plan. Do not simplify an important scenario merely to make it look more stable. Automation must preserve the agreed expectation, rather than only navigate the same screen.

The pilot must verify stability and diagnosis

Playwright recommends independent test state and checking user outcomes. Pilot accounts and data must therefore not depend on accidental execution order. Two concurrent tests must not modify the same basket. Parallel execution can reduce waiting but needs sufficient capacity and independent data.

Introduce a known fault in a safe environment and check that the test fails for the correct reason. Establish whether a colleague can find the step, expectation, actual state and application version in the report. Also check alert delivery and result acknowledgement.

Configure trace collection deliberately. Playwright Test’s example configuration records a trace on the first retry, so it may not contain the initial failed attempt. Match evidence to diagnosis needs and restrict access to sensitive data. Python pytest-playwright has its own runner settings and does not automatically inherit Playwright Test configuration.

An illustrative comparison of work and waiting

Consider a selected group of checks that one tester completes manually in five hours. After automating the same group, CI waits ten minutes in a queue, execution takes 25 minutes and assessment takes 15 minutes. If these stages are sequential, usable feedback arrives in 50 minutes, rather than the 25-minute execution time alone.

Add one hour of maintenance allocated to this comparison to human effort. Along with assessment, that makes 75 minutes of work, which must not be confused with machine time. Maintenance occurs outside the stated waiting path in this model. If it must happen before a result is available, it extends waiting too.

These fictional figures exclude suite creation, licences and infrastructure. The model assumes data is already prepared for both options. Other manual checks and release decisions remain outside the comparison. The result therefore does not mean an entire release takes 50 minutes. Measure the actual benefit including data preparation, repairs and failed runs.

Keep operating rules visible

Define which checks block merging or release, who classifies a failure and who decides on an exception. A green report does not cover untested scenarios. If a test is omitted, retain the visible risk, replacement check and next review date. See who owns the tests for a practical division of responsibilities.

After the pilot, expand according to remaining risks and measured effort. If diagnosis or maintenance time grows, fix the cause first. More automated tests alone do not guarantee faster releases. The plan still needs room for new features and human assessment.

What to watch out for

An automated test can fail because of the application, the test, or the environment. The goal is therefore not to promise that every red result means a product defect, but to reduce ambiguous failures enough for the team to assess the result quickly. It is equally important to assign an owner for maintenance after every application change.

What users and the team gain

Next step

Measure which manual checks take the longest before a release and which protect against the greatest risk. If you would like to prepare a realistic pilot, contact us. We will propose the scope, execution method, and metrics for evaluating its value.

Related topics

You might also be interested in

Catch bugs before they reach users

End-to-end tests of key scenarios can run automatically in CI/CD to catch bugs before they reach customers.