Home / Projects / Playwright Compiler
Playwright · JavaScript and TypeScript

Write a Playwright test. Press Run. Watch it drive the browser.

A real page object, a real spec file and a real TypeScript file – running against one of our own applications in the pane beside your code. No install, no npx playwright install, no waiting for a browser to download.

What is real here, and what is not

  • Your JavaScript really runs. Your loops, your variables, your helper functions and your await behave exactly as they would under Node.
  • The TypeScript really compiles, with the official TypeScript compiler, in your browser.
  • The page object is a real file. Change a selector in it and the test that uses it changes with it.
  • The clicks are real clicks on the real page in the pane, and a click on a hidden element fails, as it would anywhere else.
  • There is no Node process, so no file system, no require() of real packages and no terminal.
  • No screenshots, video or trace. The pane beside your code is the view.
  • Only our own applications. A browser cannot read a page from another site, so page.goto('https://example.com') is refused with that reason rather than failing strangely.
  • One browser – the one you are sitting in. No cross-browser matrix.

Everything that transfers to a real job is in the first list: locators, auto-waiting, web-first assertions that retry, the test/describe/beforeEach shape, and failures that name the locator. Those are the parts people get wrong, and they are wrong here in the same way.

Framework

Ready
the browser pane
Try these

Six things to change, in order

Each one breaks something on purpose. Reading the failure is the skill.

  1. Break a locatorIn CatalogPage.js, change #search-input to #search-inpt and run. Read which locator the failure names – that is why page objects are worth having.
  2. Assert the wrong thingChange the expected cart count to '9999'. The assertion retries for four seconds before it gives up, then tells you what it found instead.
  3. Remove the waitDelete the await expect(...).toBeVisible() before the first click. It still passes – Playwright waits for you. Now you know what auto-waiting is doing.
  4. Add a second testWrite another test(...) in the spec file. Both run, and beforeEach runs before each one.
  5. Use a different locator strategySwap a CSS selector for page.getByRole('button', { name: 'Add to cart' }). Our applications carry data-testid on every control, so getByTestId works too.
  6. Type something wrong in the .ts fileGive a variable the wrong type and run. The TypeScript compiler reports it before a single click happens.
Next

Take it off this page

Selenium Java compiler

The same pane, the same application, driven by Selenium Java instead.

A real Playwright project

The framework ZIP, with the folder structure, config and reporting a real repository needs.

Something bigger to automate

Nine practice applications and a demo site, free, with stable ids on every control.