有人有 TestCafe、Firebase 和 TestCafe 角色一起工作吗?

Anyone have TestCafe, Firebase and TestCafe Roles working together?

TestCafe、Firebase、角色似乎无法协同工作。

当使用基于 Firebase 的站点时,以下 TestCafe 测试似乎失去了 Role 状态。 (它使用 Google 的 Firebase 演示现场)。

我有一个更大的专有示例,其中基本测试适用于旧版本的 Firebase,但仅更改为较新版本会导致测试中断(退出 useRole 后丢失状态),所以我怀疑某种原因TestCafe、Roles 和 Firebase 之间的不兼容性,但无法弄清楚发生了什么....

有人成功地让最新版本的 Firebase 和 TestCafe 与 Roles 一起使用吗?

(我在这里也创建了一个 github issue:https://github.com/DevExpress/testcafe/issues/4939)

import { Selector, Role } from 'testcafe'; const ackTerms = Selector('span.mdl-checkbox__tick-outline'); const checkBox = Selector('.mdl-checkbox.is-checked'); const role1 = Role('https://friendly-pix.com/', async t => { await t .expect(checkBox.count).eql(0) .click(ackTerms) .expect(checkBox.count).eql(1) //on .click(ackTerms) .expect(checkBox.count).eql(0) // off .click(ackTerms) .expect(checkBox.count).eql(1); // on, when we exit Role creation. // at this point the check box is checked. }, {preserveUrl: true}); fixture `Friendly Pix test` .page `https://friendly-pix.com/`; test('Roles test', async t => { await t .wait(5000) // just let everything settle down. .useRole(role1) // when useRole is done, the check box should be still checked, however when you get to this breakpoint it will not be. .expect(checkBox.count).eql(1) // but clicking still works...if you remove the above assertion. .click(ackTerms) //off .click(ackTerms); //on });

详见this评论。