Testing web applications

Which test scenarios should you automate first?

Automate scenarios first when their failure would have a serious impact and you can check them repeatedly against a clear expected result. Frequent manual checks are another reason to include a scenario early, but a rare case with substantial harm must not drop off the list. For every candidate, separate the importance of coverage from its readiness for automation.

Start with the consequences of a defect, rather than the test count

Dozens of footer checks can pass while a customer cannot complete an order. The number of tests therefore does not show whether you protect important processes. List candidates by user task, such as making a purchase, approving a request or processing an invoice. Add the rules whose failure would block work or cause harm.

For impact, identify who would be affected and what would need fixing. Distinguish inconvenience during search from an incorrect price, exposure of another person’s record or irreversible data deletion. For likelihood, consider code changes, new integrations, previous incidents and the complexity of the rule. Frequent use can increase the number of people affected, but does not by itself express the likelihood of a defect.

ISTQB CTFL 4.0.1, section 5.2, describes this distinction between impact and likelihood. If you do not have reliable figures, use a qualitative comparison with reasons. A universal points total could obscure the difference between a minor defect and damaged data.

Separate feature usage from repeated checking

Record two frequencies. The first describes how often customers use the feature. The second describes how often you need to check it after a change or before a release. An annual accounting export is used rarely, but a change to calculations may require repeated verification.

For manual effort, include account setup, data, roles and subsequent verification of the result. If a tester repeats the same unambiguous check across many changes, automation can free time for other questions. Compare that saving with test development and maintenance effort, rather than just the number of clicks.

Rare restoration from a backup or rejection of unauthorised bulk deletion can have a high impact. These cases can take priority even without a large saving in manual work. If you cannot safely automate them immediately, plan the necessary environment and establish a manual check in the meantime.

Check whether you know the correct result

“Ordering works” is too broad an expectation. For a particular case, define the items, price, delivery, owner and resulting order state. An agreed business rule or acceptance criterion can provide the basis. The test uses it to decide whether the result meets the requirement. In testing, a source of the expected result is called a test oracle.

If it is unclear whether two discounts can be combined, clarify that with the product owner first. Automating today’s behaviour without checking it could preserve an existing defect. Record disagreements about the result too. They need clarification of the rule, rather than immediate implementation as an automated test.

A successful status or an open page does not establish that the order is correct. Check an outcome that matters to the user. For an asynchronous operation, define an observable final state and an acceptable waiting time. The Playwright assertions documentation shows how a test explicitly checks an expectation.

An illustrative order for an online shop and internal system

The following table is a proposed example. It assumes agreed rules unless the row identifies a missing condition. Adapt the decisions to your own incidents, environment and users.

Candidate Group Reason and condition
Purchase with order creation and correct confirmation First wave A failure blocks sales, and the account and product can be prepared repeatedly
A customer’s attempt to read another customer’s order First wave Data exposure has a high impact, and the expected rejection is clear
Repeating a request that previously created a duplicate invoice First wave Covers a known defect, with an agreed repetition rule giving a clear result
Annual export after calculation changes First wave Rare usage does not reduce the impact of incorrect accounting data
Refunding a payment in an unstable external test environment Prepare conditions Important process, but controlled data and reliable result verification are missing
Bulk record deletion with unclear permissions Prepare conditions Agree permissions first and provide safe, isolated data
Assessing whether a new form is understandable Manual Requires human judgement and observation of the user

“Prepare conditions” does not mean low priority. For risky deletion, preparing a safe environment may take precedence over writing more simple tests. For each such candidate, record the obstacle, responsible person and check that will confirm its removal.

How to choose between similar candidates

When scenarios have similar risk, compare what each adds to existing coverage. Another variation of a well-tested purchase may add less than the first invoice permissions check. Consider the next product change too. Before approval rules change, the relevant check may take priority over a process whose rules remain unchanged.

When likelihood is unknown, record the uncertainty and how you will investigate it. The absence of reported incidents does not establish low risk if nobody has checked the feature thoroughly. Reviewing changes, talking to support or targeted manual testing may help. Do not replace uncertainty with an exact figure without evidence.

Separate the order in which you create tests from the order in which you run them. An important check may require data prepared by a lower-risk step. That dependency affects implementation, rather than the business importance of the check. Agree who accepts temporarily uncovered risk too. Responsibility for that decision should not be hidden in the tester’s task order.

Include setup, diagnosis and maintenance

Review the candidate’s whole test lifecycle. How will you create the account, add data, set the role and restore the environment to a usable state? Will parallel tests change the same record? What happens when a business rule or interface changes?

Consider failure as well. If the report only announces a timeout without the input or last observed state, somebody will need to investigate further manually. The test should help distinguish a product defect from an unavailable service or incorrect data setup. Keep sensitive data and authentication tokens out of diagnostic output.

Distinguish changing requirements from unstable prerequisites. A rule change means updating the expectation. A missing product, shared account or unpredictable service response means resolving setup and isolation. Playwright recommends independent tests and controlled data. Our article on preparing a website for automation covers the technical prerequisites.

Include errors, rejections and lessons from incidents

Add negative scenarios to the successful journey according to risk. An order with an invalid quantity should be rejected, and a user without permission must not approve an invoice. Check that rejection has not created an unwanted record. A red message alone does not establish that the server saved nothing.

After an incident, document the input and conditions that caused the defect. Confirmation testing shows that the specific problem no longer occurs in that case. Subsequent regression checks should reveal adverse effects of further changes. Alongside the original case, consider neighbouring combinations affected by the same rule.

An incident can increase priority even for a rarely used feature. Avoid automatically adding an entire lengthy user journey if a smaller test can trigger the defect precisely. Retain the conditions that were necessary for the failure.

Choose a layer that keeps the defect visible

A pure calculation can often be checked with a unit test of a small piece of code. Server permissions or saving an order can be checked through the API, by calling the server directly. That can still involve a database and several services. Calling something an API test therefore does not determine its isolation or speed.

The user interface, or UI, needs its own checks of correct data submission and result display. An isolated form test with prepared responses differs from an end-to-end journey through the connected system. Ham Vocke explains this distinction. Our article on dividing API and UI tests discusses the practical decisions.

What to leave to people, and when to change the order

In exploratory testing, also look for problems that prepared scenarios do not cover. With a new form, a tester can try an unusual sequence of steps and assess clarity. Automated visual comparison or checking specific text does not replace that judgement. Assess a one-off feature according to both cost and impact, rather than its short lifespan alone.

Revisit the order when payments, permissions or an integration change, or after a serious defect. Track which risks have a working check, which await preparation and which you verify manually. Few findings are not, by themselves, a reason to remove a test. It may protect a stable but important rule.

Start with a list of user processes and the consequences of their failure. Assign each a reason for its position, readiness and next step. This gives you a coverage plan you can justify without chasing a test count. Our article on starting web test automation covers implementation of the selected first wave.

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.