webdriverio-testing-library
webdriverio-testing-library copied to clipboard
Create elementToNotBeVisible
- Should loop through and if element is visible, keep trying again.
- Should fail if element persists to be visible
- Passes when promise is ultimately rejected and element is not visible
const expectTitleNotExists = async (screen, title) => { try { await screen.findByText(title, {}, { timeout: 100 }) expect(false).toBeTruthy() } catch { expect(true).toBeTruthy() } }