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);
}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4