Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Playwright can do this?

Playwright can do this?

Learn why Microsoft's testing framework is a stellar solution to test your sites end-to-end.

stefan judis

March 30, 2023
Tweet

More Decks by stefan judis

Other Decks in Technology

Transcript

  1. More than a browser control / / @ts - check

    import { test, expect } from "@playwright/test"; test.describe("navigation", () = > { test.beforeEach(async ({ page }) = > { / / Go to the starting url before each test. await page.goto("https: / / playwright.dev/"); }); test("main navigation", async ({ page }) = > { / / Assertions use the expect API. await expect(page).toHaveURL("https: / / playwright.dev/"); }); });
  2. Easy to parallelize npx playwright test - - workers 4

    / / playwright.conf i g.js import { def i neConf i g } from '@playwright/test'; export default def i neConf i g({ workers: process.env.CI ? 2 : undef i ned, })
  3. Built for quick execution const button = page.locator('button') await button.click()

    await expect(button).toBeHidden() Auto-wait and web- fi rst assertions make waitFor statements redundant.
  4. Auto-wait Web- fi rst assertions Screenshots Test runner Retries Tracing

    VS Code extension Inspector Debugger Codegen Image Snapshots Native UI
  5. Account create Account login Account update Account delete 99.999% 99.1%

    99.8% 99.94% Stellar frontends with con fi dence