如何使用 testcafe 重新加载当前页面? 我找到了
.eval(() => location.reload(true))
但它看起来像一个旧代码,当前的 TestCafe 不理解这一点。 (无功能错误)
最佳答案
这是重新加载测试页面的正确方法。 查看完整的测试示例:
import { Selector } from 'testcafe';
fixture `New Fixture`
.page ('https://devexpress.github.io/testcafe/example/');
test('New Test', async t => {
await t.typeText('#developer-name', 'Peter Parker');
await t.eval(() => location.reload(true));
await t
.wait(3000)
.expect(Selector('#developer-name').value).eql('');
});
关于testing - Testcafe 页面重新加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57851542/