Back to BlogQuality & Testing

Write Automated Tests for My Web App: How It Works

Rupak Amin

Founder & Lead Engineer, RAITHub

8 min read

RAITHub ships and tests production software. See QA as a Service or talk to us.

Having automated tests written for your web app means someone maps the journeys that cost most when they break, writes tests at the right layers (unit, API and end-to-end), wires them into CI so a failing change cannot deploy, and leaves the tests in your own repository. RAITHub does this as a monthly plan, an audit, or a managed team. The tool follows the job.

If you would rather have the tests written and kept green for you, see how RAITHub would do this near the end.

What gets tested, and at which layer?

Good test automation is layered: many fast, cheap tests low down, fewer slow, broad tests on top. That shape is the test pyramid, and it keeps a suite fast and stable (the test pyramid for a SaaS). What goes where:

LayerWhat it coversTypical tool
UnitPure logic: pricing, validation, permissions as functionsVitest or Jest
API / integrationEach endpoint: status, schema, rules, authorisation, errorsCode test runner, Postman, Pact
End-to-endReal user journeys in a browser: sign-up, checkout, the core workflowPlaywright or Cypress
PerformanceBehaviour under load: p95 latency, error rate at peakk6, Gatling, JMeter

Most of the protection comes from the lower layers, which run in milliseconds. A handful of end-to-end tests prove the whole thing holds together, but a suite that is all end-to-end tests is slow and flaky.

Which tool should write my tests?

The tool is a detail once the layers are right. These tool-specific services cover the common choices, all delivered the same way (tests in your repo, gated in CI):

Pick by what your team already knows and what your CI runs. A mixed suite is normal: unit tests in your app's language, API tests beside them, and Playwright or Cypress for the handful of full journeys.

How do tests become a CI gate?

A test that runs on someone's laptop before release protects nothing once they forget. The value is the gate: the suite runs on every pull request against a fresh database or preview environment, and the merge is blocked if anything fails. What that takes:

  • Each test creates its own data with unique IDs, so tests do not depend on each other's leftovers.
  • Test users are seeded, one per role, with tokens issued at the start of the run, not hard-coded secrets.
  • Third parties are stubbed at the boundary (payments, email, SMS) and tested separately in sandbox mode.
  • Flaky tests are quarantined, then fixed, rather than retried until green; fixing flaky tests explains the method.

Once that is in place, a regression that used to reach users fails the build instead.

Free checklist

AI-Built App Launch Readiness Checklist

25 checks before you let real users in. Enter your email and we’ll reveal it below (and send you a copy).

One email, the checklist, no spam. By submitting you agree we can email you this checklist and reply to your enquiry.

What do you receive from the engagement?

DeliverableWhat it is
Risk map and test planThe journeys ranked by cost of failure, and which layer and test covers each
The test suiteUnit, API and end-to-end tests in your repository, owned by you
CI gatesThe jobs that run the suite on every change and block a failing release
ReportsWhat was tested, caught and fixed, each run or weekly
MaintenanceTests kept current as the app changes, on a plan or a team

The common thread: tests you do not own, or that do not run automatically, stop protecting you the day the engagement ends. Everything here lives in your repository.

When do you need this, and when not?

You need automated tests when the app is live or near launch, ships often, and a broken release would cost money or trust. You need them most on the journeys that take payment or hold customer data. You may not need a full suite yet if the product is a throwaway prototype you reshape weekly, where tests churn faster than they protect; a short manual pass fits that stage. Doing it yourself is realistic if you know the stack: a first suite for 10 to 15 journeys takes a few days to a couple of weeks, and the main risk is testing only the happy path, where the expensive bugs are not.

Buy, build or hire?

OptionChoose this whenWatch out for
Write tests in-houseYour developers have time and the discipline to keep them greenUnder deadline, tests are the first thing dropped
A low-code test recorderYou want a few journeys covered fast with little codeRecorded tests break often and are hard to review in pull requests
FreelancerYou need a one-off suite and reportNo one maintains it as the app changes
A managed QA serviceYou want the suite built across layers, gated in CI and maintainedMake sure the tests live in your repository and you own them

Why RAITHub for writing automated tests?

Because RAITHub's test counts are measured in real repositories, and the engineers who write the tests also build and fix software. TheSkinProof, the founder's own venture, has 217 API endpoints and 750+ tests; Sundor Skin has 530+ tests across 88 permission codes and 12 roles; PropDesk has 1,024; this site runs 400+ in CI. How that discipline works is in QA-first development: how RAITHub tests. For the full managed offer, see QA and test automation and QA as a service.

When you don't need RAITHub: if you want engineers placed inside your team under your management, that is staff augmentation, which RAITHub does not offer; and a large manual regression across many devices suits a dedicated QA agency better.

How RAITHub would do this

Through QA and test automation, RAITHub would:

  • map your journeys and rank them by what they cost when they break
  • write unit, API and end-to-end tests at the right layers, with the tool your stack already uses
  • start with the money and data paths, then widen coverage from there
  • wire the suite into your CI so a failing change blocks the release, with tests in your repository
  • keep the tests current and report each week on what was caught

Buy it as a monthly QA plan, a fixed-price one-off audit, or a dedicated QA team that RAITHub manages and bills monthly. Testers are never placed under your management. You own the tests and the IP; an NDA is signed first. Start with a free 15-minute call, then a written fixed quote. Talk to RAITHub about automated tests.

Frequently asked questions

What does it mean to have automated tests written for my web app?

Someone maps your key journeys, writes tests at the right layers (unit, API and end-to-end), wires them into CI so a failing change cannot deploy, and leaves the tests in your repository, bought as a plan, an audit or a managed team instead of hiring a test engineer.

Which testing tool is right for my app?

The one your stack and team already use. Playwright or Cypress for browser journeys, a code runner or Postman for APIs, k6 or Gatling for load. The tool-specific service posts cover each; a mixed suite across layers is normal.

How many tests do I need?

Enough to cover the journeys that cost most when they break, starting with payment and data access. Count risks covered, not tests. A healthy suite is mostly fast unit and API tests, with a few end-to-end tests over the top.

Can you add tests to an app you did not build?

Yes. RAITHub starts with the journeys that matter most, writes characterisation tests that pin down current behaviour, and gates them in CI before widening coverage or changing any code.

Why do tests need to run in CI?

So they run automatically on every change, not only when someone remembers. A CI gate blocks a merge when a test fails, which turns a would-be production bug into a failed build you fix before it ships.

Will I own the tests if we stop working together?

Yes. The tests and CI configuration live in your repository, the IP is assigned to you, and the engagement runs month-to-month, so the suite keeps protecting you after it ends.

automated testingtest automationQA as a serviceCI testingend-to-end testingtest pyramid

Ready to discuss your project?

Book a free 15-minute technical audit with our engineering team.