【发布时间】:2018-12-06 18:04:27
【问题描述】:
我已经尝试了各种方法,但我无法让 TestCafe 等待从元素中删除 disabled 属性。
这显然会阻止所有进一步的测试,因为我需要按钮可以点击才能继续流程。
fixture('create').page('locahost:3000');
test('one', async => {
const myIframe = Selector('#myIframe');
await t
.typeText('#input', 'words')
.click('#update')
.expect(myIframe.exists).ok('', { timeout: 10000 })
.switchToIframe(myIframe)
const activeStartButton = await Selector('#start').withAttribute('disabled');
await t
.expect(activeStartButton).notOk('', { timeout: 60000, allowUnawaitedPromise: true });
});
不管我是提前定义了activeStartButton,还是在定义中添加或删除了await,直接把选择器放在expect里面有没有await,把这个await block from the previous one or add it to the previous chain, TestCafe immediately throws an error atexpect(activeStartButton).notOk分开`
错误因我的方法而异,但对于此代码:
AssertionError: start button remains disabled: expected [Function: __$$clientFunction$$] to be falsy"
【问题讨论】:
标签: automated-tests timeout e2e-testing web-testing testcafe