Journey that lead us into

Playwright

Who am I?

My name is Arun, and I work as a

Frontend Developer @ Assembly

Expectation

We wanted to deliver quality code, which doesn't break

We were sold on the idea, of adding Unit Test with good coverage

Expectation was to ship code with confidence

Follow TDD principles

Practising TDD with JEST & React Testing Library was harder

Unit tests were written with components in mind not with user

The unit tests were not helping us do refactoring confidently, as refactoring often broke the unit tests too, and refactoring code also means refactoring unit tests.

Reality

Acceptance

Test Driven Development

Drawing Board

Brainstroming 

What is Playwright

  • Open source, cross browser, automation framework
  • Developed and maintained by Microsoft
  • Close to 45K stars, 200 contributers & has 86 releases so far
  • It can be used with Javascript, Python, .NET and more

Why Playwright

  • Playwright is built for testing modern app, it has features like auto-waiting and web first assertions (So no flaky tests).
  • Playwright creates what we call browser context for each test, delivering full test isolation.
  • Comes with very good tooling support, like codegen for automated test generation, inspector to debug and step through tests

VS Code Extension

Locators

Ways to find element on page at any moment with auto-wait capability

Locator

Selector

Assertions

Playwright uses jest's assert library for assertions

How did we approach

Acceptance Test Driven Development

with Playwright?

Thank You

https://www.playwright.dev

https://www.github.com/microsoft/playwright

References

Let's connect @arunselvakumar

Learn more about Assembly

 

www.joinassembly.com/careers

Playwright

By Arun Selva Kumar

Playwright

  • 368