/playwright-react-selector-fixture

Issue fixture: cannot match direct HTML element of React components

Primary LanguageJavaScript

Playwright React Selector Fixture

Steps to reproduce the bug:

  1. Clone this repository
git clone git@github.com:hanayashiki/playwright-react-selector-fixture.git
cd playwright-react-selector-fixture
  1. Install dependencies
yarn
  1. Leave the dev server running
yarn dev
  1. In another terminal, run
yarn playwright test
  1. Wait for timeout exceeded
    Test timeout of 30000ms exceeded.

    locator.waitFor: Target closed
    =========================== logs ===========================
    waiting for locator('_react=App').locator('div')
    ============================================================

       7 |   await page.goto("http://localhost:5174/");
       8 |
    >  9 |   await page.locator("_react=App >> div").waitFor({ state: "attached" });
         |                                           ^
      10 | });
      11 |