You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Following the documentation, I tried to write the following test
constmain=Selector('main[role="main"]');constdialog=Selector('div[role="dialog"]');signin=within(main).queryByText("Sign in");google=within(dialog).queryByText(/Google/i);test("user clicks the sign-in button",async(t)=>{awaitt.expect(google.exists).notOk("Modal should not be opened").takeScreenshot().click(signin).expect(google.exists).ok("Modal is opened").takeScreenshot();}
When running tests, I get the following error pointing on the notOk line
1) An error occurred in Selector code: TypeError: Expected container to be an Element, a Document or a DocumentFragment but got undefined.
And when trying to console.log the value of await googe.exists, I get
ERROR Cannot prepare tests due to the following error:Error: TypeScript compilation failed./path/to/e2e/signin.ts (7, 27): Property 'exists' does not exist on type 'NodeSnapshot'.
Expected behavior
I thought from reading the examples that @testing-library/testcafe queries would return a TestCafe Selector object, making properties like exists available.
Here's a working test without using testing-library
constmain=Selector('main[role="main"]');constdialog=Selector('div[role="dialog"]');constsignin=main.find("button").withText("Sign in");constgoogle=dialog.find("button").withText("Google");awaitt.expect(google.exists).notOk("Modal should not be opened").takeScreenshot().click(signin).expect(google.exists).ok("Modal is opened").takeScreenshot();
The text was updated successfully, but these errors were encountered:
Describe the bug
Following the documentation, I tried to write the following test
When running tests, I get the following error pointing on the
notOk
lineAnd when trying to console.log the value of
await googe.exists
, I getExpected behavior
I thought from reading the examples that
@testing-library/testcafe
queries would return a TestCafeSelector
object, making properties likeexists
available.Here's a working test without using testing-library
The text was updated successfully, but these errors were encountered: