Playwright by Microsoft β the most powerful E2E framework ever made. Auto-waits, 3 browsers, screenshots, trace viewer & API testing. All built-in. Zero drama.
import { test, expect } from '@playwright/test'; test('user logs in successfully', async ({ page }) => { // navigate β auto waits for page load await page.goto('https://app.example.com'); // fill β no explicit waits needed! await page.fill('#email', 'admin@co.com'); await page.fill('#password', 'secret!'); await page.click('[type="submit"]'); // web-first assertion β retries automatically await expect(page).toHaveURL('/dashboard'); });
Built by Microsoft's Puppeteer team. They knew every Selenium pain point and fixed them all. Playwright is what modern E2E testing looks like.
Selenium needs WebDriverManager, explicit waits everywhere, a test runner, an assertion library, a screenshot plugin and a reporting tool. That's 6 dependencies to do 1 job.
Playwright ships with everything built-in: auto-waiting, web-first assertions, screenshot/video on failure, code generation via playwright codegen, network interception and the iconic Trace Viewer. One install, everything included.
import { test, expect } from '@playwright/test'; test('search for products', async ({ page }) => { await page.goto('https://amazon.in'); // Semantic locator β survives CSS refactors await page.getByPlaceholder('Search Amazon').fill('laptop'); await page.keyboard.press('Enter'); // Smart assertion β auto-retries until true await expect(page.getByRole('heading')).toContainText('laptop'); await page.screenshot({ path: 'results.png', fullPage: true }); });
playwright codegen url.com and Playwright records your clicks as working test code in real time.Clean, async-first, intuitive. These are the Playwright API methods every SDET reaches for daily.
import { defineConfig, devices } from '@playwright/test'; export default defineConfig({ testDir: './tests', workers: process.env.CI ? 2 : undefined, retries: process.env.CI ? 2 : 0, use: { baseURL: 'https://staging.myapp.com', trace: 'on-first-retry', screenshot:'only-on-failure', video: 'retain-on-failure', }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] } }, { name: 'firefox', use: { ...devices['Desktop Firefox'] } }, { name: 'webkit', use: { ...devices['Desktop Safari'] } }, { name: 'mobile', use: { ...devices['iPhone 13'] } }, ], });
Pick a test scenario and watch Playwright execute it β real console output, auto-wait logs, traces, pass/fail β just like your local terminal.
One command installs everything β browsers included. No WebDriver, no version matching. It just works.
The exact patterns senior SDETs use to write Playwright suites that are reliable, fast and maintainable forever.