-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I run an unmodified WebDriverIO test with Spectron? #357
Comments
Using Spectron for a newly created app, we get the same error message:
It seems related to options passed to the ChromeDriver. We are unable to pass any option (no effect whatsoever). It seems that the following options help:
In orther words, with these options, I am able to launch manually the ChromeDriver without any problem. But Spectron don't do it, and I couldn't find a way to tell it to do so... |
Pass However that still doesn't work. Here is the driver log:
That is spectron 7.0.0 running in this docker image
with these commands export DISPLAY=:9.0
Xvfb :9 -screen 0 1024x768x24 &
npm ci
npx mocha As far as I can tell, the IPv6 failure shouldn't affect anything. I haven't been able to get it to write a |
This is what we were doing already, but I changed a few details (
|
Try setting the remote debugging port in your capabilities file:
|
I think maybe I have the same issue, or I'm getting the same errors at least for some reason, no luck on fixing stuff. I don't think I'm doing anything too weird The spectron readme says that stuff won't work if you use This is my latest (still not working) code (I've also tried some of the suggestions in this issue). |
I have the same issue here. |
I have the same issue with Spectron version 4-10 (with the matching electron version) on ubuntu 18.04 running with xvfb. |
Update export DISPLAY=':99.0'
Xvfb :99 -screen 0 1024x600x24 > /dev/null 2>&1 & If you want to determine if your problems are related to your system or your app. Try my app, |
I am also experiencing this issue. Application launch I am using Node.js 12.14.1, |
Same issue. Running on CircleCI's |
Same issue. Did anyone get a solution? |
@zhex900 did you check my earlier comment? #357 (comment) |
Hi everyone, I can run Spectron tests with Github actions now after working around every solution in this issue. Hope this helps!
name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js 14.x
uses: actions/setup-node@v2.1.5
with:
node-version: 14.x
- name: Install yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Install xvfb
run: sudo apt-get install xvfb
- name: Run tests with xvfb
run: xvfb-run --auto-servernum yarn test
{
"main": "./dist/index.js",
"scripts": {
"compile": "tsc",
"pretest": "yarn compile",
"test": "jest --detectOpenHandles --forceExit",
},
...
"devDependencies": {
...
"electron": "12.0.5",
...
"jest": "^27.0.6",
...
"spectron": "14.0.0",
...
"typescript": "^4.0.2"
},
...
}
Set up tests with Spectron: import { Application } from 'spectron'
import electronPath from 'electron'
import path from 'path'
jest.setTimeout(60000)
let app: Application
beforeAll(() => {
app = new Application({
path: electronPath,
args: ['--no-sandbox', path.join(__dirname, '../')],
env: {
NODE_ENV: 'test',
SPECTRON: true,
ELECTRON_ENABLE_LOGGING: true,
ELECTRON_ENABLE_STACK_DUMPING: true,
},
port: 9515,
chromeDriverLogPath: 'chromedriverlog.txt',
chromeDriverArgs: [`remote-debugging-port=9222`],
})
})
afterAll(() => {
if (app && app.isRunning()) {
return app.stop()
}
})
test('Login', async () => {...}) |
Signed-off-by: Nico Carl <nicocarl@protonmail.com> Signed-off-by: Nico Carl <nicocarl@protonmail.com>
We have built an Electron application without any Spectron api calls or specific debugging port support. We have a JS WebDriverIO test for the previous web version of the app that we hope to run against our Electron build by simply modifying its wd.conf.js profile according to the instructions found here: https://electronjs.org/docs/tutorial/using-selenium-and-webdriver
Is this testing configuration supported with Spectron? The Electron app is launched and we receive the "RESPONSE InitSession ERROR unknown error: DevToolsActivePort file doesn't exist" error and the tests do not progress. We have not been able to overcome the error with any of the recommended arguments that can be passed to the Chrome session.
Do we need to incorporate Spectron into our app or can we just update the wdio config file?
Thanks for any help or insights,
Neal
PS We are current with our "npm installs" and versions of Chrome. Attached is our wdio config file for reference.
wdio.conf.txt
The text was updated successfully, but these errors were encountered: