-
Notifications
You must be signed in to change notification settings - Fork 9
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
selector resolved to hidden error #521
Comments
It looks like you're attempting to click on the SVG
In this case, ideally, you'd instead be querying for the native checkbox control using an accessible label, like so: const header = await this.screen.findByTestId('erow-GroupCode-0');
const check = this.within(header).getByRole("checkbox");
await check.click(); Once you're reviewed that, if you're still having this kind of problem, it's really an issue with how you're using Playwright, and it has nothing to do with Playwright Testing Library. I suggest you try to debug your tests using Playwright's robust debugging capabilities before opening an issue here: |
SVG const check = this.within(header).getByText("check") meanwhile i will try this and keep you posted using getByRole() const header = await this.screen.findByTestId('erow-GroupCode-0'); await check.click(); |
The ✅ Query + click SVG using
playwright-testing-library/test/fixture/locators.test.ts Lines 122 to 128 in d5a665b
❌ Query + click playwright-testing-library/test/fixture/locators.test.ts Lines 130 to 139 in d5a665b
Markupplaywright-testing-library/test/fixtures/page.html Lines 30 to 38 in d5a665b
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
while trying to click the checkbox using the following test, it fails with the following error: selector resolved to hidden <title>check</title>
async checkActiveStatusdom(text) {
const header = await this.screen.findByTestId('erow-GroupCode-0');
console.log(" header" + header)
const base = this.within(header).getByText("LINEHOLDER")
console.log("base value" + base);
const check = this.within(header).getByText("check")
console.log(" value " + check)
await expect(base).toContainText(text);
console.log("text assertion successful")
await check.click(); ---> fails
}
output:
headerLocator@query-by-test-id=["erow-GroupCode-0"]
base valueLocator@query-by-test-id=["erow-GroupCode-0"] >> get-by-text=["LINEHOLDER"]
value Locator@query-by-test-id=["erow-GroupCode-0"] >> get-by-text=["check"]
text assertion successful
The text was updated successfully, but these errors were encountered: