Playwright is a Node.js library that lets you control a real browser (Chrome, Firefox, or Safari) programmatically. You write code that describes what a user would do — go to a page, click a button, fill in a form, check that something appeared — and Playwright executes it in a real browser automatically.
End-to-End (E2E) testing framework → set of tools or code libraries used to validate a software application's complete workflow from the perspective of an end user. It ensures that all integrated components—including front-end UIs, back-end APIs, databases, and third-party services—work together correctly to fulfill a real-world scenario
Browser Automation Tool → programmatically controls a web browser to replicate human actions like clicking, typing, and navigating. While often used for testing, these tools are also employed for tasks such as web scraping and repetitive data entry
E2E (“end-to-end”) tests pretend to be a real user: open a real browser, go to a real URL on your running app, click, type, and assert what appears on the screen. They don’t import your React components directly—they drive the whole app like Chrome.
Playwright is a library + test runner that:
page object (one tab),goto, click, fill, and expect visible text/roles.So: Playwright = automate the browser to verify the product works from the outside.
https://playwright.dev/docs/intro
install in project:
npm init playwright@latest
auto-generated config file:
// playwright.config.ts
import { defineConfig } from '@playwright/test'
export default defineConfig({
testDir: './tests', // where your test files live
use: {
baseURL: '<http://localhost:3000>', // or your Vercel preview URL
headless: true, // run without opening a visible browser window
},
})
run tests:
npx playwright test