The e2e mountain
Andreas Worm
Specializing Generalist For Agile Product Development: Quality, Automation, Go, Java, React
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.
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.
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.
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.
Java | Spring Boot | 1× AWS | Selenium | Restassured | Cucumber | Agile | Bamboo | BitBucket | TestNG | QA Lead
4 年I really liked mountain analogy. Thanks for sharing
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
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.
Quality Engineering Manager chez Decathlon Outdoor
4 年Well written and drawn. Easy way to introduce some QA concepts and strategies.