3

I'm running into an issue where I cannot get testcafe to load properly. It starts the testcafe service and loads the index.html file but the bundle never loads so any DOM selection fails as it is not available.

because of create-react-app, we've got a varied folder structure from the examples that I would like not to deviate from.

folder structure

|-_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": "./"
}

links for reference

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

Caleb Swank
  • 619
  • 5
  • 17

1 Answers1

2

I created a sample React+Electron project following this guide and didn't face any issue with TestCafe integration.

I can only suppose that there is an error somewhere in configuration, so I'll appreciate it if you provide us with your project. In this case, I'll be able to research the issue in detail. Please create a separate issue on GitHub using the following form

Alex Kamaev
  • 6,198
  • 1
  • 14
  • 29
  • 1
    Hey Alex, Thank you for the response. That is the way we have our project setup as well. Not sure where the deviation is. I will strip out some proprietary code and upload an issue to that form. Thanks again – Caleb Swank Mar 05 '19 at 15:10
  • 1
    anyone else running into similar issues, please see https://github.com/DevExpress/testcafe/issues/3533 for a resolution. – Caleb Swank Mar 06 '19 at 15:46