Playwright has become one of the main tools for testing web applications. In this packed 3-day intro, we’ll learn how we can use it to automate and test web UI.

In this 3-day hands-on workshop, we’ll introduce Playwright and use it for both API and Web testing in JavaScript / TypeScript. Attendees will practice the needed techniques to write, plan, design and write tests for websites and APIs.

We’ll see how to write, run and debug Playwright tests. We’ll go over locators and expectations, the building blocks of Playwright, and also talk about the async aspect of the operations. We’ll talk about refactoring the tests using the Page Object Model and Page Factory patterns, and also see how we can use it for API testing.

On top of that, we’ll discuss where Playwright fits into the testing work – what types of tests fit Playwright more, and when they can be replaced with simpler tests. We’ll also see how to run the tests in CI environment.

The exercises are in JavaScript / Typescript. Attendees will download the exercise from GitHub before the session start.

Workshop total length: 3 days

Remote and on-site options.

Audience

The workshop is intended for front-end, back-end, full-stack developers and team leaders.

Workshop goals

Following the workshop, attendees will be able to:

  • Describe the benefits of testing with Playwright
  • Install Playwright into a project
  • Create test plans and break down scenarios
  • Write web and API tests and use expectations correctly
  • Use locators effectively and deal with dynamic elements
  • Debug failing tests
  • Use fixtures for organizing common code
  • Run tests in CI systems
  • Refactor tests for maintainability

Workshop agenda

  • Testing theory
    • Web testing vs other types of tests
    • Test organization
  • Introducing Playwright
    • Pros and cons vs other frameworks
    • Installation and configuration
    • Browser drivers
    • The end of stale elements?
  • Writing Playwright tests
    • Assertion and matchers
    • Assertions best practices
    • Extending assertions
    • Browsers contexts and Pages
    • Locators and elements
    • Test recording and generation
    • Refactoring tests
    • Test planning & design
  • Test planning & design
    • Creating a test plan
    • Deciding how to test scenarios
    • Breaking down scenarios
  • Running the tests
    • Using the CLI
    • Headless mode
    • Handling flaky tests
    • Mocking API Requests
    • Parallel execution
  • Debugging techniques
    • Debugging the tests
    • Debugging the server
    • Playwright Inspector
    • Trace viewer
    • Taking screenshots
  • API testing
    • Setup and configuration
    • Using the Request fixture
    • Asserting responses
    • Using API calls within tests
  • Refactoring tests
    • Fixtures in tests
    • The Page Object Model pattern
    • The Page Factory pattern
  • Advanced interaction
    • Dynamic elements
    • Handling waiting and timeouts
    • File upload
    • Drag and drop
    • Alerts and dialogs 

 Prerequisites

  • Basic understanding of test automation
  • Continuous integration topics and tools (e.g. Git, Jenkins, TFS)
  • Attendees need a laptop with an IDE with toolset (e.g. VS Code, node, npm).

For more questions:

Contact Us!