E2E tests in CI without slowing every merge
Run E2E tests in CI as two sets. A few journeys block the merge, the full suite reports after it. How to choose the blocking set and keep it quick.
The way to run E2E tests in CI without slowing every merge is to stop treating them as one suite. Make two sets. A small one blocks the merge: a handful of journeys, good input only, a few minutes. The full one runs after the merge and reports, without holding anyone up.
Put everything in the blocking set and you can guess where it ends. The suite takes long enough to leave your desk for, an unrelated test fails now and then, people learn to press “re-run” without reading, and the check that was meant to protect the main branch protects nothing.

E2E tests in CI: what belongs in the blocking set
One question sorts it: if this broke in production, would we roll back?
If yes, it blocks. For a small app that is a short list:
- A new person can sign up and reach the app.
- An existing one can log in.
- The main thing the app is for works, start to finish, with a result you can see.
- The walk to the payment step reaches the right plan.
- A kind of user who must not open the admin pages can’t.
Each as one journey with good input. Not the empty form, not the too-long name, not the fourteen filters. Those matter, and they belong in the other set. We ranked journeys this way in risk-based testing: by what a break costs.
Then one more rule, the easiest to skip: only trusted tests may block. A test that fails for no reason once a week is not allowed above the line, however important its journey is. Fix it or move it below until it is fixed. A blocking check that people re-run on reflex has stopped being a check. We wrote about why retrying until green hides real bugs in the post on flaky tests.
What goes after the merge
Everything else:
- The edge cases of every form: empty, wrong format, wrong then right, limits.
- Journeys that wait on slow work in your app (an export, a generated report).
- Page checks and link checks over the whole app.
- Every other kind of user’s view of every page.
- Other browsers and widths.
This set runs on the main branch after each merge, or after the deploy, and on a schedule. When something in it fails, the author hears about it and fixes forward. It costs a follow-up commit. Running it before every merge would cost everyone’s time on every merge, which is a worse trade for failures you can fix forward.
Some teams feel uneasy letting anything merge before the full suite has passed. It helps to remember what the full suite ran against yesterday: the same code minus one small change. And the blocking set already answered the question that matters before a merge, which is whether the change broke something you would roll back for.
Speed up CI tests without deleting them
The blocking set should fit a budget you choose, and stay there. A few things make the difference:
Measure, don’t guess. Record how long each test takes over its last several runs and sort by it. The slow ones are not always the ones you expect. A test’s place in a set should follow its measured time: if a blocking test grows past the budget, that is a signal to split it or move it.
Sign in once. Logging in through the form at the start of every test is the first waste to cut. Sign in once per kind of user, keep the session, and start each test from it. Keep one real login test, and let the rest reuse.
Run in parallel, with isolated data. Four tests at a time is four times faster only if they don’t share rows. Each test makes what it needs, with a name unique to the run, and removes it after.
Test the preview, don’t rebuild the app. If your host already built a preview of the pull request, run against that instead of starting the app inside the test job. We covered the set-up in E2E tests on preview deployments.
Wait for the thing, not for a number of seconds. A fixed five-second pause is too long when the app is fast and too short when CI is busy. Wait for the element, the address, the request.
E2E tests in GitHub Actions: the shape
The two sets are two jobs with different triggers. The first is marked as a required check in the branch rules. The second isn’t.
on:
pull_request:
push:
branches: [main]
jobs:
e2e-blocking: # required check: must pass before merge
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run test:e2e:blocking
# BASE_URL: the preview's address, from your host
e2e-full: # after the merge: reports, never blocks
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run test:e2e
How you tag the blocking tests depends on your runner: a tag in the test’s name, a folder, a list. The mechanism matters less than having one list, in the repository, that a person can read and argue about in a pull request.
What should fail the check

A broken journey: yes. That is the point.
A test that couldn’t run because the runner’s browser crashed, the network dropped or the preview never came up: no. Report it as what it is, a problem with the testing, and run it again. If “the test machine had a bad day” turns the merge red, people stop believing red. This needs your results to have more than two states. Pass and fail aren’t enough when a third thing can happen.
How EveryRole fits in a pipeline
EveryRole’s tests can run inside your own pipeline, on GitLab CI or GitHub Actions, in the job’s own browser. The job fails when a test is Broken and puts the results in the merge request’s test report or a comment on the pull request. Broken is the only test result that fails it. A test that couldn’t check is a problem on the testing side and doesn’t, with one exception: when nothing at all could be checked, the job fails with its own message, “EveryRole could not check anything”, so nobody reads it as a bug in your app. The set-up is in the docs on running in your own CI.
The split in this post is also how its runs are built. For each kind of stop there are main cases, which run every time, and extra cases, which are off until you turn them on for the forms that matter. It measures how long each test takes over its last runs. After a deploy, the quick tests and the page checks run first as the check. The tests it has measured as long run right after, in the background, and never hold back the next deploy’s check.
What it doesn’t decide for you is which journeys are worth a rollback. That list is yours. Start it with five lines.


