Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是柏树的新手,我正在学习它。
我想确认在单击提交按钮并登陆感谢页面后,我已经登陆了“谢谢”页面。
如何使用 cypress 进行检查。
谁能帮我解决这个问题。
提前致谢。感谢你的帮助。
因此,首先,您需要触发重定向到您没有描述重定向方式的“感谢页面”(单击或直接打开此页面)。
最简单的方法是验证此页面的唯一元素是否可见,例如:
cy.get(*selector_unique_for_this_page*).should('be.visible')
另一种方法是检查 url cy.url().should('include', 'thank-you.html');
cy.url().should('include', 'thank-you.html');
或者您也可以通过以下方式验证页面标题:
cy.title().should('eq', 'Thank you page')