testing - 当第二个文件在 testcafe 中启动时 Fixture.page 不会改变
问题描述
我有多个 testcafe 文件,每个文件都有一个起始页面,同时运行所有文件时,Fixture.Page 不会更改第二个文件,它仍然采用第一个文件页面 url
//////// First fixture in the first file.
fixture('create-TestFixture1').disablePageReloads.page(PageObject.createNavigateUrl + '/TestFixture1')
.beforeEach(async t => {
await t
.maximizeWindow();
});
//////// First fixture in the second file.
fixture('create-TestFixture2').disablePageReloads.page(PageObject.createNavigateUrl + '/TestFixture2')
.beforeEach(async t => {
await t
.maximizeWindow();
});
*Both files are in the same folder, so when running testcafe for this folder, when the first file finished succesfully and the second file start , the fixture for second file doesn't update the page url, it redirects to " 'PageObject.createNavigateUrl + '/TestFixture1' " , not "'PageObject.createNavigateUrl + '/TestFixture2' ".
解决方案
该disablePageReloads
功能是无证的和实验性的。它可能会发生变化。目前,我没有看到这种多夹具情况的解决方法。您只能将两个disablePageReloads
固定装置分成两个 TestCafe 运行:testcafe fixture-1.js
和testcafe fixture-2.js
.
推荐阅读
- node.js - 如何在 Lightsail 实例中正确设置日志存储/管理?
- azure - CloudBlob.CopyState 在直接帐户到帐户复制完成后为空
- flutter - 在 fcm flutter 中处理通知
- react-native-android - 错误:无法从 E:\test\tryTwo\android\src\pages\tabIcons\tabIconManamement.js 解析模块 ./tabIcons/tab-icon1.png:
- javascript - Nuxt JS 中间件不能使用 axios
- macos - 每次都出现错误错误:在linkage.json上的权限被拒绝@rb_file_s_rename
- search - Lucene - Java - 根据不同的字段值对字段进行排序
- php - CDbConnection 无法打开数据库连接:在 yii1 的 D:\xampp\htdocs\ilmversity\framework\db\CDbConnection.php:382 中找不到驱动程序
- sql - 如何根据sql中一列的日期数据获取前三个月的数据?
- aws-glue - 如何创建一个 aws 胶水分类器来读取 json