Speaker: Dominik Pieper - Topic Lead Frontend, Conciso GmbH Talk 2: Testing all the things - e2e testing patterns Speaker: Tobias Brenner - Principal Expert Application Development
Scaling ordinary code • Test code prone to refactoring • Selector bleeding • Slow test executions • Flaky tests • Setup test code vs. Actual test code • Too complex test code • It‘s too much work to write tests • Are you testing too much? <ul> </ul>
selectors • Don‘t bind it to your components dom structure • Instead: • Use test-id attributes • Use Naming conventions for them • Don‘t expose them • … later more about that
encapsulation • Create action files for each component • Write utility fns for state checks (expections) • Write utility fns for interaction (state change) • Keep the test code DRY • Use fns composition • Delegate work to other, existing action files • Create action file for each view • Create scenario files • Static test data • Mock HTTP Layer (Disclaimer)
Congrats: you‘ve created you own testing DSL Create action file per component Create action file per view Compose atomic actions to flows Create scenarios out of flows Use static test data