288 cards
Playwright is a browser automation framework that drives Chromium, Firefox, and WebKit and ships with its own test runner, @playwright/test. To get a project running, install the test package as a dev dependency, install the browser binaries, and run the test command. Once installed, every project's most important file...
The single biggest source of flaky Playwright tests is bad selectors, so the framework steers you toward accessibility-driven queries. getByRole, getByLabel, getByPlaceholder, and getByText let you describe elements the way a user or screen reader would, which makes tests resilient to DOM refactors and visual redesigns...
Playwright's auto-wait engine waits for elements to be attached, visible, stable, and enabled before acting, and it waits for navigation when appropriate. That means most tests don't need explicit sleeps at all. When you do need to wait, prefer expect(locator) assertions such as toBeVisible, toHaveText, toHaveURL, toHa...
Playwright's CLI exposes a rich set of run modes that help both humans and AI agents iterate quickly. npx playwright test runs everything; you can scope to one file (npx playwright test e2e/auth.spec.ts), to a single project (--project=chromium), or to a substring of a test name (-g 'login'). Tags live in the test titl...
Logging in once and reusing the session across tests is one of the biggest speed and reliability wins in an E2E suite. The standard mechanism is storageState, a JSON file containing cookies and localStorage that Playwright can preload into a context via test.use({ storageState: 'storageState.json' }). The recommended p...
Visual regression in Playwright comes from snapshot tests: expect(page).toHaveScreenshot('home.png') captures the page and compares it to a stored baseline, while expect(locator).toHaveScreenshot('card.png') limits the diff to a single component. These are powerful but unforgiving, so the strategy is to pick a small se...
A CI pipeline that runs Playwright reliably needs a few essentials. Install browsers with npx playwright install --with-deps so all required system libraries are present, export CI=1 so the config switches to reuseExistingServer:false, and run npx playwright test as the main step. After the run, upload both playwright-...
The local workspace contains two main product areas, each with a Vue 3 app, a Vue 2 app, and a Laravel backend. AMS lives under /root/myapp/admin with admin-2-vue (Vue 3), admin-vue (Vue 2), and admin-laravel, while Connect sits under /root/myapp/portal with portal-2-vue, portal-vue, and portal-laravel. Dev server port...