/test-js

A repository containing training exercises for JS frameworks

Primary LanguageJavaScriptMIT LicenseMIT

Workshop: JS Functional Testing at Scale

There are thousands of ways if not more to set up your automated testing environment. When it comes to stability and maintainability it is crucial to choose the right frameworks at the beginning of the journey. The ecosystem provides a variety of different tools that all rely on certain protocols and come with different levels of support for different use cases.

While there are the traditional WebDriver based JavaScript frameworks like Selenium or WebdriverIO, many new projects have popped up in recent years that provide even more capabilities, particularly for front-end developers.

In this workshop we will take a look at the JavaScript framework landscape for automated functional testing, such as Puppeteer, Playright, Cypress, and others. We will explore what their differences are and how to choose the right tool for your project. Then, we will look at various scenarios, from basic functional test concepts to complex visual and frontend performance tests and complete the session with scaling up our solution using a cloud vendor like Sauce Labs.

Key Takeaways

  • Understand the principles of browser automation
  • Learn to pick the right JavaScript framework for your project
  • Master various of common automation scenarios including network stubbing, visual and automated performance testing using WebdriverIO

Prerequisites

  • Knowledge of JavaScript
  • Node 14 LTS installed
  • Your preferred IDE installed
  • Docker

Agenda

This workshop starts with a short introduction into the subject matter in form of a presentation. The following chapters contain little tasks that are build on top each other.

  1. Introduction to Browser Automation (15min)
  2. Setup (30min)
  3. Add Reporters (10min)
  4. Break (5min)
  5. Create Custom Reporters and Services (10min)
  6. Network Mocking (15min)
  7. CI/CD Integration (25min)
  8. Break (5min)
  9. Sauce Labs Integration (30min)
  10. Visual E2E Testing (30min)
  11. Page Objects (Extra)
  12. Performance (Extra)

Disclaimer

All code and command examples assume that you are using a MacBook. Usually they should also work on a PowerShell on Windows. For anyone who has problems running certain things with Windows please create an issue or provide a PR (see below).

Contributing

Any kind suggestion to this course is welcome. If you have an idea, suggestion or improvements please create an issue or even better create a pull request.