[英]React & Webpack: Loading failed for the <script> with source http://localhost:8080/app/bundle.js
[英]test cafe + electron + create-react-app not loading bundle.js properly
我遇到了一個無法正確加載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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.