// I am trying this in the tests of this library to ensure the issue is not related to our project
// webdriverio-testing-library/test/async/configure.e2e.ts
it('getElementError', async () => {
configure({
getElementError: (message, container) => {
const customMessage = 'my custom message';
return new Error(customMessage)
},
})
const {getByRole} = setupBrowser(browser)
await getByRole('button', {name: 'no such name'});
})
However, I am not seeing 'my custom message' displayed when the test fails with an element not found error.
Am I doing something incorrectly, or this option is not supported yet?
Hello 👋
If the testing-library is unable to find an element using getByRole or any other method, a lengthy stacktrace is generated when the test fails.
I attempted to configure the getElementError for a custom message as per the documentation: https://testing-library.com/docs/dom-testing-library/api-configuration/#getelementerror
However, I am not seeing 'my custom message' displayed when the test fails with an element not found error. Am I doing something incorrectly, or this option is not supported yet?