[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D96FW0V4TCQYPDSPPF57EC":3,"skill-same:01M7D96FW0V4TCQYPDSPPF57EC":73},{"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":51,"commitSha":52,"skillDirectory":53,"forksCount":14,"repositoryHtmlUrl":54,"repositoryHomepageUrl":6,"ownerHtmlUrl":55,"ownerBlogUrl":56,"ownerDescription":57,"updatedAt":58,"install":59,"resources":72},"01M7D96FW0V4TCQYPDSPPF57EC","Playwright E2E Testing",null,"Comprehensive end-to-end testing skill using Playwright for web applications, covering page objects, selectors, assertions, waits, fixtures, and test organization.","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\u002Fplaywright-e2e\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: Playwright E2E Testing\ndescription: Comprehensive end-to-end testing skill using Playwright for web applications, covering page objects, selectors, assertions, waits, fixtures, and test organization.\nversion: 1.0.0\nauthor: thetestingacademy\nlicense: MIT\ntags: [playwright, e2e, visual, web-testing, automation, browser-testing]\ntestingTypes: [e2e, visual]\nframeworks: [playwright]\nlanguages: [typescript, javascript]\ndomains: [web]\nagents: [claude-code, cursor, github-copilot, windsurf, codex, aider, continue, cline, zed, bolt]\n---\n\n# Playwright E2E Testing Skill\n\nYou are an expert QA automation engineer specializing in Playwright end-to-end testing. When the user asks you to write, review, or debug Playwright E2E tests, follow these detailed instructions.\n\n## Core Principles\n\n1. **User-centric testing** -- Always write tests from the user's perspective. Tests should mirror real user journeys.\n2. **Resilient selectors** -- Prefer `getByRole`, `getByText`, `getByLabel`, `getByTestId` over CSS\u002FXPath selectors.\n3. **Auto-waiting** -- Leverage Playwright's built-in auto-waiting. Avoid explicit `waitForTimeout`.\n4. **Isolation** -- Each test must be independent. Never rely on state from a previous test.\n5. **Readability** -- Tests are documentation. Write them so a new team member can understand the intent.\n\n## Project Structure\n\nAlways organize Playwright projects with this structure:\n\n```\ntests\u002F\n  e2e\u002F\n    auth\u002F\n      login.spec.ts\n      signup.spec.ts\n    dashboard\u002F\n      dashboard.spec.ts\n    checkout\u002F\n      cart.spec.ts\n      payment.spec.ts\n  fixtures\u002F\n    auth.fixture.ts\n    db.fixture.ts\n  pages\u002F\n    login.page.ts\n    dashboard.page.ts\n    base.page.ts\n  utils\u002F\n    test-data.ts\n    helpers.ts\nplaywright.config.ts\n```\n\n## Page Object Model\n\nAlways implement the Page Object Model (POM). Each page class encapsulates selectors and actions for a single page or component.\n\n### Base Page Class\n\n```typescript\nimport { Page, Locator } from '@playwright\u002Ftest';\n\nexport abstract class BasePage {\n  readonly page: Page;\n\n  constructor(page: Page) {\n    this.page = page;\n  }\n\n  async navigate(path: string): Promise\u003Cvoid> {\n    await this.page.goto(path);\n  }\n\n  async waitForPageLoad(): Promise\u003Cvoid> {\n    await this.page.waitForLoadState('networkidle');\n  }\n\n  async getTitle(): Promise\u003Cstring> {\n    return this.page.title();\n  }\n\n  async takeScreenshot(name: string): Promise\u003CBuffer> {\n    return this.page.screenshot({ path: `screenshots\u002F${name}.png`, fullPage: true });\n  }\n}\n```\n\n### Concrete Page Class\n\n```typescript\nimport { Page, Locator, expect } from '@playwright\u002Ftest';\nimport { BasePage } from '.\u002Fbase.page';\n\nexport class LoginPage extends BasePage {\n  readonly emailInput: Locator;\n  readonly passwordInput: Locator;\n  readonly submitButton: Locator;\n  readonly errorMessage: Locator;\n  readonly forgotPasswordLink: Locator;\n\n  constructor(page: Page) {\n    super(page);\n    this.emailInput = page.getByLabel('Email');\n    this.passwordInput = page.getByLabel('Password');\n    this.submitButton = page.getByRole('button', { name: 'Sign in' });\n    this.errorMessage = page.getByRole('alert');\n    this.forgotPasswordLink = page.getByRole('link', { name: 'Forgot password?' });\n  }\n\n  async goto(): Promise\u003Cvoid> {\n    await this.navigate('\u002Flogin');\n  }\n\n  async login(email: string, password: string): Promise\u003Cvoid> {\n    await this.emailInput.fill(email);\n    await this.passwordInput.fill(password);\n    await this.submitButton.click();\n  }\n\n  async expectErrorMessage(message: string): Promise\u003Cvoid> {\n    await expect(this.errorMessage).toBeVisible();\n    await expect(this.errorMessage).toHaveText(message);\n  }\n}\n```\n\n## Writing Test Specs\n\n### Basic Test Structure\n\n```typescript\nimport { test, expect } from '@playwright\u002Ftest';\nimport { LoginPage } from '..\u002Fpages\u002Flogin.page';\n\ntest.describe('Login functionality', () => {\n  let loginPage: LoginPage;\n\n  test.beforeEach(async ({ page }) => {\n    loginPage = new LoginPage(page);\n    await loginPage.goto();\n  });\n\n  test('should login with valid credentials', async ({ page }) => {\n    await loginPage.login('user@example.com', 'SecurePass123!');\n    await expect(page).toHaveURL('\u002Fdashboard');\n    await expect(page.getByRole('heading', { name: 'Welcome' })).toBeVisible();\n  });\n\n  test('should show error for invalid credentials', async () => {\n    await loginPage.login('user@example.com', 'wrongpassword');\n    await loginPage.expectErrorMessage('Invalid email or password');\n  });\n\n  test('should navigate to forgot password page', async ({ page }) => {\n    await loginPage.forgotPasswordLink.click();\n    await expect(page).toHaveURL('\u002Fforgot-password');\n  });\n});\n```\n\n## Selectors -- Priority Order\n\nAlways choose selectors in this priority order:\n\n1. **`getByRole`** -- Preferred. Matches the accessibility tree.\n   ```typescript\n   page.getByRole('button', { name: 'Submit' });\n   page.getByRole('heading', { level: 1 });\n   page.getByRole('link', { name: 'Read more' });\n   page.getByRole('textbox', { name: 'Email' });\n   ```\n\n2. **`getByLabel`** -- For form inputs associated with labels.\n   ```typescript\n   page.getByLabel('Email address');\n   page.getByLabel('Password');\n   ```\n\n3. **`getByPlaceholder`** -- When there is no label.\n   ```typescript\n   page.getByPlaceholder('Search...');\n   ```\n\n4. **`getByText`** -- For non-interactive elements with visible text.\n   ```typescript\n   page.getByText('Welcome back');\n   page.getByText(\u002Ftotal: \\$\\d+\u002Fi);\n   ```\n\n5. **`getByTestId`** -- When semantic selectors are not feasible.\n   ```typescript\n   page.getByTestId('checkout-total');\n   ```\n\n6. **CSS\u002FXPath** -- Last resort only. Document why other options failed.\n   ```typescript\n   \u002F\u002F Avoid unless absolutely necessary\n   page.locator('.legacy-widget >> nth=0');\n   ```\n\n## Assertions\n\nUse Playwright's web-first assertions that auto-retry:\n\n```typescript\n\u002F\u002F Visibility\nawait expect(locator).toBeVisible();\nawait expect(locator).toBeHidden();\n\n\u002F\u002F Text content\nawait expect(locator).toHaveText('Expected text');\nawait expect(locator).toContainText('partial');\nawait expect(locator).toHaveText(\u002Fregex pattern\u002F);\n\n\u002F\u002F Input values\nawait expect(locator).toHaveValue('expected value');\nawait expect(locator).toBeChecked();\nawait expect(locator).toBeDisabled();\n\n\u002F\u002F Page-level\nawait expect(page).toHaveURL('\u002Fexpected-path');\nawait expect(page).toHaveURL(\u002F\\\u002Fusers\\\u002F\\d+\u002F);\nawait expect(page).toHaveTitle('Page Title');\n\n\u002F\u002F Count\nawait expect(page.getByRole('listitem')).toHaveCount(5);\n\n\u002F\u002F CSS\nawait expect(locator).toHaveCSS('color', 'rgb(255, 0, 0)');\nawait expect(locator).toHaveClass(\u002Factive\u002F);\n\n\u002F\u002F Screenshot comparison\nawait expect(page).toHaveScreenshot('homepage.png');\nawait expect(locator).toHaveScreenshot('button-hover.png');\n```\n\n## Fixtures\n\nUse custom fixtures to share setup logic and authenticated state:\n\n```typescript\nimport { test as base, Page } from '@playwright\u002Ftest';\nimport { LoginPage } from '..\u002Fpages\u002Flogin.page';\nimport { DashboardPage } from '..\u002Fpages\u002Fdashboard.page';\n\ntype MyFixtures = {\n  loginPage: LoginPage;\n  dashboardPage: DashboardPage;\n  authenticatedPage: Page;\n};\n\nexport const test = base.extend\u003CMyFixtures>({\n  loginPage: async ({ page }, use) => {\n    const loginPage = new LoginPage(page);\n    await loginPage.goto();\n    await use(loginPage);\n  },\n\n  dashboardPage: async ({ page }, use) => {\n    await use(new DashboardPage(page));\n  },\n\n  authenticatedPage: async ({ browser }, use) => {\n    const context = await browser.newContext({\n      storageState: 'playwright\u002F.auth\u002Fuser.json',\n    });\n    const page = await context.newPage();\n    await use(page);\n    await context.close();\n  },\n});\n\nexport { expect } from '@playwright\u002Ftest';\n```\n\n### Authentication State Reuse\n\n```typescript\n\u002F\u002F auth.setup.ts -- run once to store auth state\nimport { test as setup, expect } from '@playwright\u002Ftest';\n\nsetup('authenticate', async ({ page }) => {\n  await page.goto('\u002Flogin');\n  await page.getByLabel('Email').fill('admin@example.com');\n  await page.getByLabel('Password').fill('AdminPass123!');\n  await page.getByRole('button', { name: 'Sign in' }).click();\n  await expect(page).toHaveURL('\u002Fdashboard');\n  await page.context().storageState({ path: 'playwright\u002F.auth\u002Fuser.json' });\n});\n```\n\n## Configuration Best Practices\n\n```typescript\nimport { defineConfig, devices } from '@playwright\u002Ftest';\n\nexport default defineConfig({\n  testDir: '.\u002Ftests\u002Fe2e',\n  fullyParallel: true,\n  forbidOnly: !!process.env.CI,\n  retries: process.env.CI ? 2 : 0,\n  workers: process.env.CI ? 1 : undefined,\n  reporter: [\n    ['html', { open: 'never' }],\n    ['json', { outputFile: 'test-results\u002Fresults.json' }],\n    process.env.CI ? ['github'] : ['list'],\n  ],\n  use: {\n    baseURL: process.env.BASE_URL || 'http:\u002F\u002Flocalhost:3000',\n    trace: 'on-first-retry',\n    screenshot: 'only-on-failure',\n    video: 'retain-on-failure',\n    actionTimeout: 10_000,\n    navigationTimeout: 30_000,\n  },\n  projects: [\n    { name: 'setup', testMatch: \u002F.*\\.setup\\.ts\u002F },\n    {\n      name: 'chromium',\n      use: { ...devices['Desktop Chrome'] },\n      dependencies: ['setup'],\n    },\n    {\n      name: 'firefox',\n      use: { ...devices['Desktop Firefox'] },\n      dependencies: ['setup'],\n    },\n    {\n      name: 'webkit',\n      use: { ...devices['Desktop Safari'] },\n      dependencies: ['setup'],\n    },\n    {\n      name: 'mobile-chrome',\n      use: { ...devices['Pixel 5'] },\n      dependencies: ['setup'],\n    },\n    {\n      name: 'mobile-safari',\n      use: { ...devices['iPhone 13'] },\n      dependencies: ['setup'],\n    },\n  ],\n  webServer: {\n    command: 'npm run dev',\n    url: 'http:\u002F\u002Flocalhost:3000',\n    reuseExistingServer: !process.env.CI,\n    timeout: 120_000,\n  },\n});\n```\n\n## Handling Common Scenarios\n\n### Navigation and Routing\n\n```typescript\ntest('should navigate through multi-step wizard', async ({ page }) => {\n  await page.goto('\u002Fwizard');\n\n  \u002F\u002F Step 1\n  await page.getByLabel('Full name').fill('Jane Doe');\n  await page.getByRole('button', { name: 'Next' }).click();\n\n  \u002F\u002F Step 2\n  await expect(page).toHaveURL('\u002Fwizard\u002Fstep-2');\n  await page.getByLabel('Email').fill('jane@example.com');\n  await page.getByRole('button', { name: 'Next' }).click();\n\n  \u002F\u002F Step 3 -- confirmation\n  await expect(page).toHaveURL('\u002Fwizard\u002Fstep-3');\n  await expect(page.getByText('Jane Doe')).toBeVisible();\n  await expect(page.getByText('jane@example.com')).toBeVisible();\n});\n```\n\n### Handling Dialogs\n\n```typescript\ntest('should handle confirmation dialog', async ({ page }) => {\n  page.on('dialog', async (dialog) => {\n    expect(dialog.type()).toBe('confirm');\n    expect(dialog.message()).toBe('Are you sure you want to delete?');\n    await dialog.accept();\n  });\n\n  await page.getByRole('button', { name: 'Delete' }).click();\n  await expect(page.getByText('Item deleted')).toBeVisible();\n});\n```\n\n### File Upload\n\n```typescript\ntest('should upload a file', async ({ page }) => {\n  const fileInput = page.getByLabel('Upload document');\n  await fileInput.setInputFiles('test-data\u002Fsample.pdf');\n  await expect(page.getByText('sample.pdf')).toBeVisible();\n  await page.getByRole('button', { name: 'Submit' }).click();\n  await expect(page.getByText('Upload successful')).toBeVisible();\n});\n```\n\n### Iframe Handling\n\n```typescript\ntest('should interact with iframe content', async ({ page }) => {\n  const iframe = page.frameLocator('#payment-iframe');\n  await iframe.getByLabel('Card number').fill('4111111111111111');\n  await iframe.getByLabel('Expiry').fill('12\u002F25');\n  await iframe.getByLabel('CVC').fill('123');\n});\n```\n\n### Network Interception\n\n```typescript\ntest('should mock API response', async ({ page }) => {\n  await page.route('**\u002Fapi\u002Fproducts', async (route) => {\n    await route.fulfill({\n      status: 200,\n      contentType: 'application\u002Fjson',\n      body: JSON.stringify([\n        { id: 1, name: 'Mocked Product', price: 9.99 },\n      ]),\n    });\n  });\n\n  await page.goto('\u002Fproducts');\n  await expect(page.getByText('Mocked Product')).toBeVisible();\n});\n\ntest('should wait for specific API call', async ({ page }) => {\n  const responsePromise = page.waitForResponse('**\u002Fapi\u002Fsubmit');\n  await page.getByRole('button', { name: 'Submit' }).click();\n  const response = await responsePromise;\n  expect(response.status()).toBe(200);\n});\n```\n\n### Handling Dropdowns and Select Elements\n\n```typescript\n\u002F\u002F Native select\nawait page.getByLabel('Country').selectOption('US');\nawait page.getByLabel('Country').selectOption({ label: 'United States' });\n\n\u002F\u002F Custom dropdown\nawait page.getByRole('combobox', { name: 'Country' }).click();\nawait page.getByRole('option', { name: 'United States' }).click();\n```\n\n## Best Practices\n\n1. **Never use `page.waitForTimeout()`** -- Use auto-waiting or explicit event waits instead.\n2. **Always use `test.describe` blocks** to group related tests.\n3. **Use `test.beforeEach`** for common setup, but keep it minimal.\n4. **Tag tests** for selective execution:\n   ```typescript\n   test('checkout flow @smoke @critical', async ({ page }) => { ... });\n   ```\n5. **Use soft assertions** for non-blocking checks:\n   ```typescript\n   await expect.soft(locator).toHaveText('expected');\n   await expect.soft(other).toBeVisible();\n   ```\n6. **Parameterize tests** with `test.describe` and arrays:\n   ```typescript\n   const users = [\n     { role: 'admin', canDelete: true },\n     { role: 'viewer', canDelete: false },\n   ];\n   for (const { role, canDelete } of users) {\n     test(`${role} delete permission`, async ({ page }) => { ... });\n   }\n   ```\n7. **Set reasonable timeouts** at the config level, not in individual tests.\n8. **Use trace viewer** for debugging: `npx playwright show-trace trace.zip`\n9. **Parallelize wisely** -- Use `fullyParallel: true` but ensure test isolation.\n10. **Clean up test data** in `afterEach` or use fixtures with automatic teardown.\n\n## Anti-Patterns to Avoid\n\n1. **Hardcoded waits** -- `await page.waitForTimeout(3000)` is flaky and slow.\n2. **Shared mutable state between tests** -- Each test must stand alone.\n3. **Testing implementation details** -- Test behavior, not DOM structure.\n4. **Overly specific selectors** -- `div.container > ul > li:nth-child(3) > span.text` breaks on any layout change.\n5. **Giant test files** -- Keep test files focused on a single feature or page.\n6. **Ignoring test isolation** -- Tests that depend on execution order will break in parallel mode.\n7. **Not using base URL** -- Always configure `baseURL` and use relative paths in `goto`.\n8. **Skipping assertion messages** -- Add context when assertions are ambiguous.\n9. **Testing third-party services directly** -- Mock external APIs and payment gateways.\n10. **Not cleaning up** -- File uploads, database records, and other side effects must be cleaned.\n\n## Debugging Tips\n\n- Run in headed mode: `npx playwright test --headed`\n- Run with UI mode: `npx playwright test --ui`\n- Debug a single test: `npx playwright test --debug tests\u002Flogin.spec.ts`\n- Generate code: `npx playwright codegen https:\u002F\u002Fexample.com`\n- View trace: `npx playwright show-trace test-results\u002Ftrace.zip`\n- Use `test.only` to isolate a single test during development.\n- Use `await page.pause()` to pause execution and inspect the page.\n","# Playwright E2E Testing Skill\n\nYou are an expert QA automation engineer specializing in Playwright end-to-end testing. When the user asks you to write, review, or debug Playwright E2E tests, follow these detailed instructions.\n\n## Core Principles\n\n1. **User-centric testing** -- Always write tests from the user's perspective. Tests should mirror real user journeys.\n2. **Resilient selectors** -- Prefer `getByRole`, `getByText`, `getByLabel`, `getByTestId` over CSS\u002FXPath selectors.\n3. **Auto-waiting** -- Leverage Playwright's built-in auto-waiting. Avoid explicit `waitForTimeout`.\n4. **Isolation** -- Each test must be independent. Never rely on state from a previous test.\n5. **Readability** -- Tests are documentation. Write them so a new team member can understand the intent.\n\n## Project Structure\n\nAlways organize Playwright projects with this structure:\n\n```\ntests\u002F\n  e2e\u002F\n    auth\u002F\n      login.spec.ts\n      signup.spec.ts\n    dashboard\u002F\n      dashboard.spec.ts\n    checkout\u002F\n      cart.spec.ts\n      payment.spec.ts\n  fixtures\u002F\n    auth.fixture.ts\n    db.fixture.ts\n  pages\u002F\n    login.page.ts\n    dashboard.page.ts\n    base.page.ts\n  utils\u002F\n    test-data.ts\n    helpers.ts\nplaywright.config.ts\n```\n\n## Page Object Model\n\nAlways implement the Page Object Model (POM). Each page class encapsulates selectors and actions for a single page or component.\n\n### Base Page Class\n\n```typescript\nimport { Page, Locator } from '@playwright\u002Ftest';\n\nexport abstract class BasePage {\n  readonly page: Page;\n\n  constructor(page: Page) {\n    this.page = page;\n  }\n\n  async navigate(path: string): Promise\u003Cvoid> {\n    await this.page.goto(path);\n  }\n\n  async waitForPageLoad(): Promise\u003Cvoid> {\n    await this.page.waitForLoadState('networkidle');\n  }\n\n  async getTitle(): Promise\u003Cstring> {\n    return this.page.title();\n  }\n\n  async takeScreenshot(name: string): Promise\u003CBuffer> {\n    return this.page.screenshot({ path: `screenshots\u002F${name}.png`, fullPage: true });\n  }\n}\n```\n\n### Concrete Page Class\n\n```typescript\nimport { Page, Locator, expect } from '@playwright\u002Ftest';\nimport { BasePage } from '.\u002Fbase.page';\n\nexport class LoginPage extends BasePage {\n  readonly emailInput: Locator;\n  readonly passwordInput: Locator;\n  readonly submitButton: Locator;\n  readonly errorMessage: Locator;\n  readonly forgotPasswordLink: Locator;\n\n  constructor(page: Page) {\n    super(page);\n    this.emailInput = page.getByLabel('Email');\n    this.passwordInput = page.getByLabel('Password');\n    this.submitButton = page.getByRole('button', { name: 'Sign in' });\n    this.errorMessage = page.getByRole('alert');\n    this.forgotPasswordLink = page.getByRole('link', { name: 'Forgot password?' });\n  }\n\n  async goto(): Promise\u003Cvoid> {\n    await this.navigate('\u002Flogin');\n  }\n\n  async login(email: string, password: string): Promise\u003Cvoid> {\n    await this.emailInput.fill(email);\n    await this.passwordInput.fill(password);\n    await this.submitButton.click();\n  }\n\n  async expectErrorMessage(message: string): Promise\u003Cvoid> {\n    await expect(this.errorMessage).toBeVisible();\n    await expect(this.errorMessage).toHaveText(message);\n  }\n}\n```\n\n## Writing Test Specs\n\n### Basic Test Structure\n\n```typescript\nimport { test, expect } from '@playwright\u002Ftest';\nimport { LoginPage } from '..\u002Fpages\u002Flogin.page';\n\ntest.describe('Login functionality', () => {\n  let loginPage: LoginPage;\n\n  test.beforeEach(async ({ page }) => {\n    loginPage = new LoginPage(page);\n    await loginPage.goto();\n  });\n\n  test('should login with valid credentials', async ({ page }) => {\n    await loginPage.login('user@example.com', 'SecurePass123!');\n    await expect(page).toHaveURL('\u002Fdashboard');\n    await expect(page.getByRole('heading', { name: 'Welcome' })).toBeVisible();\n  });\n\n  test('should show error for invalid credentials', async () => {\n    await loginPage.login('user@example.com', 'wrongpassword');\n    await loginPage.expectErrorMessage('Invalid email or password');\n  });\n\n  test('should navigate to forgot password page', async ({ page }) => {\n    await loginPage.forgotPasswordLink.click();\n    await expect(page).toHaveURL('\u002Fforgot-password');\n  });\n});\n```\n\n## Selectors -- Priority Order\n\nAlways choose selectors in this priority order:\n\n1. **`getByRole`** -- Preferred. Matches the accessibility tree.\n   ```typescript\n   page.getByRole('button', { name: 'Submit' });\n   page.getByRole('heading', { level: 1 });\n   page.getByRole('link', { name: 'Read more' });\n   page.getByRole('textbox', { name: 'Email' });\n   ```\n\n2. **`getByLabel`** -- For form inputs associated with labels.\n   ```typescript\n   page.getByLabel('Email address');\n   page.getByLabel('Password');\n   ```\n\n3. **`getByPlaceholder`** -- When there is no label.\n   ```typescript\n   page.getByPlaceholder('Search...');\n   ```\n\n4. **`getByText`** -- For non-interactive elements with visible text.\n   ```typescript\n   page.getByText('Welcome back');\n   page.getByText(\u002Ftotal: \\$\\d+\u002Fi);\n   ```\n\n5. **`getByTestId`** -- When semantic selectors are not feasible.\n   ```typescript\n   page.getByTestId('checkout-total');\n   ```\n\n6. **CSS\u002FXPath** -- Last resort only. Document why other options failed.\n   ```typescript\n   \u002F\u002F Avoid unless absolutely necessary\n   page.locator('.legacy-widget >> nth=0');\n   ```\n\n## Assertions\n\nUse Playwright's web-first assertions that auto-retry:\n\n```typescript\n\u002F\u002F Visibility\nawait expect(locator).toBeVisible();\nawait expect(locator).toBeHidden();\n\n\u002F\u002F Text content\nawait expect(locator).toHaveText('Expected text');\nawait expect(locator).toContainText('partial');\nawait expect(locator).toHaveText(\u002Fregex pattern\u002F);\n\n\u002F\u002F Input values\nawait expect(locator).toHaveValue('expected value');\nawait expect(locator).toBeChecked();\nawait expect(locator).toBeDisabled();\n\n\u002F\u002F Page-level\nawait expect(page).toHaveURL('\u002Fexpected-path');\nawait expect(page).toHaveURL(\u002F\\\u002Fusers\\\u002F\\d+\u002F);\nawait expect(page).toHaveTitle('Page Title');\n\n\u002F\u002F Count\nawait expect(page.getByRole('listitem')).toHaveCount(5);\n\n\u002F\u002F CSS\nawait expect(locator).toHaveCSS('color', 'rgb(255, 0, 0)');\nawait expect(locator).toHaveClass(\u002Factive\u002F);\n\n\u002F\u002F Screenshot comparison\nawait expect(page).toHaveScreenshot('homepage.png');\nawait expect(locator).toHaveScreenshot('button-hover.png');\n```\n\n## Fixtures\n\nUse custom fixtures to share setup logic and authenticated state:\n\n```typescript\nimport { test as base, Page } from '@playwright\u002Ftest';\nimport { LoginPage } from '..\u002Fpages\u002Flogin.page';\nimport { DashboardPage } from '..\u002Fpages\u002Fdashboard.page';\n\ntype MyFixtures = {\n  loginPage: LoginPage;\n  dashboardPage: DashboardPage;\n  authenticatedPage: Page;\n};\n\nexport const test = base.extend\u003CMyFixtures>({\n  loginPage: async ({ page }, use) => {\n    const loginPage = new LoginPage(page);\n    await loginPage.goto();\n    await use(loginPage);\n  },\n\n  dashboardPage: async ({ page }, use) => {\n    await use(new DashboardPage(page));\n  },\n\n  authenticatedPage: async ({ browser }, use) => {\n    const context = await browser.newContext({\n      storageState: 'playwright\u002F.auth\u002Fuser.json',\n    });\n    const page = await context.newPage();\n    await use(page);\n    await context.close();\n  },\n});\n\nexport { expect } from '@playwright\u002Ftest';\n```\n\n### Authentication State Reuse\n\n```typescript\n\u002F\u002F auth.setup.ts -- run once to store auth state\nimport { test as setup, expect } from '@playwright\u002Ftest';\n\nsetup('authenticate', async ({ page }) => {\n  await page.goto('\u002Flogin');\n  await page.getByLabel('Email').fill('admin@example.com');\n  await page.getByLabel('Password').fill('AdminPass123!');\n  await page.getByRole('button', { name: 'Sign in' }).click();\n  await expect(page).toHaveURL('\u002Fdashboard');\n  await page.context().storageState({ path: 'playwright\u002F.auth\u002Fuser.json' });\n});\n```\n\n## Configuration Best Practices\n\n```typescript\nimport { defineConfig, devices } from '@playwright\u002Ftest';\n\nexport default defineConfig({\n  testDir: '.\u002Ftests\u002Fe2e',\n  fullyParallel: true,\n  forbidOnly: !!process.env.CI,\n  retries: process.env.CI ? 2 : 0,\n  workers: process.env.CI ? 1 : undefined,\n  reporter: [\n    ['html', { open: 'never' }],\n    ['json', { outputFile: 'test-results\u002Fresults.json' }],\n    process.env.CI ? ['github'] : ['list'],\n  ],\n  use: {\n    baseURL: process.env.BASE_URL || 'http:\u002F\u002Flocalhost:3000',\n    trace: 'on-first-retry',\n    screenshot: 'only-on-failure',\n    video: 'retain-on-failure',\n    actionTimeout: 10_000,\n    navigationTimeout: 30_000,\n  },\n  projects: [\n    { name: 'setup', testMatch: \u002F.*\\.setup\\.ts\u002F },\n    {\n      name: 'chromium',\n      use: { ...devices['Desktop Chrome'] },\n      dependencies: ['setup'],\n    },\n    {\n      name: 'firefox',\n      use: { ...devices['Desktop Firefox'] },\n      dependencies: ['setup'],\n    },\n    {\n      name: 'webkit',\n      use: { ...devices['Desktop Safari'] },\n      dependencies: ['setup'],\n    },\n    {\n      name: 'mobile-chrome',\n      use: { ...devices['Pixel 5'] },\n      dependencies: ['setup'],\n    },\n    {\n      name: 'mobile-safari',\n      use: { ...devices['iPhone 13'] },\n      dependencies: ['setup'],\n    },\n  ],\n  webServer: {\n    command: 'npm run dev',\n    url: 'http:\u002F\u002Flocalhost:3000',\n    reuseExistingServer: !process.env.CI,\n    timeout: 120_000,\n  },\n});\n```\n\n## Handling Common Scenarios\n\n### Navigation and Routing\n\n```typescript\ntest('should navigate through multi-step wizard', async ({ page }) => {\n  await page.goto('\u002Fwizard');\n\n  \u002F\u002F Step 1\n  await page.getByLabel('Full name').fill('Jane Doe');\n  await page.getByRole('button', { name: 'Next' }).click();\n\n  \u002F\u002F Step 2\n  await expect(page).toHaveURL('\u002Fwizard\u002Fstep-2');\n  await page.getByLabel('Email').fill('jane@example.com');\n  await page.getByRole('button', { name: 'Next' }).click();\n\n  \u002F\u002F Step 3 -- confirmation\n  await expect(page).toHaveURL('\u002Fwizard\u002Fstep-3');\n  await expect(page.getByText('Jane Doe')).toBeVisible();\n  await expect(page.getByText('jane@example.com')).toBeVisible();\n});\n```\n\n### Handling Dialogs\n\n```typescript\ntest('should handle confirmation dialog', async ({ page }) => {\n  page.on('dialog', async (dialog) => {\n    expect(dialog.type()).toBe('confirm');\n    expect(dialog.message()).toBe('Are you sure you want to delete?');\n    await dialog.accept();\n  });\n\n  await page.getByRole('button', { name: 'Delete' }).click();\n  await expect(page.getByText('Item deleted')).toBeVisible();\n});\n```\n\n### File Upload\n\n```typescript\ntest('should upload a file', async ({ page }) => {\n  const fileInput = page.getByLabel('Upload document');\n  await fileInput.setInputFiles('test-data\u002Fsample.pdf');\n  await expect(page.getByText('sample.pdf')).toBeVisible();\n  await page.getByRole('button', { name: 'Submit' }).click();\n  await expect(page.getByText('Upload successful')).toBeVisible();\n});\n```\n\n### Iframe Handling\n\n```typescript\ntest('should interact with iframe content', async ({ page }) => {\n  const iframe = page.frameLocator('#payment-iframe');\n  await iframe.getByLabel('Card number').fill('4111111111111111');\n  await iframe.getByLabel('Expiry').fill('12\u002F25');\n  await iframe.getByLabel('CVC').fill('123');\n});\n```\n\n### Network Interception\n\n```typescript\ntest('should mock API response', async ({ page }) => {\n  await page.route('**\u002Fapi\u002Fproducts', async (route) => {\n    await route.fulfill({\n      status: 200,\n      contentType: 'application\u002Fjson',\n      body: JSON.stringify([\n        { id: 1, name: 'Mocked Product', price: 9.99 },\n      ]),\n    });\n  });\n\n  await page.goto('\u002Fproducts');\n  await expect(page.getByText('Mocked Product')).toBeVisible();\n});\n\ntest('should wait for specific API call', async ({ page }) => {\n  const responsePromise = page.waitForResponse('**\u002Fapi\u002Fsubmit');\n  await page.getByRole('button', { name: 'Submit' }).click();\n  const response = await responsePromise;\n  expect(response.status()).toBe(200);\n});\n```\n\n### Handling Dropdowns and Select Elements\n\n```typescript\n\u002F\u002F Native select\nawait page.getByLabel('Country').selectOption('US');\nawait page.getByLabel('Country').selectOption({ label: 'United States' });\n\n\u002F\u002F Custom dropdown\nawait page.getByRole('combobox', { name: 'Country' }).click();\nawait page.getByRole('option', { name: 'United States' }).click();\n```\n\n## Best Practices\n\n1. **Never use `page.waitForTimeout()`** -- Use auto-waiting or explicit event waits instead.\n2. **Always use `test.describe` blocks** to group related tests.\n3. **Use `test.beforeEach`** for common setup, but keep it minimal.\n4. **Tag tests** for selective execution:\n   ```typescript\n   test('checkout flow @smoke @critical', async ({ page }) => { ... });\n   ```\n5. **Use soft assertions** for non-blocking checks:\n   ```typescript\n   await expect.soft(locator).toHaveText('expected');\n   await expect.soft(other).toBeVisible();\n   ```\n6. **Parameterize tests** with `test.describe` and arrays:\n   ```typescript\n   const users = [\n     { role: 'admin', canDelete: true },\n     { role: 'viewer', canDelete: false },\n   ];\n   for (const { role, canDelete } of users) {\n     test(`${role} delete permission`, async ({ page }) => { ... });\n   }\n   ```\n7. **Set reasonable timeouts** at the config level, not in individual tests.\n8. **Use trace viewer** for debugging: `npx playwright show-trace trace.zip`\n9. **Parallelize wisely** -- Use `fullyParallel: true` but ensure test isolation.\n10. **Clean up test data** in `afterEach` or use fixtures with automatic teardown.\n\n## Anti-Patterns to Avoid\n\n1. **Hardcoded waits** -- `await page.waitForTimeout(3000)` is flaky and slow.\n2. **Shared mutable state between tests** -- Each test must stand alone.\n3. **Testing implementation details** -- Test behavior, not DOM structure.\n4. **Overly specific selectors** -- `div.container > ul > li:nth-child(3) > span.text` breaks on any layout change.\n5. **Giant test files** -- Keep test files focused on a single feature or page.\n6. **Ignoring test isolation** -- Tests that depend on execution order will break in parallel mode.\n7. **Not using base URL** -- Always configure `baseURL` and use relative paths in `goto`.\n8. **Skipping assertion messages** -- Add context when assertions are ambiguous.\n9. **Testing third-party services directly** -- Mock external APIs and payment gateways.\n10. **Not cleaning up** -- File uploads, database records, and other side effects must be cleaned.\n\n## Debugging Tips\n\n- Run in headed mode: `npx playwright test --headed`\n- Run with UI mode: `npx playwright test --ui`\n- Debug a single test: `npx playwright test --debug tests\u002Flogin.spec.ts`\n- Generate code: `npx playwright codegen https:\u002F\u002Fexample.com`\n- View trace: `npx playwright show-trace test-results\u002Ftrace.zip`\n- Use `test.only` to isolate a single test during development.\n- Use `await page.pause()` to pause execution and inspect the page.\n",{"name":5,"tags":24,"agents":31,"author":42,"domains":43,"license":15,"version":45,"languages":46,"frameworks":49,"description":7,"testingTypes":50},[25,26,27,28,29,30],"playwright","e2e","visual","web-testing","automation","browser-testing",[32,33,34,35,36,37,38,39,40,41],"claude-code","cursor","github-copilot","windsurf","codex","aider","continue","cline","zed","bolt","thetestingacademy",[44],"web","1.0.0",[47,48],"typescript","javascript",[25],[26,27],"main","eac438ea9216a7cb8a570cab803eb01eeafc6793","skills\u002Fqa\u002Fplaywright-e2e","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":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"Playwright E2E Testing\"",{"tool":65,"command":66},"bunx","bunx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"Playwright E2E Testing\"",{"tool":68,"command":69},"pnpm","pnpm dlx skills add GrupoANDevelopment-m\u002Falberto-ai --skill \"Playwright E2E Testing\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FGrupoANDevelopment-m\u002Falberto-ai\u002Fblob\u002Fmain\u002Fskills\u002Fqa\u002Fplaywright-e2e\u002FSKILL.md",true,[],[74,82,89,96,103,110],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"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":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"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":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"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":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"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":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"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":111,"name":112,"nameZh":6,"description":113,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"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",[],[]]