spectron | DEPRECATED : 🔎 Test Electron apps using ChromeDriver
kandi X-RAY | spectron Summary
kandi X-RAY | spectron Summary
Easily test your Electron apps using ChromeDriver and WebdriverIO.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Application constructor .
- add all main functions to the main modules
- Creates a new ChromeDriver driver .
- ignore module name
- Transform an object
- call a module api
- add current window to current window
- region public API methods
- Check if a remote function is a function
- ignore api name
spectron Key Features
spectron Examples and Code Snippets
Community Discussions
Trending Discussions on spectron
QUESTION
I'm relatively new to Spectron and Jest and I can't figure out why the app isn't launching when I call app.start() in my unit test. Right now when I run npm test, the app won't start, eventually times out (even after 30 seconds) and always sends this error message:
Timeout - Async callback was not invoked within the 15000 ms timeout specified by jest.setTimeout.Error: Timeout - Async callback was not invoked within the 15000 ms timeout specified by jest.setTimeout. at mapper (node_modules/jest-jasmine2/build/queueRunner.js:27:45)
So far I've tried:
- making sure I'm using the correct versions of spectron and electron (11.0.0 and 9.0.0 respectively)
- running npm test from my root folder, my src folder, and my tests folder.
- deleting my node_modules folder, reinstalling everything, and rebuilding the app.
- using
path.join(__dirname, '../../', 'node_modules', '.bin', 'electron')
as my app.path.
Here's my test1.js file:
...ANSWER
Answered 2021-Sep-08 at 20:05I came across this Spectron tutorial on YouTube: https://www.youtube.com/watch?v=srBKdQT51UQ
It was published in September 2020 (almost a year ago as of the time of this post) and they suggested downgrading to electron 8.0.0 and Spectron 10.0.0. When I downgraded, the app magically launched when app.start
was called.
QUESTION
I'm working on an electron app, using React on the front end and I'm attempting to use Jest for testing. However, when I try to run tests I get the following error:
SyntaxError: C:\Users\JimArmbruster\source\repos\cyborg_cloud_explorer\cyborg_cloud_explorer_gui\src\assets\custom_components\stylesheets\buttons.css: Support for the experimental syntax 'decorators-legacy' isn't currently enabled (1:1):
...ANSWER
Answered 2021-Sep-07 at 18:34Jest won't use the babel plugins out of the box, you need to install some additional packages.
With yarn:
yarn add --dev babel-jest babel-core regenerator-runtime
With npm:
npm install babel-jest babel-core regenerator-runtime --save-dev
Jest should then pick up the configuration from your .babelrc
or babel.config.js
.
Source: https://archive.jestjs.io/docs/en/23.x/getting-started.html#using-babel
QUESTION
I have been having some issues with executing my cucumber scenarios successfully because, for some unknown reason, the electron app we are testing isn't completely shown (table with 1 missing column on the right). For some reason, this only happens on our windows test execution server, not on my local laptop. Server resolution is 1920x1080. Tests are started via Azure DevOps Server pipeline.
We test the electron app via spectron with the cucumber-js framework in typescript.
...ANSWER
Answered 2021-Jun-28 at 07:24For anyone that might encounter this issue in the future. What solved my issue was pretty basic. Just had to set the bounds of the client application manually.
QUESTION
I Know that there is a lot of topic about this, but since none of them work, I must make a new one, I'm quite confused as why my electron app doesn't launch when I used yarn dev
for my project, but when my friends try it, in his laptop, he can run and the apps launch normally without any problem, so Is there anyone here ever face the same problem with me? if there is someone, how can you solve this problem?
this is what my terminal looks like:
for information I used:
...ANSWER
Answered 2021-Apr-28 at 12:55This may be a silly answer. Try checking whether the task is running or any other programs interfereing the app, like an antivirus.
QUESTION
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 non-Electron test file in which I import nodegit directly.
...ANSWER
Answered 2020-Nov-14 at 14:01Hey) I think I can solve your problem, just try this:
QUESTION
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:
...ANSWER
Answered 2020-Sep-17 at 04:59i've downgrade my electron version to 9.3.1 and now my project working normally. You can find specific information about electron and spectron version that can support each other from electron-userland/spectron
QUESTION
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 methods to catch window's closing and then proceed to another tests.
Currently my code is
...ANSWER
Answered 2020-Apr-03 at 08:55await app.client.waitUntil(async () => (await app.client.getWindowCount()) === 1);
QUESTION
Anyone had experience in automating desktop applications (not web)? I need an Appium-like solution to integrate it with my mobile automation (written on Appium, Java).
Our company has a messenger client on 3 platforms: Android, iOS and desktop. Client data is synchronized between these platforms. We already have a basic automation for mobile platforms (using Appium). Now I need to develop automation for desktop.
I want an Appium-like solution, so it would be easy to integrate with our mobile automation. I found WinAppDriver, but it is for Windows only. Most likely our desktop app will be cross-platform (Windows, Mac OS, Linux).
Is there any solution simular to WinAppDriver, but cross-platform?
Our desktop app is based on Electron, so probably I could test it with Spectron (it is cross-platform). But I doubt that the integration with Appium will be fine.
...ANSWER
Answered 2020-Mar-30 at 11:40Edited:
Little late, but:
The Electron windows native application can be tested with Selenium using good ol' ChromeDriver. It's not over Appium (didn't find a way to spawn windows app with ChromeDriver over Appium), but it works out of the box, and the element locators will be the same, so you could reuse your tests, just initiate the driver differently: by setting the binary in ChromeOptions to your executable file, and calling the ChromeDriver constructor instead of RemoteWebDriver. Refer to this article for details.
Haven't experimented with MacOS yet, but found this, might be of help.
QUESTION
I have an android 9 app recently converted to Electron app. For DataTable, I have enabled Print and Excel options. Excel upload is fine and exporting data. But Print is not working. Its giving the following error
...ANSWER
Answered 2020-Feb-15 at 08:31The information given in the post helped me ( angular application build in electron print a div shows blank window ).
The answer is : in main.ts for electron, need to add nativeWindowOpen: true as below.
QUESTION
I currently have two wdio.config.js files with different configurations. How can i run both one after another? Is it possible?
This is how I am defining in the code:
first config.js
...ANSWER
Answered 2020-Jan-09 at 09:33Create individual test command for both config files. Then add a new script in package.json having both the test commands separated by &&.
https://stackoverflow.com/a/53809731/8903949
(Or)
Use gulp or grunt task.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install spectron
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page