测试咖啡馆+电子+创建反应应用程序没有正确加载bundle.js

问题描述 投票:3回答:1

我遇到了一个无法正确加载testcafe的问题。它启动testcafe服务并加载index.html文件,但是bundle从不加载,因此任何DOM选择都会失败,因为它不可用。

因为create-react-app,我们从示例中获得了不同的文件夹结构,我不想偏离它。

文件夹结构

|-_e2eTest
|--...testFiles
|-build
|-public
|--index.html
|-src
|--index.js
|--electron-starter.js
|-.testcafe-electron-rc
|-package.json

的package.json

{
...
  "main": "./src/electron-starter.js",
  "scripts": {
    ...
    "testcafe": "testcafe electron:. ./_e2eTest/**/*.js"
    ...
  }
}

.testcafe电子-RC

{
  "mainWindowUrl": "./build/index.html", // works similarly with "./public/index.html"
  "appPath": "./"
}

链接供参考

https://github.com/DevExpress/testcafe-browser-provider-electron

https://github.com/DevExpress/testcafe-browser-provider-electron/issues/25

https://github.com/DevExpress/testcafe-browser-provider-electron/issues/30

javascript electron create-react-app e2e-testing testcafe
1个回答
2
投票

我在此guide之后创建了一个示例React + Electron项目,并且没有遇到TestCafe集成的任何问题。

我只能假设配置中存在错误,所以如果您向我们提供您的项目,我将非常感激。在这种情况下,我将能够详细研究这个问题。请使用以下form在GitHub上创建单独的问题

© www.soinside.com 2019 - 2024. All rights reserved.