Questions tagged [spectron]

Spectron is a testing framework, built upon ChromeDriver and WebdriverIO, for end to end testing Electron applications.

Spectron is built by the Electron team to make end to end testing Electron apps easy. As of 2017 it's the only e2e testing framework with native support for Electron.

It's a wrapper around WebdriverIO which their API's is almost the same, except the additional Electron parts.

112 questions
8
votes
1 answer

Spectron with Jest to test basic window open not working

I am developing an Electron desktop app with React. Trying to setup testing for the electron side of code. I have a Launch.test.js file, where I am trying to test spectron with Jest. When I run the test file its throwing errors. Having trouble…
user10518298
  • 169
  • 1
  • 16
8
votes
3 answers

Spectron test leaves window open

I am using just the basic Spectron test file (in Typescript) to open my app, get the window count, and presumably exit. However, Spectron's app.stop() only seems to close the dev tools window and leaves the main window running. I've searched around…
siride
  • 200,666
  • 4
  • 41
  • 62
8
votes
2 answers

Do I have to use Spectron to test Electron?

Recently I found some difficulty to plan automation testing for our application using Electron. I've tried to use Spectron, which looks like the official framework to test Electron apps, however, I found the documentation was very hard to understand…
Zoe The Paranoid
  • 472
  • 5
  • 11
7
votes
1 answer

Spectron launches 10 windows; hangs and fails with Client initialization failed after 10 attempts

Electron v1.8.2 Spectron v3.8.0 Adding spectron tests, but even an extremely basic test fails. Attempting to run: const { Application } = require('spectron'); const app = new Application({ path:…
Andrew Tran
  • 273
  • 1
  • 7
7
votes
2 answers

Losing webdriverio session when testing electron app restart using spectron

I'm using spectron to run integration tests against my electron app. Everything is working fine apart from attempting to test that app settings are persisted properly between app restarts. While running tests, my app starts up with new temporary…
Tim
  • 7,746
  • 3
  • 49
  • 83
5
votes
1 answer

Problems with ChromeDriver when running test on GitlabCI

I'm new to Gitlab CI and I'm trying to automatically test my application on commits. I don't know how this works, I know it uses a docker image and it runs the commands you want. I picked the node:8 image to start (I am doing an electron project,…
IXTR Unai
  • 377
  • 2
  • 17
5
votes
0 answers

Using Spectron to "mock" Electron when testing with Jest

I'm testing library code for an Electron app with Jest. Jest does weird things to require, which is interfering with that Electron needs to do... I think. Spectron is meant to allow you to access the various Electron bits from within a test…
Narfanator
  • 5,595
  • 3
  • 39
  • 71
5
votes
2 answers

Make WebdriverIO wait for a specific component to reload

I am testing an Electron/React app using Spectron, which uses the WebdriverIO commands API. I would like to test the attributes on some components, but I want to be sure I am testing them only after the component has reloaded. The normal…
cham
  • 8,666
  • 9
  • 48
  • 69
5
votes
1 answer

Can I debug my electron app whilst testing it with Spectron?

I'm running tests using Spectron, mocha and chai-as-promised. My IDE is Visual Studio Code. I start the app from within the tests as follows: this.app = new Application({ path: electron, args: ['.'] }); // Then at some point I…
Mark Micallef
  • 1,051
  • 2
  • 12
  • 25
4
votes
3 answers

Incorrect NODE_MODULE_VERSION when using ava

I write an Electron app that uses nodegit. For my test part I use ava in combination with Spectron to test my app. All of my tests work - including functions which use nodegit in my app. In addition to the tests described above I made also a pure…
Daniel Stephens
  • 2,371
  • 8
  • 34
  • 86
4
votes
3 answers

Spectron opens Empty terminals during test run

During execution spectron opens two terminal windows that are blank. First window is the application as I wanted it to be, other windows look like terminals without anything inside. Currently i focus to the first window using focus(). Github issue…
4
votes
0 answers

Not managing to chain selectors with $ and $$ as documented in Webdriver-IO docs

I'm using Spectron's WebdriverIO which is at version 4.7.1 in node_modules. I'm trying to getText from an element but selecting it gradually is giving me trouble. I can "Copy -> selector" in dev tools to give me a very specific path. This works if I…
justin
  • 3,357
  • 1
  • 23
  • 28
4
votes
2 answers

Spectron test sequential actions

I am testing electron application with spectron. I have found in documentation examples on how to get number of windows and it is quite trivial. But what I am looking is how to check the state of one element after I have click on another element.…
eomeroff
  • 9,599
  • 30
  • 97
  • 138
3
votes
0 answers

How to write unit testcases for ElectronJs app using Jest Framweork?

I am trying to write unit test cases on window, ipcMain, and similar functionalities for Electron App using Jest. Can anyone guide how to proceed?
Sushma K
  • 31
  • 2
3
votes
1 answer

How to use code coverage in Electron app which uses Angular?

I write an Electron app (in TypeScript) that I test through AVA (in whose tests I use Spectron to communicate with the app). The (browser) content of my app is generated by using Angular. I execute the tests via: npm run ava All of this works…
Daniel Stephens
  • 2,371
  • 8
  • 34
  • 86
1
2 3 4 5 6 7 8