[英]TestCafe with Electron throwing "Uncaught TypeError: Cannot read property 'source' of undefined"
Problem问题
I am getting the following error in devtools when I run TestCafe with the testcafe-electron-browser-provider plugin and the test is stuck on "Loading Webpage".当我使用 testcafe-electron-browser-provider 插件运行 TestCafe 并且测试卡在“正在加载网页”时,我在 devtools 中收到以下错误。
Uncaught TypeError: Cannot read property 'source' of undefined
Anyone seen this issue or know how it can be resolved?任何人看到这个问题或知道如何解决它?
Environment:环境:
Screenshots:截图:
Code Snippets代码片段
Error:错误:
backend.js:5206 Uncaught TypeError: Cannot read property 'source' of undefined
at e (backend.js:5206)
at l (hammerhead.js:15)
at t.r._onWindowMessage (hammerhead.js:7)
at n (hammerhead.js:15)
at i (hammerhead.js:8)
at hammerhead.js:7
My testcafe config file:我的 testcafe 配置文件:
module.exports = {
src: '/test/specs/e2etest.js',
mainWindowUrl: './build/index.html',
appPath: './',
};
My e2etest.js file:我的 e2etest.js 文件:
import { Selector } from 'testcafe';
fixture `TestCafe Electron Trial`
.page('../../build/index.html');
test('check title', async (t) => {
await t.expect(Selector('title').innerText).eql('Electron Application');
});
test.skip('open file menu open project', async (t) => {
await t.click("[data-test-id='fileControls-fileMenu']");
await t.click(Selector('span').withText('Open project'));
await t.click("[data-test-id='openFileDialog-browse']");
});
Browser's Development Tools can cause errors when you use them during test execution.在测试执行期间使用浏览器的开发工具可能会导致错误。 It's a known issue, and it is described at TestCafe documentation .
这是一个已知问题,在TestCafe 文档中进行了描述。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.