简体   繁体   English

带有 Electron 的 TestCafe 抛出“Uncaught TypeError: Cannot read property 'source' of undefined”

[英]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:环境:

  • electron: "9.3.2," electron:“9.3.2,”
  • node: "12.18.2",节点:“12.18.2”,
  • testcafe: "1.9.4",测试咖啡厅:“1.9.4”,
  • testcafe-browser-provider-electron: "0.0.15" testcafe-browser-provider-electron:“0.0.15”
  • OS: Windows 10操作系统:Windows 10

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.

相关问题 未捕获的TypeError:无法读取未定义的属性'fn',电子2,角6? - Uncaught TypeError: Cannot read property 'fn' of undefined, electron 2, angular 6? 未捕获的类型错误:无法使用 Electron 更新程序代码读取未定义的属性“on” - Uncaught TypeError: Cannot read property 'on' of undefined with Electron updater code 未捕获的TypeError:无法读取未定义的属性“未定义” - Uncaught TypeError: Cannot read property 'undefined' of undefined 电子类型错误:无法读取未定义的属性“ normalizePath” - Electron TypeError: Cannot read property 'normalizePath' of undefined 未捕获的类型错误:无法读取未定义的属性“on”。 我也尝试重新安装电子 - Uncaught TypeError: Cannot read property 'on' of undefined. I have tried to reinstall electron as well 未捕获的TypeError:无法读取未定义的属性“数量” - Uncaught TypeError: Cannot read property 'quantity' of undefined 未捕获的TypeError:无法读取未定义的属性'fromJSON' - Uncaught TypeError: Cannot read property 'fromJSON' of undefined 未捕获的TypeError:无法读取未定义的属性“ timing” - Uncaught TypeError: Cannot read property 'timing' of undefined 未捕获的TypeError:无法读取未定义的属性'formatter' - Uncaught TypeError: Cannot read property 'formatter' of undefined Uncaught TypeError:无法读取未定义的属性“ stopVideo” - Uncaught TypeError: Cannot read property 'stopVideo' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM