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.

Rajan Kumar

Java | Spring Boot | 1× AWS | Selenium | Restassured | Cucumber | Agile | Bamboo | BitBucket | TestNG | QA Lead

4 年

I really liked mountain analogy. Thanks for sharing

Simon Jones

SDET specializing in AI powered Quality Assurance, Agentic Testing ,Test Automation, AI Mutation Testing and Accessibility, seeking new opportunities

4 年

I like that ... going to share

Alan Martinovic

Head of Customer Engineering - Mender

4 年

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.

回复
Floran Devillez

Quality Engineering Manager chez Decathlon Outdoor

4 年

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

要查看或添加评论,请登录

Andreas Worm的更多文章

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

    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 条评论
  • ATDD all the things

    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,

    A Successful Test Says Nothing,

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

社区洞察

其他会员也浏览了