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
1
vote
1 answer

Spectron async isExisting doesnt return false

I am using spectron 3.8.0 and am trying to check if am element exists in the DOM. I tried using the waitUntil method with try/catch, but it didn't work as expected. Recently I got sync app.client.isExisting() return true if an element exists, but…
zaebalo
  • 147
  • 2
  • 12
1
vote
1 answer

Electron,Spectron: how to write test cases in seperate javascript file

I am testing electron application use these technologies, Spectron, Chai, chai as promised I want to write my test cases in separate file, except all in one file. Here's what I've tried, describe("Login", function () { this.timeout(10000); …
1
vote
0 answers

Mocha (Spectron) suddenly times out on async test scenarios

I wanted to run some Spectron e2e tests I wrote some weeks ago, but to my surprise, suddenly they all stopped working for one and the same reason. According to the error message, I'm dealing with rejected Promises, but I can't figure out where the…
Lucca
  • 1,447
  • 4
  • 16
  • 20
1
vote
1 answer

How to apply blur event with Javascript using WebdriverIO and Spectron

I am developing Spectron UI tests using Mocha for application that runs on Electron. The main issue that I have is that Javascript does not threat texts inputs by tool equally to real inputs from the keyboard. As workaround for that I want to apply…
1
vote
1 answer

Can Spectron, mocha, and chai assert that variables have expected values in an Electron-app?

How can we assert that a javascript-variable embedded in HTML has some expected value within an application built with electron? The current testing framework is spectron, mocha, chai, chai.should(), and chai.use(chaiAsPromised). I want to assert…
1
vote
1 answer

How are webdriver and chromedriver options accessed in Spectron's new Application()?

When I start a new Spectron application (for each test suite) I would like to fix the size of the app (for consistency across all machines and reloads). Commands like setBounds and maximise do change dimensions, but they only do so after the app…
cham
  • 8,666
  • 9
  • 48
  • 69
1
vote
1 answer

How do you access menu items in webdriverio (Spectron)?

I am building a set of e2e tests with Spectron and webdriverio for an Electron App. I would like to access the browser's menu bar. Even just being able to have Spectron click on 'File' and then 'New File' would be great. Thanks for any help!
cham
  • 8,666
  • 9
  • 48
  • 69
1
vote
0 answers

Unable to proceed after clicking a button

I am using spectron to simulate a test on Slack as follows: 1) Open the application. 2) Type in a valid domain. 3) Click Continue. I am using the following script for that purpose: JavaScript: var Application = require('spectron').Application var…
1
vote
3 answers

How do I implement Typescript webdriverio for the SpectronClient?

Spectron is a node.js framework for automating Electron apps. I'm using Spectron along with AVA and Typescript to do automated Integration Testing. I'm using AVA's suggest method for making the test's context typesafe but I'm not able to figure…
Evan Larsen
  • 9,935
  • 4
  • 46
  • 60
1
vote
2 answers

Testing Text Input for Electron App

I'm trying to get to grips with using Electron, and Spectron for its testing. I would like to write in my body which is contentEditable, and then check that the text matches in my test. So far I've managed to write a successful test for the title,…
pyan
  • 865
  • 2
  • 12
  • 23
1
vote
0 answers

Access WebRequest from Spectron

How do I access the event handlers for WebRequest in Spectron? I've tried to use app.electron.remote.session.defaultSession, but the promise it returns never seems to resolve.
Kris Molinari
  • 503
  • 6
  • 17
1
vote
0 answers

Path configuration for testing Ember-electron with Spectron

I am trying to integrate Spectron with Ember-electron for testing. I found an example for Spectron but I am not sure what to assign in the electronPath part in case of Ember-electron. I do not have an .exe or .cmd how to point to the location of…
lft93ryt
  • 948
  • 1
  • 16
  • 32
1
vote
0 answers

Multiple instances of the same application to test using Spectron

I am trying to have two separate instances of the same application running in a spectron test. For example: var electronPath = path.join(__dirname, '..', 'node_modules', '.bin', 'electron'); if (process.platform === 'win32') { electronPath +=…
thanos_tz
  • 11
  • 4
1
vote
1 answer

Spectron and starting electron application

While trying to run the first mocha test for my electron application I get error: I am pretty sure it is related to the way application is run in general. While using "electron ." to start, there is no issue. When "npm start" is executed, i get the…
Lormitto
  • 477
  • 2
  • 7
  • 19
1
vote
1 answer

Why won't these chai tests fail?

We have some simple "is this really working" chai tests of an electron app using spectron and WebdriverIO. The example code we started with is from https://github.com/jwood803/ElectronSpectronDemo as reported in…
Jason Harrison
  • 922
  • 9
  • 27