简体   繁体   English

每当“it”块中发生错误或异常时,“after”钩子中的单击事件在“Cypress”中不起作用

[英]Click event in "after" hook doesn't work in "Cypress" whenever there is error or exception that occurs in "it" block

I am trying to logout an application by clicking the SignOut button written in "after" block of Cypress.我试图通过单击写在赛普拉斯“之后”块中的 SignOut 按钮来注销应用程序。 The SignOut button is getting clicked whenever there is no error or exception in the "it" block (logging into the application and performing the action is written in the "it" block) but the button can`t be clicked when errors or exceptions occur (button's visibility can be checked in after block but unable to click).只要“it”块中没有错误或异常(登录到应用程序并执行操作写在“it”块中),就会单击 SignOut 按钮,但发生错误或异常时无法单击该按钮(按钮的可见性可以在块后签入但无法单击)。

Current behavior: Any click event in the after block fails if one of the performing action fails in the "it" block in Cypress.当前行为:如果在赛普拉斯的“it”块中执行操作之一失败,则 after 块中的任何单击事件都会失败。

Desired behavior: Click events in the after block should succeed even if there are failure in the "it" block.期望的行为:即使“it”块中出现故障,after 块中的单击事件也应该成功。

This is a known bug in Cypress.这是 Cypress 中的一个已知错误。 You can find the bug report here .您可以在此处找到错误报告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM