Day 1–7: pick three money paths (login, checkout, refund). Rewrite only those in Playwright with role locators. Day 8–21: run both jobs in CI; Playwright is the merge gate for those paths; Selenium still runs nightly. Day 22–30: delete the Selenium twins only after Playwright has seven green nights.
jobs:
playwright-critical:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npx playwright install --with-deps chromium
- run: npx playwright test --grep @critical
selenium-nightly:
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- run: mvn -q test
import { test, expect } from "@playwright/test";
test("login @critical", async ({ page }) => {
await page.goto("/login");
await page.getByLabel("Email").fill("qa@example.com");
await page.getByLabel("Password").fill(process.env.QA_PASSWORD!);
await page.getByRole("button", { name: "Sign in" }).click();
await expect(page.getByRole("heading", { name: "Overview" })).toBeVisible();
});
Do not translate every TestNG class. The leftover Selenium pack is a defect net, not a career path. Before planning the migration scope, score your suite maturity with the free QA maturity assessment. Enterprise software testing modernization on the Enterprise page is how we run this as a factory. Implementation help sits under AI quality engineering services.