标签: testing automation e2e-testing page-refresh testcafe
重新加载的常见常识是使用await t.eval(() => location.reload(true));。
await t.eval(() => location.reload(true));
但是,使用这种方法,如果使用夹具钩安装了任何东西(例如testcafe-testing-library),则一旦重新加载页面后,该页面将不再可用。
testcafe-testing-library
有什么办法可以重新执行夹具挂钩?
提出了相关的GitHub问题https://github.com/testing-library/testcafe-testing-library/issues/28
答案 0 :(得分:2)
请使用the new TestCafe feature将客户端脚本注入测试页,即使重新加载后,您的脚本仍然可用。