0

If I have the cypress code:

cy.get('[testid="cancel-button"]').should('not.exist')
cy.get('[testid="reset-button"]').should('not.exist')
cy.get('[testid="other-button"]').should('not.exist')

of course in cypress open I can see the cy.get(XXX) criteria (in my case, the testid attribute) in the log, but for cypress run the HTML log only outputs:

Expected <button.bp3-button> not to exist in the DOM, but it was continuously found.

How is this helpful at all? I will have no way of knowing which one failed because all I see is <button.bp3-button>. I want to see the testid attribute in the cy.get() call. Is there any way to get the cy.get(XXX) criteria to be where <button.bp3-button> is in the failure log?

  • I think the log is pretty clear, it says the element `` was supposed to not exist, but cypress found it. Also with the error message, cypress points to the line of code where the error occurred. Can you elaborate a bit, what exactly you are looking for? – Alapan Das Sep 17 '21 at 17:31
  • I will edit the code in my question to better outline why this is a problem – blake.vandercar Sep 17 '21 at 18:44

0 Answers0