Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Automated tests 柏树确认对话框_Automated Tests_Cypress - Fatal编程技术网

Automated tests 柏树确认对话框

Automated tests 柏树确认对话框,automated-tests,cypress,Automated Tests,Cypress,我正在为我的部分应用程序编写一个测试用例,其中包括应用程序重启。 在应用程序重新启动窗口期间,出现确认对话框,必须接受该对话框才能重新启动应用程序。现在我在Cypress中模拟这个问题,所以我的问题是: 如何在Cypress测试的窗口确认对话框中执行OK按钮操作 提前谢谢你 使用: cy.on('window:confirm', () => true); 参考:

我正在为我的部分应用程序编写一个测试用例,其中包括应用程序重启。 在应用程序重新启动窗口期间,出现确认对话框,必须接受该对话框才能重新启动应用程序。现在我在Cypress中模拟这个问题,所以我的问题是:

如何在Cypress测试的窗口确认对话框中执行
OK
按钮操作

提前谢谢你

使用:

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