标签: cypress
例如,如果用户未填写此字段并按“继续”按钮,则会弹出此错误消息。 我想知道赛普拉斯是否有办法检查错误消息是否显示?
亲切的问候
enter image description here
答案 0 :(得分:1)
您可以声明以下内容:cy.get('input:invalid').should('have.length', 1) 请参见https://github.com/cypress-io/cypress-documentation/pull/1919/files如何声明验证消息
cy.get('input:invalid').should('have.length', 1)