Source: https://everyrole.dev/blog/e2e-tests-in-ci

# 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.

Nov 22, 2026  6 min read  by the EveryRole team

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.

![A pipeline with two sets of E2E tests. Before the merge, a small blocking set runs on the preview: sign up, log in, the main thing, the walk to payment. After the merge, the full set runs and reports without blocking](https://everyrole.dev/s/blog/e2e-tests-in-ci/pipeline.webp)

The line in the middle is the merge. What sits above it has to be quick and trusted.

## 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](https://everyrole.dev/blog/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](https://everyrole.dev/blog/flaky-tests).

## What goes after the merge

Everything else:

- The [edge cases](https://everyrole.dev/blog/happy-path-vs-edge-cases) of every form: empty, wrong format, wrong then right, limits.
- Journeys that wait on slow work in your app ([an export](https://everyrole.dev/blog/test-file-download), 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](https://everyrole.dev/blog/slow-e2e-tests) 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](https://everyrole.dev/blog/test-data-cleanup).

**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](https://everyrole.dev/blog/e2e-tests-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

![Three results of a test in a pipeline. Passed keeps the check green. Broken turns it red and the merge waits. Couldn't check means the testing itself had a problem, and it is run again](https://everyrole.dev/s/blog/e2e-tests-in-ci/what-fails.webp)

Only an app that didn’t do what the test expects should stop a merge.

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](https://everyrole.dev/docs#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.

## Try it on your own app

EveryRole tests your app’s real user journeys for each kind of user, from the live site, and runs them after every deploy. Paste your app’s address to see what it finds.

[Start with your app](https://everyrole.dev/signup) [How it works](https://everyrole.dev/docs#start)

## Keep reading

Deploys and CI

### [Run E2E tests on every preview deployment](https://everyrole.dev/blog/e2e-tests-preview-deployments)

To run E2E tests on preview deployments, wait for the deploy, take its address and run your journeys there. Five traps, and what a preview can’t prove.

Nov 22, 2026  6 min read

Deploys and CI

### [Slow E2E tests? Split the journey at the wait](https://everyrole.dev/blog/slow-e2e-tests)

Slow E2E tests have three causes. Two are fixed inside the test. The third is your app’s own slow work, and the answer is to split the journey at the wait.

Nov 22, 2026  6 min read

Deploys and CI

### [How to test a vibe-coded app before users do](https://everyrole.dev/blog/test-vibe-coded-app)

How to test a vibe-coded app: from the outside, as each kind of user, on the running app. The agent says what changed, and something else has to prove it works.

Nov 22, 2026  7 min read
