Cypress: Test if element does not exist

前端 未结 7 2173
一个人的身影
一个人的身影 2020-12-09 14:42

I want to be able to click on a check box and test that an element is no longer in the DOM in Cypress. Can someone suggest how you do it?

//This is the Test          


        
7条回答
  •  没有蜡笔的小新
    2020-12-09 15:05

    Well this seems to work, so it tells me I have some more to learn about .should()

    cy.get('.check-box-sub-text').should('not.exist');
    

提交回复
热议问题