-
Notifications
You must be signed in to change notification settings - Fork 466
Closed
Labels
bugSomething isn't workingSomething isn't workingdocumentationAn update needs to be made to documentationAn update needs to be made to documentationhelp wantedExtra attention is neededExtra attention is needed
Description
I am getting this error when trying to screen2.debug(screen2.getAllByText(/edit/i));
1) TypeError: For queries bound to document.body a global document has
to be available... Learn more:
https://testing-library.com/s/screen-global-error
For reference my code:
import { Selector, t } from 'testcafe';
import { screen } from '@testing-library/testcafe';
import { screen as screen2 } from '@testing-library/dom';
const emailInput = screen.getByRole('textbox', { name: /email/i });
const passwordInput = screen.getByPlaceholderText(/password/i);
export const editTaskButtons = screen.queryAllByText(/edit/i);
export const editTaskButtons2 = screen.getAllByText(/edit/i);
export const emailErrorMessage = Selector('div')
.child('.q-field__messages')
.child('div')
.withText('Please enter a valid email address.');
export const loginButton = Selector('#loginButton');
export const logoutButton = Selector('#logoutButton');
export async function clickOnEdit(number) {
screen2.debug(screen2.getAllByText(/edit/i));
const editTaskButton = editTaskButtons[number];
const editTaskButton1 = editTaskButtons2[number];
const editTaskButton2 = screen.findAllByTestId(/editBtn/i);
await t.click(editTaskButton);
}
nickserv
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingdocumentationAn update needs to be made to documentationAn update needs to be made to documentationhelp wantedExtra attention is neededExtra attention is needed