I want to run the Protractor E2E Test for my Angular Application on a Bamboo Linux Build Server using XFVB to run Chrome resp. Chromium headless, exactly like in this gist: https://gist.github.com/nwinkler/f0928740e7ae0e7477dd.
But first I wanted to check if it works on the OSX machine I'm developing on.
Question: Is this even possible on OSX and if yes, what am I doing wrong?
In my Gruntfile I have:
grunt.loadNpmTasks('grunt-shell-spawn');
grunt.loadNpmTasks('grunt-env');
grunt.loadNpmTasks('grunt-protractor-runner');
And:
protractor: {
options: {
configFile: "test/protractor.conf.js",
keepAlive: false
},
run: {}
},
shell: {
xvfb: {
command: 'Xvfb :50 -ac -screen 0 1600x1200x24',
options: {
async: true
}
}
},
env: {
xvfb: {
DISPLAY: ':50'
}
}
And finally:
grunt.registerTask('protractor-xvfb', [
'clean:server',
'wiredep',
'includeSource',
'concurrent:server',
'autoprefixer:server',
'connect:e2e',
'shell:xvfb',
'env:xvfb',
'protractor:run',
'shell:xvfb:kill'
]);
(Do not mind the tasks up to shell:xvfb, they work)
And in my protractor.conf.js:
exports.config = {
framework: 'jasmine2',
seleniumServerJar: '../node_modules/protractor/selenium/selenium-server-standalone-2.45.0.jar',
seleniumPort: 4444,
chromeDriver: '../node_modules/protractor/selenium/chromedriver',
troubleshoot: false,
basePath: '../',
specs: ['protractor/***/**/*.js'],
baseUrl: 'http://localhost:9000',
capabilities: {
browserName: 'chrome'
}};
What this does at the moment is:
- Serve the application on localhost:9000
- Start xvfb asychnronuously in the background
- Successfully start a standalone Selenium Server on localhost:4444:wd/hub
- Open a Chrome window and successfully run the test.
- As soon as the test is finished kill the xfvb process.
But I can't see any indices that Selenium actually connects to the xvfb framebuffer.