testing-library / cypress-testing-library

🐅 Simple and complete custom Cypress commands and utilities that encourage good testing practices.
http://npm.im/@testing-library/cypress
MIT License
1.8k stars 152 forks source link

should not exist does not work with findByRole #265

Open tam-R opened 10 months ago

tam-R commented 10 months ago

Relevant code or config

cy.findByRole('tab', {name: 'ForDeleteRegularRole'}).should('not.exist')

Problem description:

It seems that the should not exist assertion does not properly work for findByRole. It retried the assertion and returned an AssertionError in the end due to the element not being found.

Timed out retrying after 120000ms: Unable to find an accessible element with the role "tab" and name "ForDeleteRegularRole"

image image