【发布时间】:2021-09-14 15:10:06
【问题描述】:
我尝试在 TestCafe 中使用 oncePerFixture 功能并收到错误:
“TypeError:无法读取未定义的属性“testRun”。
我不知道是什么问题?
【问题讨论】:
-
我的代码:从'../../Commons/API/AdminEventPortalApiUtils'导入EventAPI;从“testcafe-once-hook”导入 { oncePerFixture }; const cleanDB = oncePerFixture(async t => { if (!TcUtils.isProduction()) { await EventAPI.deleteQaTestEvents(); } });夹具
Clubs - Club Home Page... .afterEach(async t => { if (!TcUtils.isProduction()) { cleanDB(); } }); -
From Page Model async deleteQaTestEvents() { if (TcUtils.isProduction()) { throw Error('ERROR: ClubApiUtil should not be used in production.'); } 让结果 = 等待 this.findEventByTag('qatestevent'); for(let i = 0 ; i
标签: testing automation automated-tests e2e-testing testcafe