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.

123 questions
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
  • 412
  • 5
  • 11
7
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
  • 91
  • 11
7
votes
2 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
  • 165,323
  • 4
  • 31
  • 54
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
  • 274
  • 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
  • 6,485
  • 2
  • 42
  • 81
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
  • 1
  • 16
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,041
  • 2
  • 10
  • 25
4
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
  • 4,951
  • 3
  • 32
  • 57
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
  • 8,865
  • 28
  • 87
  • 127
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
0 answers

How can I apply babel config ahead of an electron app's main.js, when using Spectron?

I'm using jest to run a test script that starts an Electron application using Spectron. What is the correct way to load my babel configuration? Normally I start the app like this: npx electron -r @babel/register . (npm start in package.json) My test…
davemfish
  • 133
  • 1
  • 8
3
votes
3 answers

simple example of electron app with spectron test

I am trying to learn how to test apps, build with electron, using spectron. for this I took an example application from the web with a simple header, counter label, and incrementer button. I use mocha as a test runnen. The test should launch the…
wallage
  • 73
  • 6
3
votes
1 answer

How to access client window javascript global variable with Spectron

I'm trying test of Electron app with Spectron. But I can't test client window javascript global variable. Here is my simplified code. Please help me. Thanks. index.html
3
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…
3
votes
1 answer

Linking selenium with electron framework (c#)

I've already written few lines of code in C# using Selenium webdriver. As my application was transferred to the Electron framework everything has changed and honestly, I don't know how to cope with it right now. Could you please clarify it to me?…
Ixi11
  • 219
  • 2
  • 11
1
2 3
8 9