簡體   English   中英

測試咖啡館+電子+創建反應應用程序沒有正確加載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

我按照本指南創建了一個示例React + Electron項目,並沒有遇到TestCafe集成的任何問題。

我只能假設配置中存在錯誤,所以如果您向我們提供您的項目,我將非常感激。 在這種情況下,我將能夠詳細研究這個問題。 請使用以下表單在GitHub上創建單獨的問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM