Slide 1

Slide 1 text

AngularRuhr @ New Host Comline GmbH

Slide 2

Slide 2 text

Agenda Talk 1: Bessere Architekturen mit modernem Angular und Nx Speaker: Dominik Pieper - Topic Lead Frontend, Conciso GmbH Talk 2: Testing all the things - e2e testing patterns Speaker: Tobias Brenner - Principal Expert Application Development

Slide 3

Slide 3 text

Dominik Pieper Topic Lead Frontend / Solution Architect +49 160 99527824 [email protected] https://conciso.de Bessere Architekturen mit modernem Angular und Nx

Slide 4

Slide 4 text

4

Slide 5

Slide 5 text

Organisation in modules

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Standalone Components: • Components & modules in one • every component knows its dependencies

Slide 8

Slide 8 text

8 Standalone Components: Mental Model

Slide 9

Slide 9 text

9

Slide 10

Slide 10 text

10 Components – Structure with folders …

Slide 11

Slide 11 text

11 and barrels. Components – Structure with folders …

Slide 12

Slide 12 text

12 From clear structure …

Slide 13

Slide 13 text

13 … to this.

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

First takeaway: Nx brings back structure into your code.

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

All “booking” connections

Slide 27

Slide 27 text

27 Unified tooling

Slide 28

Slide 28 text

28 Unified & smart tooling

Slide 29

Slide 29 text

29 Better CI tooling

Slide 30

Slide 30 text

30 Testing just the affected …

Slide 31

Slide 31 text

31 … on automated basis.

Slide 32

Slide 32 text

Second takeaway: Nx is safer & easier than any other.

Slide 33

Slide 33 text

Wide compatibility …

Slide 34

Slide 34 text

… with some of special interest for me J

Slide 35

Slide 35 text

Third takeaway: Nx is adjustable to your special needs.

Slide 36

Slide 36 text

More structure. Safer & easier. Adjustable.

Slide 37

Slide 37 text

Thank you

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Testing all the things - e2e testing patterns Tobias Brenner E-Mail: [email protected] Handy: +49 175 4751 883 E.ON Digital Technology GmbH

Slide 40

Slide 40 text

What is the problem? • Scaling the test codebase > 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?

Slide 41

Slide 41 text

Green field work is easy

Slide 42

Slide 42 text

… How to prevent it from becoming that?

Slide 43

Slide 43 text

Design-Patterns to the rescue

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

Let it scale!

Slide 46

Slide 46 text

Easy stuff first - Selectors • Don‘t use complex dom 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

Slide 47

Slide 47 text

How to write test code which ages well • Strict 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)

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

Naming things properly helps Atomic Action Flow Scenario

Slide 50

Slide 50 text

FAQ • Do I need a specific testing library? • Mocking the HTTP in e2e tests, really? • Isn’t this too much effort?

Slide 51

Slide 51 text

Now it is time for code

Slide 52

Slide 52 text

How to write test code which ages well - recap 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

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

Tobias Brenner E-Mail: [email protected] Handy: +49 175 4751 883 E.ON Digital Technology GmbH

Slide 55

Slide 55 text

Feedback Bitte bewertet uns auf Meetup.com

Slide 56

Slide 56 text

No content