Open agirorn opened 5 years ago
@codebytere can you help with that?
There are PRs in progress already to this end: https://github.com/electron/spectron/pull/361 https://github.com/electron/spectron/pull/364.
Even with those PRs merged and released, it still doesn't work with Electron 5: https://github.com/electron-userland/spectron/issues/254#issuecomment-489574565
/Users/sindresorhus/dev/oss/electron-serve/node_modules/spectron/lib/application.js:230
Rejected promise returned by test. Reason:
TypeError {
message: 'waitUntilWindowLoaded Cannot read property \'isLoading\' of undefined',
}
const app = new Application({
path: electron,
args: ['fixture.js']
});
await app.start();
const {client} = app;
await client.waitUntilWindowLoaded();
await client.waitUntilTextExists('h1', '🦄', 5000);
Hi,
I was able to solve this issue by following this: https://github.com/electron-userland/spectron/issues/174
Here is a working sample with Electron 6 https://github.com/florin05/electron-spectron-example. See the last commit for changes to support Electron upgrade.
Hi @florin05 ,After the completion of test, application isn't terminating. We've tried different ways to stop the application by keeping stop(), quit(), process.kill(), process.exit(0). However none of them worked to terminate the console after all the actions has been done.
@prathyu1616 , I don't see other windows open after test finishes, only the console that invoked the tests
npm run test
> electron-spectron-example@1.0.0 test .....\electron-spectron-example
> node ./node_modules/mocha/bin/_mocha
Sample Test
√ opens a window
√ should get a url (596ms)
√ should search (3718ms)
3 passing (17s)
Now that Electron 5.00 is out, are there any plans to make spectron also support that version? Maybe it is a tall order since Electron 4 does not seem to be fully supported #346. At least what I have noticed is that Spectron is very tightly connected to electron@3.0.5 and all the tests are being run on that version.
When I upgrade the devDependencies version to 4.1.5 or 5.0.0, then a lot of tests brake.