Commit 507f831b authored by Colin PUY's avatar Colin PUY Committed by benjaminParisel

Test/headless e2e (#2455)

* test(e2e): launch e2e in headless mode

Allow to launch e2e tests with chrome in headless mode.
Saves some hardware resources and remove the need of Xvfb

Prepare new CI integration

* test(lib): adding missing librairie in package.json for headless

* test(pom): call test:headless in community tests
parent d3b4cb20
......@@ -20,6 +20,7 @@
"bower": "^1.3.12",
"browser-sync": "~1.7.1",
"connect": "~3.2.0",
"cross-env": "^5.1.4",
"del": "^1.1.1",
"gulp": "~3.8.8",
"gulp-angular-gettext": "^2.1.0",
......@@ -67,6 +68,7 @@
"merge-stream": "^0.1.7",
"mkdirp": "^0.5.1",
"multiparty": "^4.1.2",
"npm-run-all": "^4.1.2",
"phantomjs-prebuilt": "2.1.8",
"protractor": "5.2.0",
"run-sequence": "~0.3.7",
......@@ -82,6 +84,7 @@
"test-watch": "gulp test-watch",
"pree2e": "webdriver-manager update --versions.standalone=3.11.0 --versions.chrome=2.38",
"e2e": "gulp e2e",
"e2e:headless": "cross-env HEADLESS=true npm-run-all e2e",
"pot": "gulp pot",
"start": "gulp serve"
},
......
......@@ -100,7 +100,7 @@
</goals>
<phase>integration-test</phase>
<configuration>
<arguments>run e2e</arguments>
<arguments>run e2e:headless</arguments>
</configuration>
</execution>
</executions>
......
/* globals exports */
/* globals exports, process */
// needed for ES6 to work in protractor <_<
require('babel-core/register');
......@@ -11,6 +11,19 @@ const capabilities = {
}
};
// activate chrome in headless mode
// see https://developers.google.com/web/updates/2017/04/headless-chrome
if (process.env.HEADLESS) {
capabilities.chromeOptions.args = [
...capabilities.chromeOptions.args,
'--headless',
// Temporarily needed if running on Windows.
'--disable-gpu',
// We must disable the Chrome sandbox when running Chrome inside Docker
'--no-sandbox'
];
}
exports.config = {
seleniumServerJar: '../../node_modules/webdriver-manager/selenium/selenium-server-standalone-3.11.0.jar',
chromeDriver: '../../node_modules/webdriver-manager/selenium/chromedriver_2.38',
......
This diff is collapsed.
......@@ -9,10 +9,12 @@
"devDependencies": {
"babel-core": "6.3.17",
"babel-preset-bonita": "1.0.2",
"cross-env": "^5.1.4",
"gulp": "~3.8.8",
"gulp-babel": "5.3.0",
"gulp-protractor": "3.0.0",
"jasmine-reporters": "2.1.1",
"npm-run-all": "^4.1.2",
"protractor": "5.2.0",
"query-string": "^5.1.0",
"url": "^0.11.0",
......@@ -20,7 +22,8 @@
},
"scripts": {
"pretest": "webdriver-manager update --versions.standalone=3.11.0 --versions.chrome=2.38",
"test": "gulp ddescriber && gulp test"
"test": "gulp ddescriber && gulp test",
"test:headless": "cross-env HEADLESS=true npm-run-all test"
},
"author": "",
"license": "proprietary",
......@@ -29,9 +32,9 @@
},
"homepage": "https://github.com/bonitasoft/bonita-form-builder",
"dependencies": {
"multiparty": "^4.1.2",
"connect": "^3.3.5",
"http-proxy": "^1.11.1"
"http-proxy": "^1.11.1",
"multiparty": "^4.1.2"
},
"babel": {
"presets": [
......
......@@ -108,7 +108,7 @@
</goals>
<phase>integration-test</phase>
<configuration>
<arguments>run test</arguments>
<arguments>run test:headless</arguments>
</configuration>
</execution>
</executions>
......
/* globals exports */
/* globals exports, process */
// needed for ES6 to work in protractor <_<
require('babel-core/register');
......@@ -16,6 +16,19 @@ const capabilities = {
}
};
// activate chrome in headless mode
// see https://developers.google.com/web/updates/2017/04/headless-chrome
if (process.env.HEADLESS) {
capabilities.chromeOptions.args = [
...capabilities.chromeOptions.args,
'--headless',
// Temporarily needed if running on Windows.
'--disable-gpu',
// We must disable the Chrome sandbox when running Chrome inside Docker
'--no-sandbox'
];
}
exports.config = {
seleniumServerJar: './node_modules/webdriver-manager/selenium/selenium-server-standalone-3.11.0.jar',
chromeDriver: './node_modules/webdriver-manager/selenium/chromedriver_2.38',
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment