Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to find hidden element or not-find element? #314

Open
chmich opened this issue Nov 20, 2024 · 1 comment
Open

How to find hidden element or not-find element? #314

chmich opened this issue Nov 20, 2024 · 1 comment
Labels
question Further information is requested

Comments

@chmich
Copy link

chmich commented Nov 20, 2024

Usecase / What to achieve

In Capybara, i could do things like:

expect(page).not_to have_selector('#any-id')

Question

How is this done in playwright-DSL?

Many Thanks,
Chris

@chmich chmich added the question Further information is requested label Nov 20, 2024
@topherfangio
Copy link

@chmich Not sure if you still need this, but here is how we solved this particular case:

it "does not render something" do
  expect(page.locator('[data-cy="some-thing"]')).not_to be_attached
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants