expect-playwright icon indicating copy to clipboard operation
expect-playwright copied to clipboard

Q: using toHaveSelector

Open basz opened this issue 3 years ago • 1 comments

This fails

await expect(page).toHaveSelector('div.ember-cli-notifications-notification__container');

where this passes

await expect(page).toHaveSelector('div#content-wrapper');

are selector's something other then CSS selectors? Or perhaps I expect different behavior?

I am certain a div.ember-cli-notifications-notification__container exists on my page

<div class="ember-cli-notifications-notification__container ember-cli-notifications-notification__container--bottom-right" style="z-index: 1060;" data-test-notification-container="bottom-right">
<!----></div>
<div id="content-wrapper" class="min-100h d-flex flex-column flex-nowrap"></div>

basz avatar Mar 20 '22 15:03 basz

Selectors are Playwright selectors: https://playwright.dev/docs/selectors

We btw. recommend migrating to Playwright Test, since they have now all of these matchers included by default.

mxschmitt avatar Mar 21 '22 10:03 mxschmitt