Frontend Testing with React, Jest, React Testing Library and Playwright
π Proposal
- β° 5 days of online course, 4 hours per day (morning or afternoon)
- πΌ 1 Office work (8 hours of office work)
- π¨βπ» Team
- 6-10 people
- Mid/senior
- πΆ Price
- To define.
- Discount by Fundae (only Spain) β https://www.fundae.es/
π€ Requirements
- β¨οΈ Node +14
- π Typescript
- π git
ππΌ The work modality will be with https://www.codescouts.academy/blog/mob-programming/
π‘Optional: Each class will be recorded and uploaded to the Codescouts Campus automatically at the end of each session (private workspace for you) So students can review the classes, or see them if they have not been able to attend β [https: //campus.codescouts.academy/] (https://campus.codescouts.academy/)
π Agenda
1οΈβ£ Day 1 - Logic or component test π€
- π€ Presentation β β²οΈ10min
- π€² Enter the Explanation course agenda β β²οΈ10min
- π Theory β β²οΈ30min
- π€ What do we look for with the Testing Frontend?
- π¦Ώ Types of tests, review of the testing pyramid.
- π Jest Methods
- π‘ All our problems are in design
- π Exercise 1 - Disruptive test β²οΈ90min
- Our domain is right.
- What else does if the component is visible or not
- π₯ Break β β²οΈ10min
- β½οΈ Exercise 2 - A good test β²οΈ90min
- Good practices for your component to be easy to test.
- Tests and rigid design, to refactorize β¦
- π€ Reflection β β²οΈ10min
- Does it cost a lot of effort to test?
- Design/architecture problems?
- When the equipment has trouble testing their applications, 2 things can occur.
- The team does not know how to do automated tests π€¦
- Project architecture has serious problems ποΈ
- When the equipment has trouble testing their applications, 2 things can occur.
2οΈβ£ Day 2 - Component tests, testing everything?π
- π€ Doubts of yesterday β β²οΈ5min
- π Theory β β²οΈ30min
- How we define the scope of a test
- Good practices in component tests
- π Exercise 1 - Behavior test β²οΈ90min
- When using mock, spy, stub
- Recommendations when using React Testing Library
- π₯ Break β β²οΈ10min
- β½οΈ Exercise 2 - Visulization test β²οΈ90min
- Good practices when designing a testable border component
- When to use and when not Snapshots
- π€ Reflection β β²οΈ10min
- You prefer to test behavior or visualization, is one consequence of the other?
- Snapshots or
toHaveBeenCalledTimes
3οΈβ£ Day 3 - Designing for Tests π
- π€ Doubts of yesterday β β²οΈ5min
- π Theory β β²οΈ30min
- π‘ Relationship between the architecture of our project and the tests that we do
- Rigidity of the design, stiffness of the tests
- Design stiffness, more expensive tests
- Injecting units, simplifying tests
- π‘ Relationship between the architecture of our project and the tests that we do
- π― Exercise 1 - Refactorizing components to test them β β²οΈ90min
- Component refactorization techniques to be able to test
- Atomizing components
- π₯ Break β β²οΈ10min
- β³οΈ Exercise 2 - Tests contributing VS VS Lost time β β²οΈ90min
- Creating tests that provide value
- Security network tests
- Reliability
- π€ Reflection β β²οΈ10min
- What type of tests are those that provide value?
- How can we do more reliable tests?
4οΈβ£ Day 4 - Testing to design π
- π€ Doubts of yesterday β β²οΈ5min
- 𧩠What is Development Test-Driven?β β²οΈ30min
- Itβs not test!It is design.
- π³ Exercise 1 - How to think about your components with TDD β β²οΈ90min
- Reviewing the bases
- Recommendations
- Mnemonic tricks
- π₯ Break β β²οΈ10min
- πΎ Exercise 2 - TDD applied to our domain β β²οΈ90min
- π€ Reflection - Advantages and Disadvantages of TDD in Frond β β²οΈ10min
- Why donβt I recommend TDD for components.
- They do not contribute so much value vs. the effort it implies.
- Why donβt I recommend TDD for components.
5οΈβ£ Day 5 - E2E & Clean Architecture
- π€ Doubts of yesterday β β²οΈ5min-E2e Tests
- π What are we looking for with an E2E test? β β²οΈ30min
- Review of E2E frameworks, pros and cons.
- Gherkin in E2E
- Could our product owner create them?
- π₯οΈ Exercise 1 - Testing as a user.β β²οΈ60min
- E2E test with playwright.
- π What are we looking for with an E2E test? β β²οΈ30min
- π₯ Break β β²οΈ10min
- π€ Why Clean Architecture and what is the relationship with the tests? β β²οΈ25min
- ποΈ Exercise 2 - Testing components with Clean Architecture β β²οΈ90min
- TDD with Clean Architecture
- Testing domain behaviors
- Delimiting the scope of the test to the domain services.
- Injecting units easily
- π Feedback β β²οΈ10min
πͺ Consulting Day (8 hours of work together)
This day is to work hand in hand with the team, the main objective is to land the concepts and practices learned in the course in the current project, also review the following points next to the team.
- π€ Current Architecture Consulting
- π Pain Points review
- π€ Recommendations
- πΈοΈ Refactorization
- π¦Ύ Improvement margin
- 𧩠Review of potential modules a prioritize the test
- π΅οΈ Code base and improvement suggestions
- π£ Rigid design, separation of clear responsibilities?
π₯ Coach
DamiΓ‘n Pumar
Technical coach / Software craftsman / Speaker
πΒ https://damianpumar.com/
π¦Β https://twitter.com/damianpumar
π€Latest speaker conference π https://www.damianpumar.com/events/
Something wrong? Let me know π
← Back to courses