Don't Ship After One Local Click: End-to-End Testing for Vibe Projects
Unit tests pass and the product still breaks on launch day — because nobody walked the whole path. This guide picks the five critical paths worth automating, with a Playwright skeleton, flakiness fixes, CI setup, and a 12-item pre-release checklist.

Chao built a to-do app called TideList — the sample product and people in this article are fictional, and all figures are illustrative examples or the recommendations of this guide, not measured data. On launch day, he clicked through everything on his own laptop: sign-up worked, creating a to-do worked, payment went through to the payment provider. All fine. Three hours later, users were posting screenshots in the group chat: after signing up and clicking "Create your first to-do", the button spun forever and nothing happened; another user said they had paid, but the page stayed on "Waiting for payment result" until they refreshed and it finally showed the paid plan.
Chao could not reproduce any of it locally. His laptop had a cache, a logged-in session, and data from earlier runs, so of course everything worked there. The bugs only showed up in a clean environment: a new user, an empty account, walking the whole path for the first time. All his unit tests were green, and they still did not catch these bugs — unit tests check whether one function is correct; end-to-end tests check whether a whole path works. And that path is exactly where vibe-coded projects most often break: the AI writes sign-up, data creation, payment, and invitations all at once, each piece looks fine on its own, and only walking through them together reveals where the chain snaps.

1. What end-to-end testing actually tests
End-to-end testing means this: open a clean browser, act like a real user, and walk a path from start to finish, asserting at each step that what should appear does appear. Sign up, log in, create a record, pay once, invite someone — strung together, that is the product as the user sees it. A click handler passing its test does not mean the page navigates to the right place after the click; an API returning 200 does not mean the frontend actually renders the result.
Get the division of labour straight first. Unit tests cover functions and components: fast, numerous, the first line of defence. Integration tests cover how modules connect — the frontend calling the backend, the backend writing to the database. Visual regression covers whether the page looks right, which already has its own dedicated guide on this site; load testing covers whether the app holds up under many users, which has its own guide too. This guide covers one thing only: whether the critical paths work in a real browser, from start to finish. Blur the lines and you test in the wrong place: using end-to-end tests to check every boundary of form validation is wasteful; using unit tests to prove "a user can pay" tests nothing at all.
For a solo developer, the value of end-to-end tests is not a pretty coverage number. It is having someone walk the most valuable paths for you before every release. You are one person, with no QA team and no time to automate every corner of the site. So do it the other way round: test only the most valuable paths, until you can run them before every release and click "deploy" with confidence when they pass.
But be clear about three things it cannot do, so expectations land in the right place. First, it cannot catch wrong logic: a miscalculated price, a wrongly stacked discount, a wrongly deducted balance — those belong to unit and integration tests, not to end-to-end runs. Second, it is slow: tens of seconds per path, minutes for the whole suite, so it is not for running repeatedly while you write code — unit tests do that job, end-to-end tests run before release. Third, it cannot prove "the page looks good": a crooked layout, a wrong colour, a broken mobile view need eyes and visual regression; end-to-end tests only check whether elements are there and clickable. One tool, one job — done well, it earns its keep; ask it to do everything and it does nothing well.
2. Which five paths first: the critical-path list
Do not start with whatever is easiest to write, like logging in. Start with whatever hurts most when it breaks. For a to-do app, only five paths hurt that much, and this guide's sample flows are written in this order: first, sign up and activate — open the home page, fill in email and password, sign up, activate from the email, land on the empty home screen: 6 steps, 5 assertions. Second, create your first to-do — create, type a title, save, see it in the list, still see it after a refresh: 5 steps, 4 assertions. Third, upgrade to the paid plan — click upgrade, pick a plan, go through payment, return to the app, see the paid badge: 7 steps, 6 assertions. Fourth, reset the password — click forgot password, receive the email, follow the link, set a new password, log in with it: 5 steps, 4 assertions. Fifth, invite a teammate — send the invite, have them accept, see the shared list, edit a to-do together: 6 steps, 5 assertions.
These five share one trait: each crosses at least two parts of the system. Sign-up crosses the frontend, email, and the database; payment crosses the frontend, the payment provider, and order state; invitations cross two accounts. The crossings are where AI-generated code breaks most often: the frontend assumes the backend returns one field, the backend assumes the frontend does not need another, each side written in isolation, unit tests all green, and the whole thing snaps when joined. Tests that only cover one part cannot catch that kind of break.
Do not get greedy beyond the five. Settings, avatars, nicknames, data export — if those break, users complain and move on; they are not worth automating in the first batch. Once the five are green and running smoothly, add paths in the order users complained about them last week. A rough test for whether a path deserves automation: imagine it breaks tonight — would you get out of bed to fix it? If yes, write it. If no, leave it for later.

