Zoette
Zoette

Reputation: 1281

Headless protractor tests don't plug on Xvfb



I'm trying to run Protractor tests both in command line and with Jenkins. Both fail with the same error.

Command line

Jenkins

In both cases, I get this error.

Failed: unknown error: an X display is required for keycode conversions,
consider using Xvfb

Why won't my tests plug on the Xvfb I started for them so zealously? Thanks for your help.

Upvotes: 0

Views: 937

Answers (2)

Archagy
Archagy

Reputation: 135

Great to hear you resolve your issue.

Another alternative would be to create a gulp task and use the gulp-angular-protractor extension. I think is easier to configure and run.

And install the xvfb plugin to use it on the configuration on your job.

Good Luck !

Upvotes: 0

Zoette
Zoette

Reputation: 1281

Alright, I finally managed to run my Protractor tests headlessly using

xvfb-run -a webdriver-manager start --seleniumPort 9094 &
protractor myconf.js

Where -a chooses any free display, and & makes the task run in background.

Upvotes: 1

Related Questions