Modern development results in complex systems. It is no longer enough to prove that the code works, but that entire systems integrate well together, and work to specification. Teams need to deliver those systems every sprint, and make sure that what worked before – still works now. Developer testing to the rescue.

Developer testing is the cornerstone for iterative and agile development. Code tested by the developers who wrote it, allows for smooth development process, on the road to working systems in production. It also frees time from testers who can focus on system-wide and exploratory tests.

This workshop is intended to teach web developers the skills to test their code well, prove it works, and prepare for changes in the future. It covers topics from unit testing to component, API, and UI testing, and covers practical best practices suited for modern code. The power of combining different tests allow for quicker feedback and higher quality at a lower cost.

The workshop is in JavaScript/TypeScript. It covers React.js and node.js testing tools and frameworks. Depending on the needs, we can focus on the tools used currently by the client.

Workshop total length: 5 days

Remote and on-site options.

Workshop goals

Following the workshop, attendees will be able to:

  • Describe how automated testing fits into iterative project development.
  • Plan and design the right tests according to team and product needs.
  • Design code and systems to be testable and easy to change.
  • Write and debug unit, API, component and UI tests for web test automation.
  • Use tooling for mocking, assertions and execution for inclusion in tests
  • Deploy tests in Continuous Integration systems
  • Handle fragile testing issues

Workshop agenda

  • Introduction to automated testing (1 day)
    • Testing theory
    • Types and usefulness of tests
    • Test planning and design
    • Types of test frameworks and capabilities
    • Testing basics and test framework features (using Jest)
    • Data-driven and snapshot tests
  • API tests (1 day)
    • Introduction to API testing
    • The components of API requests and responses
    • Testing APIs (using Jest and Supertest)
    • Headers, content and parameters
    • Matchers for responses and JSON and XML
    • Authorization aspects in testing
    • Testing complex API scenarios
    • Aspects and considerations of API integration tests
  • Component tests (1 day)
    • The place of DOM component tests in testing
    • Testing React components (using React Testing Library)
    • Using the Jest-DOM assertions
    • Using User Event library to invoked events
    • Testing event invocation (with Jest)
    • Mocking at function and API levels (using Jest and WireMock)
    • Handling async code scenarios
    • Running in Continuous integration
  • Web UI Testing (1 day)
    • Introduction to web testing
    • Writing and running tests (using Playwright)
    • Navigation and locators
    • Debugging and UI mode
    • Playwright Inspector and CodeGen
    • Organizing test workflows
    • Handling async operations and timeouts
  • Testability and TDD (1 day)
    • Testability principles and patterns
    • Clean architecture principles and testability
    • Code smells and their impact on testability
    • Refactoring for testability with snapshots (using Jest)
    • Test reviews
    • Introduction to Test-Driven Development
    • Using TDD to design components
    • Using abstractions for maintainability

 Prerequisites

  • JavaScript, node.js, react.js and TypeScript knowledge with proper tools (e.g. VS Code, npm)
  • continuous integration topics and tools (e.g. Git, Jenkins, TFS)
  • Attendees should have their own laptops ready (including IDE and Node tools) and download the exercises beforehand.

For more questions:

Contact Us!