[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D9KD92F9CC876G85EXDD3T":3,"skill-same:01M7D9KD92F9CC876G85EXDD3T":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":14,"repositoryHtmlUrl":59,"repositoryHomepageUrl":6,"ownerHtmlUrl":60,"ownerBlogUrl":61,"ownerDescription":62,"updatedAt":63,"install":64,"resources":77},"01M7D9KD92F9CC876G85EXDD3T","Selenium to Playwright Migration",null,"Port a Java Selenium suite to Playwright TypeScript - locator mapping, WebDriverWait to auto-wait, Grid to workers, Page Object port, with before\u002Fafter code and a phased checklist.","GrupoANDevelopment-m\u002Falberto-ai","GrupoANDevelopment-m","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F257455179?v=4","01M7D69X2N2KEVN0SJF6WGM6SH","Antônio  Ndombe","01M7D69X3P5JTT8H8S904N3888",0,"MIT","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fskills\u002Fqa\u002Fselenium-to-playwright-migration\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: Selenium to Playwright Migration\ndescription: Port a Java Selenium suite to Playwright TypeScript - locator mapping, WebDriverWait to auto-wait, Grid to workers, Page Object port, with before\u002Fafter code and a phased checklist.\nversion: 1.0.0\nauthor: thetestingacademy\nlicense: MIT\ntags: [selenium, playwright, migration, page-object-model, auto-wait, web-automation, e2e, java, typescript]\ntestingTypes: [e2e, regression, integration]\nframeworks: [selenium, playwright]\nlanguages: [typescript, java]\ndomains: [web]\nagents: [claude-code, cursor, github-copilot, windsurf, codex, aider, continue, cline, zed, bolt, gemini-cli, amp]\n---\n\n# Selenium to Playwright Migration Skill\n\nYou are an expert at migrating Selenium test suites to Playwright. When the user asks you to port Java Selenium code to Playwright TypeScript, you map locators to Playwright's role\u002Ftext engines, delete every explicit wait in favor of auto-waiting web-first assertions, convert the Page Object Model, and replace Grid parallelism with Playwright workers and projects. You migrate in phases so the suite is green at every step, never in one risky big-bang rewrite.\n\n## Core Principles\n\n1. **Delete waits, do not translate them.** Playwright auto-waits for actionability before every action and auto-retries web-first assertions. A ported `WebDriverWait` is almost always a bug carried forward.\n2. **Prefer user-facing locators.** Move from CSS\u002FXPath to `getByRole`, `getByLabel`, `getByText`. These are resilient to DOM churn and mirror how users find elements.\n3. **Locators are lazy; WebElements are eager.** A Playwright `Locator` is a query re-evaluated on use. A Selenium `WebElement` is a stale-prone handle. This difference removes most flakiness.\n4. **One assertion library: `expect` with web-first matchers.** `await expect(locator).toBeVisible()` polls until true or times out. Never assert on a boolean you fetched manually.\n5. **Grid becomes workers + projects.** Cross-browser and parallelism are built in. Delete `RemoteWebDriver`\u002Fhub config and configure `projects` and `workers` in `playwright.config.ts`.\n6. **Port the POM, keep the structure.** Page Objects translate almost one-to-one: fields become `Locator`s built from `page`, methods become `async` and `await` actions.\n7. **Migrate in phases, stay green.** Run Selenium and Playwright side by side. Port page by page, keep CI green, retire Selenium only when parity is proven.\n8. **Trust the trace viewer over print debugging.** Playwright's trace gives DOM snapshots, network, and a timeline per step - it replaces screenshot-and-log debugging.\n\n## Locator Mapping Table\n\n| Selenium (Java) | Playwright (TypeScript) | Notes |\n|---|---|---|\n| `By.id(\"email\")` | `page.locator(\"#email\")` or `getByLabel(\"Email\")` | prefer the label-based locator |\n| `By.cssSelector(\".btn-primary\")` | `page.locator(\".btn-primary\")` | direct CSS still works |\n| `By.xpath(\"\u002F\u002Fbutton[text()='Save']\")` | `page.getByRole(\"button\", { name: \"Save\" })` | role beats XPath |\n| `By.name(\"q\")` | `page.locator(\"[name=q]\")` | |\n| `By.linkText(\"Sign in\")` | `page.getByRole(\"link\", { name: \"Sign in\" })` | |\n| `By.className(\"card\")` | `page.locator(\".card\")` | |\n| `findElements(...)` (list) | `page.locator(...).all()` or `.nth(i)` \u002F `.first()` | lazy, no staleness |\n| `driver.findElement(...).getText()` | `await locator.textContent()` \u002F `innerText()` | |\n| input by placeholder | `page.getByPlaceholder(\"Search\")` | |\n| `data-testid` attr | `page.getByTestId(\"submit\")` | configure `testIdAttribute` |\n\n## Wait Mapping: Explicit Waits Disappear\n\n| Selenium pattern | Playwright equivalent |\n|---|---|\n| `new WebDriverWait(d, 10).until(visibilityOf(el))` | `await expect(locator).toBeVisible()` |\n| `until(elementToBeClickable(el)); el.click()` | `await locator.click()` (auto-waits for actionable) |\n| `until(presenceOfElementLocated(by))` | `await locator.waitFor({ state: \"attached\" })` |\n| `until(textToBe(by, \"Done\"))` | `await expect(locator).toHaveText(\"Done\")` |\n| `Thread.sleep(2000)` | **delete it** - never needed |\n| `until(urlContains(\"\u002Fdashboard\"))` | `await expect(page).toHaveURL(\u002F\\\u002Fdashboard\u002F)` |\n| implicit wait `manage().timeouts()` | not needed; tune `expect` timeout in config |\n\n### Before (Java Selenium)\n\n```java\n\u002F\u002F LoginTest.java - typical Selenium with explicit waits\nimport org.openqa.selenium.*;\nimport org.openqa.selenium.chrome.ChromeDriver;\nimport org.openqa.selenium.support.ui.*;\nimport java.time.Duration;\nimport org.junit.jupiter.api.*;\nimport static org.junit.jupiter.api.Assertions.*;\n\npublic class LoginTest {\n    WebDriver driver;\n    WebDriverWait wait;\n\n    @BeforeEach\n    void setUp() {\n        driver = new ChromeDriver();\n        driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));\n        wait = new WebDriverWait(driver, Duration.ofSeconds(10));\n    }\n\n    @Test\n    void userCanLogIn() {\n        driver.get(\"https:\u002F\u002Fapp.example.com\u002Flogin\");\n        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(\"email\")))\n            .sendKeys(\"user@example.com\");\n        driver.findElement(By.id(\"password\")).sendKeys(\"secret\");\n        driver.findElement(By.cssSelector(\"button[type=submit]\")).click();\n\n        WebElement banner = wait.until(\n            ExpectedConditions.visibilityOfElementLocated(By.cssSelector(\".welcome\")));\n        assertTrue(banner.getText().contains(\"Welcome\"));\n        assertTrue(driver.getCurrentUrl().contains(\"\u002Fdashboard\"));\n    }\n\n    @AfterEach\n    void tearDown() { driver.quit(); }\n}\n```\n\n### After (Playwright TypeScript)\n\n```typescript\n\u002F\u002F login.spec.ts - all explicit waits gone, web-first assertions auto-retry\nimport { test, expect } from '@playwright\u002Ftest';\n\ntest('user can log in', async ({ page }) => {\n  await page.goto('https:\u002F\u002Fapp.example.com\u002Flogin');\n\n  \u002F\u002F Auto-waits for the field to be actionable - no visibilityOf wait needed.\n  await page.getByLabel('Email').fill('user@example.com');\n  await page.getByLabel('Password').fill('secret');\n  await page.getByRole('button', { name: 'Sign in' }).click();\n\n  \u002F\u002F Web-first assertions poll until true or time out.\n  await expect(page.getByText(\u002FWelcome\u002F)).toBeVisible();\n  await expect(page).toHaveURL(\u002F\\\u002Fdashboard\u002F);\n});\n\u002F\u002F No setUp\u002FtearDown: the `page` fixture creates an isolated context per test\n\u002F\u002F and disposes it automatically.\n```\n\n## Page Object Model Port\n\n### Before (Java Selenium POM)\n\n```java\n\u002F\u002F LoginPage.java\nimport org.openqa.selenium.*;\nimport org.openqa.selenium.support.ui.*;\nimport java.time.Duration;\n\npublic class LoginPage {\n    private final WebDriver driver;\n    private final WebDriverWait wait;\n    private final By email = By.id(\"email\");\n    private final By password = By.id(\"password\");\n    private final By submit = By.cssSelector(\"button[type=submit]\");\n\n    public LoginPage(WebDriver driver) {\n        this.driver = driver;\n        this.wait = new WebDriverWait(driver, Duration.ofSeconds(10));\n    }\n\n    public void open() { driver.get(\"https:\u002F\u002Fapp.example.com\u002Flogin\"); }\n\n    public DashboardPage loginAs(String user, String pass) {\n        wait.until(ExpectedConditions.visibilityOfElementLocated(email)).sendKeys(user);\n        driver.findElement(password).sendKeys(pass);\n        driver.findElement(submit).click();\n        return new DashboardPage(driver);\n    }\n}\n```\n\n### After (Playwright TypeScript POM)\n\n```typescript\n\u002F\u002F pages\u002Flogin.page.ts\nimport { type Page, type Locator } from '@playwright\u002Ftest';\nimport { DashboardPage } from '.\u002Fdashboard.page';\n\nexport class LoginPage {\n  readonly page: Page;\n  readonly email: Locator;\n  readonly password: Locator;\n  readonly submit: Locator;\n\n  constructor(page: Page) {\n    this.page = page;\n    \u002F\u002F Locators are lazy queries, bound to the page, re-evaluated on each use.\n    this.email = page.getByLabel('Email');\n    this.password = page.getByLabel('Password');\n    this.submit = page.getByRole('button', { name: 'Sign in' });\n  }\n\n  async open(): Promise\u003Cvoid> {\n    await this.page.goto('https:\u002F\u002Fapp.example.com\u002Flogin');\n  }\n\n  async loginAs(user: string, pass: string): Promise\u003CDashboardPage> {\n    await this.email.fill(user);     \u002F\u002F auto-waits for actionability\n    await this.password.fill(pass);\n    await this.submit.click();\n    return new DashboardPage(this.page);\n  }\n}\n```\n\nWire the POM into a fixture so tests receive a ready page object:\n\n```typescript\n\u002F\u002F fixtures.ts\nimport { test as base } from '@playwright\u002Ftest';\nimport { LoginPage } from '.\u002Fpages\u002Flogin.page';\n\nexport const test = base.extend\u003C{ loginPage: LoginPage }>({\n  loginPage: async ({ page }, use) => {\n    await use(new LoginPage(page));\n  },\n});\nexport { expect } from '@playwright\u002Ftest';\n```\n\n## Grid to Workers and Projects\n\nSelenium Grid (a hub plus remote nodes for cross-browser\u002Fparallel runs) is replaced entirely by Playwright config. Delete `RemoteWebDriver` and the hub URL.\n\n```typescript\n\u002F\u002F playwright.config.ts\nimport { defineConfig, devices } from '@playwright\u002Ftest';\n\nexport default defineConfig({\n  testDir: '.\u002Ftests',\n  fullyParallel: true,              \u002F\u002F run tests in files in parallel\n  workers: process.env.CI ? 4 : undefined,  \u002F\u002F replaces Grid node count\n  retries: process.env.CI ? 2 : 0,\n  reporter: [['html'], ['list']],\n  use: {\n    baseURL: 'https:\u002F\u002Fapp.example.com',\n    testIdAttribute: 'data-testid',\n    trace: 'on-first-retry',        \u002F\u002F trace viewer instead of screenshots+logs\n    screenshot: 'only-on-failure',\n  },\n  \u002F\u002F Cross-browser matrix - replaces Grid browser capabilities.\n  projects: [\n    { name: 'chromium', use: { ...devices['Desktop Chrome'] } },\n    { name: 'firefox',  use: { ...devices['Desktop Firefox'] } },\n    { name: 'webkit',   use: { ...devices['Desktop Safari'] } },\n    { name: 'mobile',   use: { ...devices['Pixel 7'] } },\n  ],\n});\n```\n\n```bash\n# Selenium: maven + grid hub + nodes. Playwright:\nnpx playwright test                      # all projects, parallel workers\nnpx playwright test --project=chromium   # one browser\nnpx playwright test --workers=8          # tune parallelism\nnpx playwright show-trace trace.zip      # debug a failure\n```\n\n## Phased Migration Checklist\n\nWork top to bottom. Do not start a phase until the previous one is green.\n\n```\nPhase 0 - Setup (no test changes)\n  [ ] npm init playwright@latest in a new `playwright\u002F` dir\n  [ ] Configure projects, baseURL, testIdAttribute, trace\n  [ ] Get one trivial smoke test passing in Playwright\n  [ ] Both suites run in CI; Selenium remains the gate\n\nPhase 1 - Locator inventory\n  [ ] List every By.* locator used across the Selenium suite\n  [ ] Map each to a Playwright locator (prefer getByRole\u002FgetByLabel)\n  [ ] Flag XPath and brittle CSS for redesign, not literal translation\n\nPhase 2 - Port Page Objects\n  [ ] Convert one Page Object at a time to a TS class with Locator fields\n  [ ] Methods become async; actions become await\n  [ ] Delete every WebDriverWait; rely on auto-wait\n  [ ] Expose POM via fixtures\n\nPhase 3 - Port tests, page by page\n  [ ] Replace assertTrue(...) with await expect(...).toBeVisible()\u002FtoHaveText()\n  [ ] Delete Thread.sleep and implicit waits entirely\n  [ ] Replace setUp\u002FtearDown with the page fixture (isolated context per test)\n  [ ] Run the new spec; debug with the trace viewer\n\nPhase 4 - Parallelism + cross-browser\n  [ ] Remove Grid\u002FRemoteWebDriver config\n  [ ] Set workers and the projects matrix\n  [ ] Confirm tests are independent (no shared state) so fullyParallel is safe\n\nPhase 5 - Retire Selenium\n  [ ] Verify Playwright covers every migrated scenario at parity\n  [ ] Switch the CI gate to Playwright\n  [ ] Delete the Selenium suite and its Grid infra\n```\n\n## Best Practices\n\n1. **Replace explicit waits with web-first assertions, not with Playwright waits.** `expect(locator).toBeVisible()` is the correct translation of most `WebDriverWait` calls.\n2. **Adopt `getByRole`\u002F`getByLabel`\u002F`getByText` during the port.** Migration is the right moment to upgrade brittle XPath\u002FCSS to user-facing locators.\n3. **Use one isolated browser context per test via the `page` fixture.** It removes `setUp`\u002F`tearDown` and guarantees clean state - cheaper than Selenium's full driver restart.\n4. **Build Page Object locators in the constructor as lazy `Locator`s.** Never store resolved elements; that reintroduces staleness.\n5. **Configure `trace: 'on-first-retry'`.** The trace viewer replaces screenshot-and-log debugging and pays for itself on the first flaky failure.\n6. **Move parallelism to `workers` and the browser matrix to `projects`.** Delete all Grid\u002Fhub infrastructure once parity is reached.\n7. **Keep both suites running in CI during migration.** Selenium stays the gate until Playwright proves parity, page by page.\n8. **Use `data-testid` via `testIdAttribute` for elements with no good role\u002Flabel.** A stable test id beats a deep CSS selector.\n\n## Anti-Patterns to Avoid\n\n1. **Literally translating `WebDriverWait` into Playwright waits.** This carries forward the flakiness you are migrating away from. Delete the wait; let auto-wait and `expect` handle it.\n2. **Keeping `Thread.sleep` as `page.waitForTimeout`.** Fixed sleeps are flaky in both tools. Wait for a condition, never a duration.\n3. **Porting XPath verbatim.** It works but wastes the migration's biggest win. Convert to role\u002Flabel\u002Ftext locators.\n4. **Storing resolved elements in Page Object fields.** Playwright locators must stay lazy; an eagerly resolved element defeats auto-retry.\n5. **Manually fetching a value then asserting on it** (`const t = await loc.textContent(); expect(t).toBe(...)`). This skips polling. Use `await expect(loc).toHaveText(...)`.\n6. **A single huge big-bang rewrite.** Porting everything at once leaves no green checkpoint. Migrate page by page with both suites live.\n7. **Recreating a Grid mindset with shared global state.** Playwright workers run in isolated contexts; tests that share state break `fullyParallel`.\n\n## When to Trigger This Skill\n\nTrigger when the user asks to:\n- Migrate, port, or convert Selenium tests to Playwright\n- Map Selenium locators \u002F WebDriverWait to Playwright equivalents\n- Move from Selenium Grid to Playwright parallelism \u002F cross-browser\n- Convert a Java (or other) Selenium Page Object Model to Playwright TypeScript\n- Plan a phased Selenium-to-Playwright migration\n- Remove flaky explicit waits inherited from a Selenium suite\n\nFor greenfield Playwright authoring (not a migration), use a Playwright E2E patterns skill instead.\n","# Selenium to Playwright Migration Skill\n\nYou are an expert at migrating Selenium test suites to Playwright. When the user asks you to port Java Selenium code to Playwright TypeScript, you map locators to Playwright's role\u002Ftext engines, delete every explicit wait in favor of auto-waiting web-first assertions, convert the Page Object Model, and replace Grid parallelism with Playwright workers and projects. You migrate in phases so the suite is green at every step, never in one risky big-bang rewrite.\n\n## Core Principles\n\n1. **Delete waits, do not translate them.** Playwright auto-waits for actionability before every action and auto-retries web-first assertions. A ported `WebDriverWait` is almost always a bug carried forward.\n2. **Prefer user-facing locators.** Move from CSS\u002FXPath to `getByRole`, `getByLabel`, `getByText`. These are resilient to DOM churn and mirror how users find elements.\n3. **Locators are lazy; WebElements are eager.** A Playwright `Locator` is a query re-evaluated on use. A Selenium `WebElement` is a stale-prone handle. This difference removes most flakiness.\n4. **One assertion library: `expect` with web-first matchers.** `await expect(locator).toBeVisible()` polls until true or times out. Never assert on a boolean you fetched manually.\n5. **Grid becomes workers + projects.** Cross-browser and parallelism are built in. Delete `RemoteWebDriver`\u002Fhub config and configure `projects` and `workers` in `playwright.config.ts`.\n6. **Port the POM, keep the structure.** Page Objects translate almost one-to-one: fields become `Locator`s built from `page`, methods become `async` and `await` actions.\n7. **Migrate in phases, stay green.** Run Selenium and Playwright side by side. Port page by page, keep CI green, retire Selenium only when parity is proven.\n8. **Trust the trace viewer over print debugging.** Playwright's trace gives DOM snapshots, network, and a timeline per step - it replaces screenshot-and-log debugging.\n\n## Locator Mapping Table\n\n| Selenium (Java) | Playwright (TypeScript) | Notes |\n|---|---|---|\n| `By.id(\"email\")` | `page.locator(\"#email\")` or `getByLabel(\"Email\")` | prefer the label-based locator |\n| `By.cssSelector(\".btn-primary\")` | `page.locator(\".btn-primary\")` | direct CSS still works |\n| `By.xpath(\"\u002F\u002Fbutton[text()='Save']\")` | `page.getByRole(\"button\", { name: \"Save\" })` | role beats XPath |\n| `By.name(\"q\")` | `page.locator(\"[name=q]\")` | |\n| `By.linkText(\"Sign in\")` | `page.getByRole(\"link\", { name: \"Sign in\" })` | |\n| `By.className(\"card\")` | `page.locator(\".card\")` | |\n| `findElements(...)` (list) | `page.locator(...).all()` or `.nth(i)` \u002F `.first()` | lazy, no staleness |\n| `driver.findElement(...).getText()` | `await locator.textContent()` \u002F `innerText()` | |\n| input by placeholder | `page.getByPlaceholder(\"Search\")` | |\n| `data-testid` attr | `page.getByTestId(\"submit\")` | configure `testIdAttribute` |\n\n## Wait Mapping: Explicit Waits Disappear\n\n| Selenium pattern | Playwright equivalent |\n|---|---|\n| `new WebDriverWait(d, 10).until(visibilityOf(el))` | `await expect(locator).toBeVisible()` |\n| `until(elementToBeClickable(el)); el.click()` | `await locator.click()` (auto-waits for actionable) |\n| `until(presenceOfElementLocated(by))` | `await locator.waitFor({ state: \"attached\" })` |\n| `until(textToBe(by, \"Done\"))` | `await expect(locator).toHaveText(\"Done\")` |\n| `Thread.sleep(2000)` | **delete it** - never needed |\n| `until(urlContains(\"\u002Fdashboard\"))` | `await expect(page).toHaveURL(\u002F\\\u002Fdashboard\u002F)` |\n| implicit wait `manage().timeouts()` | not needed; tune `expect` timeout in config |\n\n### Before (Java Selenium)\n\n```java\n\u002F\u002F LoginTest.java - typical Selenium with explicit waits\nimport org.openqa.selenium.*;\nimport org.openqa.selenium.chrome.ChromeDriver;\nimport org.openqa.selenium.support.ui.*;\nimport java.time.Duration;\nimport org.junit.jupiter.api.*;\nimport static org.junit.jupiter.api.Assertions.*;\n\npublic class LoginTest {\n    WebDriver driver;\n    WebDriverWait wait;\n\n    @BeforeEach\n    void setUp() {\n        driver = new ChromeDriver();\n        driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));\n        wait = new WebDriverWait(driver, Duration.ofSeconds(10));\n    }\n\n    @Test\n    void userCanLogIn() {\n        driver.get(\"https:\u002F\u002Fapp.example.com\u002Flogin\");\n        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id(\"email\")))\n            .sendKeys(\"user@example.com\");\n        driver.findElement(By.id(\"password\")).sendKeys(\"secret\");\n        driver.findElement(By.cssSelector(\"button[type=submit]\")).click();\n\n        WebElement banner = wait.until(\n            ExpectedConditions.visibilityOfElementLocated(By.cssSelector(\".welcome\")));\n        assertTrue(banner.getText().contains(\"Welcome\"));\n        assertTrue(driver.getCurrentUrl().contains(\"\u002Fdashboard\"));\n    }\n\n    @AfterEach\n    void tearDown() { driver.quit(); }\n}\n```\n\n### After (Playwright TypeScript)\n\n```typescript\n\u002F\u002F login.spec.ts - all explicit waits gone, web-first assertions auto-retry\nimport { test, expect } from '@playwright\u002Ftest';\n\ntest('user can log in', async ({ page }) => {\n  await page.goto('https:\u002F\u002Fapp.example.com\u002Flogin');\n\n  \u002F\u002F Auto-waits for the field to be actionable - no visibilityOf wait needed.\n  await page.getByLabel('Email').fill('user@example.com');\n  await page.getByLabel('Password').fill('secret');\n  await page.getByRole('button', { name: 'Sign in' }).click();\n\n  \u002F\u002F Web-first assertions poll until true or time out.\n  await expect(page.getByText(\u002FWelcome\u002F)).toBeVisible();\n  await expect(page).toHaveURL(\u002F\\\u002Fdashboard\u002F);\n});\n\u002F\u002F No setUp\u002FtearDown: the `page` fixture creates an isolated context per test\n\u002F\u002F and disposes it automatically.\n```\n\n## Page Object Model Port\n\n### Before (Java Selenium POM)\n\n```java\n\u002F\u002F LoginPage.java\nimport org.openqa.selenium.*;\nimport org.openqa.selenium.support.ui.*;\nimport java.time.Duration;\n\npublic class LoginPage {\n    private final WebDriver driver;\n    private final WebDriverWait wait;\n    private final By email = By.id(\"email\");\n    private final By password = By.id(\"password\");\n    private final By submit = By.cssSelector(\"button[type=submit]\");\n\n    public LoginPage(WebDriver driver) {\n        this.driver = driver;\n        this.wait = new WebDriverWait(driver, Duration.ofSeconds(10));\n    }\n\n    public void open() { driver.get(\"https:\u002F\u002Fapp.example.com\u002Flogin\"); }\n\n    public DashboardPage loginAs(String user, String pass) {\n        wait.until(ExpectedConditions.visibilityOfElementLocated(email)).sendKeys(user);\n        driver.findElement(password).sendKeys(pass);\n        driver.findElement(submit).click();\n        return new DashboardPage(driver);\n    }\n}\n```\n\n### After (Playwright TypeScript POM)\n\n```typescript\n\u002F\u002F pages\u002Flogin.page.ts\nimport { type Page, type Locator } from '@playwright\u002Ftest';\nimport { DashboardPage } from '.\u002Fdashboard.page';\n\nexport class LoginPage {\n  readonly page: Page;\n  readonly email: Locator;\n  readonly password: Locator;\n  readonly submit: Locator;\n\n  constructor(page: Page) {\n    this.page = page;\n    \u002F\u002F Locators are lazy queries, bound to the page, re-evaluated on each use.\n    this.email = page.getByLabel('Email');\n    this.password = page.getByLabel('Password');\n    this.submit = page.getByRole('button', { name: 'Sign in' });\n  }\n\n  async open(): Promise\u003Cvoid> {\n    await this.page.goto('https:\u002F\u002Fapp.example.com\u002Flogin');\n  }\n\n  async loginAs(user: string, pass: string): Promise\u003CDashboardPage> {\n    await this.email.fill(user);     \u002F\u002F auto-waits for actionability\n    await this.password.fill(pass);\n    await this.submit.click();\n    return new DashboardPage(this.page);\n  }\n}\n```\n\nWire the POM into a fixture so tests receive a ready page object:\n\n```typescript\n\u002F\u002F fixtures.ts\nimport { test as base } from '@playwright\u002Ftest';\nimport { LoginPage } from '.\u002Fpages\u002Flogin.page';\n\nexport const test = base.extend\u003C{ loginPage: LoginPage }>({\n  loginPage: async ({ page }, use) => {\n    await use(new LoginPage(page));\n  },\n});\nexport { expect } from '@playwright\u002Ftest';\n```\n\n## Grid to Workers and Projects\n\nSelenium Grid (a hub plus remote nodes for cross-browser\u002Fparallel runs) is replaced entirely by Playwright config. Delete `RemoteWebDriver` and the hub URL.\n\n```typescript\n\u002F\u002F playwright.config.ts\nimport { defineConfig, devices } from '@playwright\u002Ftest';\n\nexport default defineConfig({\n  testDir: '.\u002Ftests',\n  fullyParallel: true,              \u002F\u002F run tests in files in parallel\n  workers: process.env.CI ? 4 : undefined,  \u002F\u002F replaces Grid node count\n  retries: process.env.CI ? 2 : 0,\n  reporter: [['html'], ['list']],\n  use: {\n    baseURL: 'https:\u002F\u002Fapp.example.com',\n    testIdAttribute: 'data-testid',\n    trace: 'on-first-retry',        \u002F\u002F trace viewer instead of screenshots+logs\n    screenshot: 'only-on-failure',\n  },\n  \u002F\u002F Cross-browser matrix - replaces Grid browser capabilities.\n  projects: [\n    { name: 'chromium', use: { ...devices['Desktop Chrome'] } },\n    { name: 'firefox',  use: { ...devices['Desktop Firefox'] } },\n    { name: 'webkit',   use: { ...devices['Desktop Safari'] } },\n    { name: 'mobile',   use: { ...devices['Pixel 7'] } },\n  ],\n});\n```\n\n```bash\n# Selenium: maven + grid hub + nodes. Playwright:\nnpx playwright test                      # all projects, parallel workers\nnpx playwright test --project=chromium   # one browser\nnpx playwright test --workers=8          # tune parallelism\nnpx playwright show-trace trace.zip      # debug a failure\n```\n\n## Phased Migration Checklist\n\nWork top to bottom. Do not start a phase until the previous one is green.\n\n```\nPhase 0 - Setup (no test changes)\n  [ ] npm init playwright@latest in a new `playwright\u002F` dir\n  [ ] Configure projects, baseURL, testIdAttribute, trace\n  [ ] Get one trivial smoke test passing in Playwright\n  [ ] Both suites run in CI; Selenium remains the gate\n\nPhase 1 - Locator inventory\n  [ ] List every By.* locator used across the Selenium suite\n  [ ] Map each to a Playwright locator (prefer getByRole\u002FgetByLabel)\n  [ ] Flag XPath and brittle CSS for redesign, not literal translation\n\nPhase 2 - Port Page Objects\n  [ ] Convert one Page Object at a time to a TS class with Locator fields\n  [ ] Methods become async; actions become await\n  [ ] Delete every WebDriverWait; rely on auto-wait\n  [ ] Expose POM via fixtures\n\nPhase 3 - Port tests, page by page\n  [ ] Replace assertTrue(...) with await expect(...).toBeVisible()\u002FtoHaveText()\n  [ ] Delete Thread.sleep and implicit waits entirely\n  [ ] Replace setUp\u002FtearDown with the page fixture (isolated context per test)\n  [ ] Run the new spec; debug with the trace viewer\n\nPhase 4 - Parallelism + cross-browser\n  [ ] Remove Grid\u002FRemoteWebDriver config\n  [ ] Set workers and the projects matrix\n  [ ] Confirm tests are independent (no shared state) so fullyParallel is safe\n\nPhase 5 - Retire Selenium\n  [ ] Verify Playwright covers every migrated scenario at parity\n  [ ] Switch the CI gate to Playwright\n  [ ] Delete the Selenium suite and its Grid infra\n```\n\n## Best Practices\n\n1. **Replace explicit waits with web-first assertions, not with Playwright waits.** `expect(locator).toBeVisible()` is the correct translation of most `WebDriverWait` calls.\n2. **Adopt `getByRole`\u002F`getByLabel`\u002F`getByText` during the port.** Migration is the right moment to upgrade brittle XPath\u002FCSS to user-facing locators.\n3. **Use one isolated browser context per test via the `page` fixture.** It removes `setUp`\u002F`tearDown` and guarantees clean state - cheaper than Selenium's full driver restart.\n4. **Build Page Object locators in the constructor as lazy `Locator`s.** Never store resolved elements; that reintroduces staleness.\n5. **Configure `trace: 'on-first-retry'`.** The trace viewer replaces screenshot-and-log debugging and pays for itself on the first flaky failure.\n6. **Move parallelism to `workers` and the browser matrix to `projects`.** Delete all Grid\u002Fhub infrastructure once parity is reached.\n7. **Keep both suites running in CI during migration.** Selenium stays the gate until Playwright proves parity, page by page.\n8. **Use `data-testid` via `testIdAttribute` for elements with no good role\u002Flabel.** A stable test id beats a deep CSS selector.\n\n## Anti-Patterns to Avoid\n\n1. **Literally translating `WebDriverWait` into Playwright waits.** This carries forward the flakiness you are migrating away from. Delete the wait; let auto-wait and `expect` handle it.\n2. **Keeping `Thread.sleep` as `page.waitForTimeout`.** Fixed sleeps are flaky in both tools. Wait for a condition, never a duration.\n3. **Porting XPath verbatim.** It works but wastes the migration's biggest win. Convert to role\u002Flabel\u002Ftext locators.\n4. **Storing resolved elements in Page Object fields.** Playwright locators must stay lazy; an eagerly resolved element defeats auto-retry.\n5. **Manually fetching a value then asserting on it** (`const t = await loc.textContent(); expect(t).toBe(...)`). This skips polling. Use `await expect(loc).toHaveText(...)`.\n6. **A single huge big-bang rewrite.** Porting everything at once leaves no green checkpoint. Migrate page by page with both suites live.\n7. **Recreating a Grid mindset with shared global state.** Playwright workers run in isolated contexts; tests that share state break `fullyParallel`.\n\n## When to Trigger This Skill\n\nTrigger when the user asks to:\n- Migrate, port, or convert Selenium tests to Playwright\n- Map Selenium locators \u002F WebDriverWait to Playwright equivalents\n- Move from Selenium Grid to Playwright parallelism \u002F cross-browser\n- Convert a Java (or other) Selenium Page Object Model to Playwright TypeScript\n- Plan a phased Selenium-to-Playwright migration\n- Remove flaky explicit waits inherited from a Selenium suite\n\nFor greenfield Playwright authoring (not a migration), use a Playwright E2E patterns skill instead.\n",{"name":5,"tags":24,"agents":34,"author":47,"domains":48,"license":15,"version":50,"languages":51,"frameworks":52,"description":7,"testingTypes":53},[25,26,27,28,29,30,31,32,33],"selenium","playwright","migration","page-object-model","auto-wait","web-automation","e2e","java","typescript",[35,36,37,38,39,40,41,42,43,44,45,46],"claude-code","cursor","github-copilot","windsurf","codex","aider","continue","cline","zed","bolt","gemini-cli","amp","thetestingacademy",[49],"web","1.0.0",[33,32],[25,26],[31,54,55],"regression","integration","main","eac438ea9216a7cb8a570cab803eb01eeafc6793","skills\u002Fqa\u002Fselenium-to-playwright-migration","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m","https:\u002F\u002Fid-preview--d5bef06d-6c9e-4563-a3d4-a855b9d61610.lovable.app\u002F","Eu sou Antonio B. B. Ndombe \r\nEu sou um Pesquisador e desenvolvedor de sistema autonomia cognitivos, fundador de sistemas ODCs ( organismos digital conscientes)","2026-11-04 06:53:39",{"source":8,"skillName":5,"commands":65,"prompt":75,"zipAvailable":76},[66,69,72],{"tool":67,"command":68},"npx","npx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"Selenium to Playwright Migration\"",{"tool":70,"command":71},"bunx","bunx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"Selenium to Playwright Migration\"",{"tool":73,"command":74},"pnpm","pnpm dlx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"Selenium to Playwright Migration\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fskills\u002Fqa\u002Fselenium-to-playwright-migration\u002FSKILL.md",true,[],[79,87,94,101,108,115],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":83,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7DASC6FSCJP49JZBSK0NY1Z","nemoclaw-user-reference","Describes the NemoClaw integration layer and blueprint architecture and how they orchestrate compatible agent sandboxes. Use when looking up architecture, agent integration, plugin structure, or blueprint design. Trigger keywords - nemoclaw architecture, nemoclaw agent architecture, nemoclaw plugin blueprint structure, nemoclaw vs openshell, which cli, nemoclaw cli, openshell cli, sandbox commands, nemoclaw cli commands, nemoclaw command reference, nemoclaw network policy, sandbox egress control operator approval, nemoclaw troubleshooting, nemoclaw debug sandbox issues.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-reference\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":83,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7DAS5S79VK33XFGVAM2TFWF","nemoclaw-user-overview","Explains how OpenClaw, OpenShell, and NemoClaw form the ecosystem, NemoClaw's position in the stack, what NemoClaw adds beyond the community sandbox, and when to prefer NemoClaw versus integrating OpenShell and OpenClaw directly. Use when users ask about the relationship between OpenClaw, OpenShell, and NemoClaw, or when to use NemoClaw versus OpenShell. Trigger keywords - nemoclaw ecosystem, openclaw openshell, nemoclaw vs openshell, sandboxed openclaw, how nemoclaw works, nemoclaw sandbox lifecycle blueprint, nemoclaw overview, openclaw always-on assistants, nvidia openshell, nvidia nemotron, nemoclaw release notes, nemoclaw changelog.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-overview\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":83,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":19},"01M7DAS0PQEMET5MNGZ1ABSZVS","nemoclaw-user-monitor-sandbox","Inspects sandbox health, traces agent behavior, and diagnoses problems. Use when monitoring a running sandbox, debugging agent issues, or checking sandbox logs. Trigger keywords - monitor nemoclaw sandbox, debug nemoclaw agent issues.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-monitor-sandbox\u002FSKILL.md",[],[],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":83,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":19},"01M7DARQYGF7E9A69VH6S3CGN9","nemoclaw-user-manage-sandboxes","Explains operational tasks after the quickstart: listing sandboxes, status and health checks, logs, diagnostics, port forwards, multiple sandboxes, credential reset, rebuilds, network presets, upgrades, and uninstall. Trigger keywords - manage nemoclaw sandboxes, nemoclaw status, nemoclaw list, nemoclaw dashboard port, nemoclaw rebuild, nemoclaw upgrade sandboxes, nemoclaw uninstall, sandbox mutability, sandbox runtime configuration, sandbox rebuild, nemoclaw backup, nemoclaw restore, workspace backup, openshell sandbox download upload, nemoclaw messaging channels, nemoclaw telegram, nemoclaw discord, nemoclaw slack, nemoclaw wechat, nemoclaw whatsapp, openshell channel messaging, nemoclaw workspace files, soul.md, user.md, identity.md, agents.md, sandbox persistence.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-manage-sandboxes\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":83,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":19},"01M7DARH8BRTG51TRCAB7YWDJ4","nemoclaw-user-manage-policy","Adds, removes, or modifies allowed endpoints in the sandbox policy. Use when customizing network policy, changing egress rules, or configuring sandbox endpoint access. Trigger keywords - customize nemoclaw network policy, sandbox egress policy configuration, nemoclaw integration policy examples, post-install policy setup, openshell approval workflow, policy preset, nemoclaw approve network requests, sandbox egress approval tui.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-manage-policy\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":83,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":19},"01M7DARAT62M2VR37590VCZ5NS","nemoclaw-user-get-started","Installs NemoClaw, launches a sandbox, and runs the first agent prompt. Use when onboarding, installing, or launching a NemoClaw sandbox for the first time. Trigger keywords - nemoclaw quickstart, install nemoclaw openclaw sandbox, nemohermes quickstart, hermes agent nemoclaw, run hermes openshell sandbox, nemoclaw prerequisites, nemoclaw supported platforms, nemoclaw hardware software, nemoclaw windows wsl2 setup, nemoclaw install windows docker desktop.","https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fupstream\u002Fnemoclaw\u002Fskills\u002Fnemoclaw-user-get-started\u002FSKILL.md",[],[]]