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
3
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
  • 4,095
  • 4
  • 32
  • 48
3
votes
2 answers

Spectron/WebdriverIO nth child using $$[n] instead of selector

I am trying to use Spectron to test my Electron application. The documentation says when trying to find the nth child, you can use an nth child selector, or get all children that match selector using $$ and then use index operator ie $$ ("foo")[0]…
3
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
  • 2,387
  • 19
  • 27
2
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
  • 596
  • 4
  • 14
  • 39
2
votes
0 answers

Spectron : app.client.click is not a function

I am testing a simple electron app using Spectron. following is my test.js having a test case to click an element. const Application = require('spectron').Application; const assert = require('assert'); const electronPath = require('electron'); //…
2
votes
1 answer

unknown error: Chrome failed to start: exited abnormally when trying to test electron spectron with mocha

i'm trying to test electron spectron testing. my project is very simple, just clone an electron quick start repo then write code to spec.js as written from the readme file from electron-userland/spectron but when i run npm test, i face this error: $…
dhanyn10
  • 99
  • 10
2
votes
0 answers

Use add files dialog in Electron testing with Spectron

I want to test my Electron application but I feel this is harder than I expected! Just a simple thing as using the open file dialog seems impossible from what I've seen when I looked around a while! Is it at all possible, or can I mock this behavior…
mottosson
  • 2,181
  • 2
  • 22
  • 47
2
votes
0 answers

How to write UI automation test for a vs code extension without using the source code

I am trying to write UI automation scripts to perform the automated testing of a vs code extension. After reading tutorials about spectron/ vs code test, I found that they both need source code to perform tests. I am trying to perform from a QA side…
2
votes
1 answer

How to select a React component with Spectron?

I'm using Spectron to test an Electron app that is based on React. I'd like to select a React component and I'm trying to access WebDriverIO's browser for that and call react$, however the function cannot be found - 'app.client.react$ is not a…
Rani
  • 4,269
  • 1
  • 18
  • 26
2
votes
2 answers

Using Python + Selenium for Electron-based app testing

There is a lot of documentation on using Spectron for testing applications built using Electron. As I have a lot of utilities written in Python, I would like to know if there is any way to use Python-Selenium for testing apps built in Electron. From…
2
votes
0 answers

Simulate drag with spectron

I want to simulate a drag within an element using spectron/electron. I tried 2 ways: await client.moveToObject(selector, fromX, fromY); await client.buttonDown(0); await client.moveToObject(selector, toX, toY); await client.buttonUp(0); and await…
Michael Hopfner
  • 133
  • 1
  • 10
2
votes
3 answers

Access multiple renderers with spectron

I'm working on an Electron application. The main process opens a first renderer (browserWindow). When the user click on a button, this renderer sends an IPC message to the main process. When this message is received, the main process opens a second,…
Anozer
  • 411
  • 1
  • 4
  • 11
2
votes
2 answers

Double click x y co-ordinates WebdriverIO

WebdriverIO supplies a doubleClick() command. Unlike some other commands, such as leftClick(), doubleClick() does not have any x y parameters. I am unable to double click on specific x y positions on one particular component. I would like to do this…
cham
  • 4,095
  • 4
  • 32
  • 48
2
votes
2 answers

selecting options in spectron test

I am developing an desktop application using Electron and NodeJS, what it specifically is isn't really important. I am using spectron to test my electron application. I have implemented a functionality for selecting between different saved databases…
user9428566
2
votes
0 answers

Can Spectron tests run in their own desktop?

We have mocha+Spectron testing an Electron app. They run for about a minute currently. The app window keeps opening and closing, which is annoying in a couple of ways: If the user clicks, or types when it has focus, in the app window during a test,…
Darren Cook
  • 24,365
  • 12
  • 95
  • 193
1
2
3
8 9