3. A minimal skeleton: from zero to your first passing test
Pick Playwright, for one reason: a single tool drives Chromium, Firefox, and WebKit, with recording, screenshots, traces, and video all built in — no pile of plugins to assemble. On day one, do only four things: install it, run the official example, turn your first path into a test, and make it go green on the command line. Keep the skeleton small enough to read at a glance:
import { test, expect } from '@playwright/test';
test('sign up and activate', async ({ page }) => {
await page.goto('https://example.com/signup');
await page.getByLabel('Email').fill('test-user@example.com');
await page.getByLabel('Password').fill('Test123456');
await page.getByRole('button', { name: 'Sign up' }).click();
await expect(page.getByText('Check your email to activate')).toBeVisible();
});
Note three habits in this example — they are what keep you out of trouble later. First, find elements with getByLabel and getByRole, never with CSS class names or DOM nesting — class names belong to styling and change at any time; roles and labels are semantics, and changing them takes deliberation. Second, after each action, assert only what a user can see: the copy appeared, the button is clickable, a new row showed up in the list. Do not assert what the API returned or what the database wrote — that is integration testing's job; end-to-end tests only trust the screen. Third, one test walks one path. Never sign up, pay, and invite inside a single test: when one step in the middle breaks, the error message becomes unreadable.
Once the first test is green, write the second by copying the skeleton and changing the actions and assertions. When all five are green, keep the whole suite under 10 minutes and each test under 90 seconds. Over that, and the test is stuffing in too many steps or waiting too often — split it. The 10-minute cap is a hard limit: past it, you will stop running the suite before every release, and a test suite you do not run before release is the same as having none.
4. Locators and waiting: the two roots of flaky tests
The most common way end-to-end tests die is not that they cannot be written, but that once written they go green and red at random and nobody trusts them. There are basically two roots: locators too fragile, waiting too crude. A fragile locator grabs something that can change at any time: nth-child(3), .css-1a2b3c, the third span inside a div. The frontend changes its styling once, the test has to change with it, and after the third round of that nobody wants to maintain it. The fix is a priority order for locators: getByRole first, then getByLabel, then getByText, and test-id only last. Test-id is an escape hatch for elements with no semantic hook, not the default — a suite full of test-ids reads like gibberish.
Crude waiting means fixed sleeps everywhere: wait 3 seconds, wait 5 seconds, then assert. When the network is fast you waste time; when it is slow you fail anyway. The right approach is to let the assertion wait for you: expect(locator).toBeVisible() keeps waiting until the element appears or times out — no sleep needed before it. The only place a fixed wait belongs is when what you are waiting for is not on the page at all — an email arriving, a scheduled job finishing — and even then, write an explicit cap and polling interval, not a bare 30-second sleep. And one iron rule: retries run once, in CI only, never locally. A test that passes locally on retry is lying to you; one retry in CI is room for genuine network jitter, and anything beyond that is hiding a problem.
One concrete example makes it obvious. The flaky way: after clicking "Create to-do", sleep 3 seconds, then assert the list gained a row — on a slow network 3 seconds is not enough and the assertion fails; on a fast network 3 seconds are wasted and the suite keeps getting longer. The stable way: click, then directly assert that "the row containing the title you just typed is visible" — the assertion waits internally until it appears, up to 5 seconds, and moves on the moment it shows up. It also fails better: the error tells you which step never arrived, not just "list count is wrong", so you locate the cause much faster. The same logic applies to locators: getByRole('button', { name: 'Create to-do' }) does not care whether the designer turned the button from blue to orange or rounded to square; .btn-primary:nth-child(2) breaks on every restyle. A simple test for locator stability: if the designer changes the styling once, should your test change too? If yes, the locator is attached to the wrong thing.
5. Test data and environments: stop tests tripping over each other
End-to-end tests interfere with each other most often through data: two tests register the same email at the same time and the second fails; one test deletes a shared list and the next one cannot find it. The fix is that each test creates its own data and cleans up after itself. Build emails from a timestamp, like test-1730000000@example.com, so every run is fresh; afterwards, delete the test data through an API call or a cleanup step, and do not leave it in the database. Never share one "test account" across the whole suite — the moment that account's state changes, the entire suite goes red and you have no idea where to start looking.
Seed data is another foundation people overlook. Keep at least one fixed set in the test environment: an already-activated account, a list that already exists, an account that is already on the paid plan. Many tests do not need to start from sign-up; they can log in as the seed user and start in the middle. Write seed data as code, rebuildable with one script — rebuild it whenever the environment gets messy, instead of clicking it together by hand in the UI. And keep seed data visibly separate from data the tests create: name the seed account seed-user and the freshly created ones test-plus-a-timestamp. Mix them up, and one careless cleanup deletes the seed, the whole suite goes red the next day, and you think the product broke.
Environments must be separate too: tests run against a dedicated test environment, never directly against production. Test data can be created and deleted freely; production data cannot. The test environment should follow the exact same deployment process as production — the same code, the same migrations, the same environment variables, only a different database and different third-party keys. A project that passes in test but deploys to production by a separate manual process has proven nothing about production. For third parties like payment, use the sandbox or a mock in the test environment — never charge real money; but keep at least one manual real payment before release. The sandbox tests the flow; a real payment tests the money itself. The two cannot stand in for each other.
6. Into CI: make failures explain themselves
A test that is written but not in CI might as well be written on paper. The setup is: every pull request runs all five paths automatically; all green to merge, any red blocks the merge. Once it runs, what matters most is not "is it green" but "when it is red, can I understand why within 5 minutes". So keep the full evidence of a failure: a screenshot of the failing step, console errors, failed network requests — Playwright's trace is even better, opening it replays frame by frame what happened. Keep evidence only for failures: passing tests leave no video and no screenshots, or CI storage and time get eaten alive.
Reading a failure report also has an order — do not start from the last line. Look at the first red test first, then at which step it failed on, and only then at the screenshots and trace. When four of five tests are red, it is usually not four bugs but one: sign-up broke, and the four that depend on logging in broke with it. Fix the first one, rerun, and the rest may turn green on their own. Scrolling through screenshots one by one burns half an hour. Another habit that pays off: every time you fix a real bug, write how it was found into the test — if payment succeeded but the page never refreshed, add an assertion that "the paid badge is visible after payment succeeds". That is how a suite grows, one bug at a time, not in a single day.
One more easily missed point: the browser environment in CI must match your local one. Tests pass locally and fail in CI, and nine times out of ten the environment is missing something: a browser dependency not installed, different fonts, a different time zone. The fix is to use Playwright's official Docker image or the official GitHub Action configuration instead of assembling your own. Matching environments cut flakiness in half. Finally, treat run time as a metric too: a suite creeping from 10 minutes to 25 means someone is stuffing steps into tests and it is time to split them; a sudden drop from 10 minutes to 2 means half the suite got skipped and it is time to investigate.
7. The 30-minutes-a-week maintenance bill
End-to-end tests are not a write-once thing: the moment a page changes, the tests have to change with it. Count that maintenance bill before deciding how much to write. Set aside 30 minutes a week for exactly three jobs: first, fix the tests that went red this week — check first whether the product really broke or the test went stale. If the product broke, fix the product; if the test went stale, fix the test, and do not weaken an assertion just to make it green. Second, delete tests that are no longer useful: when a feature is removed, its tests go with it, or they just add one more false alarm every day. Third, add the path users complained about this week: if it already has automation, the assertions are not enough — add one; if it does not, queue it for the next batch.
Suites that become unmaintainable usually fail not by being too big but by being too detailed. Assertions like "the button is orange" or "the second row is 14-point type" go red on every redesign and cost more to fix than to write. Assert only what users care about: it appeared, it is clickable, the number is right, the money arrived. Leave styling to visual regression and numbers to unit tests; end-to-end tests only care whether the path works. The coarser the definition of "the path works", the longer the suite lives.
If one day 30 minutes a week is not nearly enough and red tests keep multiplying, do not just add more time — stop and count: how many reds are real product bugs, how many are locators attached to the wrong thing again, how many are over-long tests where one shaky step in the middle fails the whole thing. If most are the latter two, the skeleton needs rework: pull shared login and data setup into setup steps, split over-long tests into two short ones, rewrite locators by role. One rework beats ten rounds of patching. The worst outcome is being afraid to rework, letting the suite rot until nobody runs it and nobody trusts it — back to the day with no tests at all, when you used to have five paths that worked.
8. The 12-item pre-release checklist
Before you ship, run through these 12 items and tick them all before clicking deploy. First, all five critical paths are green in the test environment. Second, the whole suite takes no more than 10 minutes, no single test more than 90 seconds. Third, no test depends on a fixed wait longer than 5 seconds. Fourth, no two tests share the same test account. Fifth, test data is freshly created on every run and cleaned up afterwards. Sixth, payment runs in the sandbox, with one real payment walked through manually before release. Seventh, failures produce a screenshot and a trace, so the cause can be found within 5 minutes. Eighth, a CI failure blocks the merge instead of merely sending a notification. Ninth, retries run once in CI only, never locally. Tenth, the test environment and production share the same deployment process. Eleventh, features removed this week had their tests removed too. Twelfth, one person — you — spends 30 minutes a week maintaining the suite, written in the calendar, not done "when I remember".
One honest note to close: end-to-end tests cannot save a badly built product. All they guarantee is that the five most valuable paths work. With all five green, you can sleep the night you ship; when something outside the five breaks, users complain, and you fix it the next day. That is all they are for — and that is why they are worth 30 minutes a week.
Comments (0)
Related articles
On 18 November 2026, Google Research and co-authors posted BuggyMLE to arXiv: bugs injected into 222 working ML repositories, and 14 models slide from 95% on the easiest tier to 9% on the hardest. A 9-billion-parameter model trained easy-to-hard beats Claude Opus 5.5 on the 10-bug tier.
On 11 November 2026, AWS open-sourced UAEF: adapters turn traces from LangGraph, LangChain, Strands and Bedrock AgentCore into one format, then 36 metrics across 7 dimensions score them, flagging regressions past 5%. The judge model is hardened too — scores must cite verbatim evidence, and never decide safety.
localStorage only stores strings and has no indexes. IndexedDB is a real database in the browser: structured data, far larger capacity, indexes, and transactions. Following MDN's Using IndexedDB, IDBDatabase, and IDBObjectStore: the five-step routine, opening, upgrades, keys, indexes, transactions, add versus put, get, cursors, ranges, and multi-tab upgrades.