我遇到了无法正确加载testcafe的问题.它会启动testcafe服务并加载index.html文件,但该捆绑包永远不会加载,因此任何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-electron-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
最佳答案
原文链接:https://www.f2er.com/js/531191.html