赛普拉斯确认对话框 [英] Cypress confirmation dialog

查看:103
本文介绍了赛普拉斯确认对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的应用程序的一部分编写测试用例,其中涉及应用程序重新启动。
Durring应用程序重新启动窗口。出现确认对话框,必须重新启动应用程序。现在我在赛普拉斯中有一个模拟问题,所以我的问题是:



如何在赛普拉斯测试的窗口确认对话框中执行确定按钮操作? p>

谢谢!

解决方案

使用:

  cy.on('window:confirm',()=> true); 

引用:应用程序事件


I am writing test case for part of my app which covers application restart. Durring application restart window.confirmation dialog appears which has to be accepted in order to restart app. And now I have a problem to simulate this in Cypress, so my question is:

How to perform 'OK' button action in window confirmation dialog in Cypress test?

Thank you in advance!

解决方案

Use:

cy.on('window:confirm', () => true);

Refer: App Events

这篇关于赛普拉斯确认对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