gpt4 book ai didi

javascript - TestCafe,带有 Electron 抛出的 “Uncaught TypeError: Cannot read property '源未定义”

转载 作者:行者123 更新时间:2023-12-03 12:23:57 26 4
gpt4 key购买 nike

问题
当我使用testcafe-electron-browser-provider插件运行TestCafe且测试卡在“加载网页”上时,在devtools中出现以下错误。Uncaught TypeError: Cannot read property 'source' of undefined是否有人看到过此问题或知道如何解决?
环境:

  • electronic:“9.3.2,”
  • 节点:“12.18.2”,
  • testcafe:“1.9.4”,
  • testcafe-browser-provider-electron:“0.0.15”
  • 操作系统:Windows 10

  • 截图:
  • Screenshot - TestCafe with Electron Stuck on loading page
  • Screenshot - Project Structure

  • 代码段
    错误:
    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
    我的testcafe配置文件:
    module.exports = {
    src: '/test/specs/e2etest.js',
    mainWindowUrl: './build/index.html',
    appPath: './',
    };
    我的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']");
    });

    最佳答案

    在测试执行期间使用浏览器的开发工具时,可能会导致错误。这是一个已知问题,在TestCafe documentation中进行了描述。

    关于javascript - TestCafe,带有 Electron 抛出的 “Uncaught TypeError: Cannot read property '源未定义”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64820662/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com