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
0
votes
1 answer

Is there a way to reuse a specific test case ( it block ) from a describe block in mocha framework ( using javascript )

I m fairly new to mocha framework , I would like to know if we can reuse a test case from a particular describe block. For example //Test.js describe("Reuse code here" , function(){ it("Want to reuse this test case " , function () { //do some…
Monica Raj
  • 13
  • 3
0
votes
1 answer

Can't iterate through multiple selector ($$, findElements) webdriver.io

I'm trying to use webdriver.io (https://webdriver.io/) with spectron for an electron application. I'm able to access functions that findElement or $ contain. For example, I can use the .click() on this findElement ($)…
0
votes
0 answers

How can mock Date() in renderer process with spectron?

I tried @sinonjs/fake-timers like following to mock Date(). // main process loginWindow = new BrowserWindow({ width: 500, height: 400, }) loginWindow.fakeTimers = require('@sinonjs/fake-timers'); // E2E testing with spectron and jest const app…
graboros
  • 5
  • 2
0
votes
0 answers

spectron does not close electron app properly

I have a problem with my 140+ Test cases. The Electron App does not close properly. I have in a utility class where I log in to the app the following method to close the electron app. public async closeApp(){ if (await this.app.isRunning()) { …
FarFarAway
  • 696
  • 1
  • 9
  • 26
0
votes
1 answer

how to add 'global wait' to mocha test

I'm trying to test my electron app with spectron and mocha;my application will close the first window after user login,so i need add some "wait action" to wait the second window to appear. But it seems setTimeout's callback works abnormal.
1500mph
  • 11
  • 1
0
votes
1 answer

How can I `await` closing of window in Spectron?

I'm working on Electron application that handles some logic in modal windows. Those windows are waiting for async actions to resolve and then self-close. Now I am struggling to test this behaviour using Spectron and Jest: seems that there are no…
Elagin Vladislav
  • 119
  • 1
  • 10
0
votes
1 answer

Spectron available methods doesn't work properly

I'm using spectron on webdriverIO and try to avoid client.pause() method to wait and used client.waitForExist, waitForWindowLoading, waitUnitlText but the application closes very quick and I don't want to pass the implicit wait can someone guide me…
0
votes
2 answers

Use Spectron or selenium test electron based application, start Electron from cmd need pass parameter, how to pass parameters?

I have electron based application need to automate, but start exe need to pass parameter, how to pass parameters when use spectron or selenium to do the automation? Here is the cmd to start Electron: Electron.exe --manifest …
0
votes
1 answer

Spectron: how to test Electron `shell.openExternal('some url')`

I'm writing and E2E test for an application written in Electron. I need to test a button which calls in effect shell.openExternal('link') where link is an external website. I've been looking in the webdriver docs for something which allows the test…
Doug Barbieri
  • 329
  • 2
  • 10
0
votes
2 answers

Click function in Spectron doesn't click

I'm working on a electron(-nuxt) based application. End to End test re-written with AVA + Spectron. The .click() function however doesnt seem to work. I used this template: https://github.com/michalzaq12/electron-nuxt Everything seems to work except…
KingRazer
  • 3
  • 2
0
votes
1 answer

E2E Test Electron With Spectron - Docker Windows

I'm working in E2E testing in an application running inside Electron, to make it able to run in a pipeline in Jenkins I put it in a docker container that is running a windows service (build version 1903) image. The problem is that the chrome driver…
Rafael Lima
  • 469
  • 4
  • 12
0
votes
1 answer

Spectron with mocha and chai does not work

I am trying to write a tests with Spectron for our Electron App, but I am running into problems with the setup. I use the classical setup with chai. I have one file which contains setup code: const path = require("path"); const { Application } =…
Gh05d
  • 3,394
  • 1
  • 12
  • 31
0
votes
2 answers

Spectron app.client.close() does not trigger on('close' event

I have a multiwindow electron application, namely it consists of a launcher window and a main window. The main process is responsible for first showing the launcher, and after everything is initialized it gets an event over ipc and shows the main…
Tom
  • 3,157
  • 2
  • 23
  • 46
0
votes
1 answer

Use travis for build and testing with electron

I have an electron project with spectron tests. I use travis to build for every major OS with electron-builder. Now, I want to also run tests in travis, so I updated my .travis.yml file to run tests on linux (for headless tests) and build on osx.…
Yerko Palma
  • 9,788
  • 5
  • 31
  • 52
0
votes
1 answer

Reacting to ipcMain events in Spectron

I have an electron application that first starts a launcher window (in a renderer process) that starts several background services. After those background services started successfully it sends "services-running" on its ipcRenderer back to the main…
Tom
  • 3,157
  • 2
  • 23
  • 46
1 2 3
8 9