1
votes

When my electron-app starts, it will do some initial action like 'checking config or checking status', after initial done it will redirect to a new path. I think the http 304 status-code causes this error:

Error: The main window page at file:///E:/code/electron_ct/public/app.html was not loaded. Use the mainWindowUrl option to specify one of the following pages as the main window page: file:///E:/code/electron_ct/public/app.html#/signin

I'd appreciate it if you can give me any advice.

1

1 Answers

2
votes

TestCafe expects that the mainWindowUrl property that you set in your .testcafe-electron-rc file will have an exact match with a URL that your Electron app loads when starting up. Anchors (like #signin) are required to be the same too.

The error message highlights that your app tries to open file:///E:/code/electron_ct/public/app.html while mainWindowUrl is configured to file:///E:/code/electron_ct/public/app.html#/signin. You should append /#signin to the mainWindowUrl's value.