The e2e mountain
utilizing my childs crayons: the e2e mountain

The e2e mountain

I sometimes think of e2e test automation as exploring a mountain. I usually start with the Happy Path (or Value Path). You need to ensure everyone has a safe trip to the peak. Having one test to cover the whole path from e.g. "new user discovers our product" to "we generate value for the user" is obviously very valuable. Doing manual exploration without automatic coverage of this path in your CI/CD pipelines is potentially very wasteful.

No alt text provided for this image

From there we can deviate from the Happy Path to test acceptance criterias or bug regressions. We can explore different routes unguided and automate where it makes sense.

No alt text provided for this image

Due to the recommendations of "a test should only test one thing" you find yourself treading the Happy Path very often, stacking up test execution time. Refactoring these steps is a challenge. If for example you have a registration process with 7 steps and doing some checks on step 4, you might repeat the step 1 to 4 multiple times or write interactions like "fromOneToFour". The first approach is very un-DRY, the second approach leads to exponential interaction objects or complex decision logic in your test code, both a problem for maintainability.

Balance these two approaches by introducing base camps from where you explore the mountain. Do not use the Happy Path to get to the camp but introduce shortcuts! For browser based tests, utilize the API to set up the intended state.

No alt text provided for this image

When your gherkin script mentions a "given registered user", create a quick way to set up the registered user, that's the interaction that gets you to the closest base camp from where you can continue further step by step.

TL;DR: The Happy path should be traveled at least once e2e as close as possible to the user. Further tests must use shortcuts to quickly get to a specific state. More DRY, less execution time.

I really liked mountain analogy. Thanks for sharing

I like that ... going to share

Hi Andreas, nice share, thanks. 👍 Could you perhaps clarify on what you meant by "feature coverage"? I guess I'm missing something which would explain why a feature wouldn't branch into a separate happy path.

Like
Reply

Well written and drawn. Easy way to introduce some QA concepts and strategies.

To view or add a comment, sign in

More articles by Andreas Worm

  • Worms AI Brawl

    is a game where people try to convince a LLM, that their worm is better in a fight, by typing messages in a chat. Every…

  • Readable Playwright Reports Using A Minimal Screenplay Approach - DRY Edition

    When it comes to refactoring playwright tests and providing readable reports, the process is often similar for me and…

    10 Comments
  • ATDD all the things

    Why would you test the frontend, if you are not confident that the backend is performing correctly? In this article we…

  • A Successful Test Says Nothing,

    at least in the beginning. Executed tests are experiments where the initial hypothesis is "this does not work".

Others also viewed

Explore content categories