summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAlex Pott2018-05-24 22:00:33 (GMT)
committerAlex Pott2018-05-24 22:00:33 (GMT)
commit2e753970f7595e88174b8af2e1b7491dcf41d4a2 (patch)
tree8292eef8298f397c7f6c27fd58fc819b651a8181 /core
parent0076c635dcccaec9abcd65a88b004762471d4b7a (diff)
Issue #2974553 by Mixologic, justafish, drpal, dawehner: Nightwatch testing fails to save console logs for some testsHEAD8.6.x
Diffstat (limited to 'core')
-rw-r--r--core/.eslintignore1
-rw-r--r--core/package.json6
-rw-r--r--core/tests/Drupal/Nightwatch/globals.js5
3 files changed, 5 insertions, 7 deletions
diff --git a/core/.eslintignore b/core/.eslintignore
index 874d687..21c8a02 100644
--- a/core/.eslintignore
+++ b/core/.eslintignore
@@ -4,5 +4,4 @@ node_modules/**/*
*.js
!*.es6.js
modules/locale/tests/locale_test.es6.js
-!nightwatch.conf.js
!tests/Drupal/Nightwatch/**/*.js
diff --git a/core/package.json b/core/package.json
index 3a949e7..d6f405c 100644
--- a/core/package.json
+++ b/core/package.json
@@ -12,9 +12,9 @@
"build:js-dev": "cross-env NODE_ENV=development node BABEL_ENV=legacy ./scripts/js/babel-es6-build.js",
"watch:js": "cross-env BABEL_ENV=legacy node ./scripts/js/babel-es6-watch.js",
"watch:js-dev": "cross-env NODE_ENV=development BABEL_ENV=legacy node ./scripts/js/babel-es6-watch.js",
- "lint:core-js": "node ./node_modules/eslint/bin/eslint.js --ext=.es6.js . || exit 0",
- "lint:core-js-passing": "node ./node_modules/eslint/bin/eslint.js --quiet --config=.eslintrc.passing.json --ext=.es6.js . || exit 0",
- "lint:core-js-stats": "node ./node_modules/eslint/bin/eslint.js --format=./scripts/js/eslint-stats-by-type.js --ext=.es6.js . || exit 0",
+ "lint:core-js": "node ./node_modules/eslint/bin/eslint.js . || exit 0",
+ "lint:core-js-passing": "node ./node_modules/eslint/bin/eslint.js --quiet --config=.eslintrc.passing.json . || exit 0",
+ "lint:core-js-stats": "node ./node_modules/eslint/bin/eslint.js --format=./scripts/js/eslint-stats-by-type.js . || exit 0",
"lint:css": "stylelint \"**/*.css\" || exit 0",
"lint:css-checkstyle": "stylelint \"**/*.css\" --custom-formatter ./node_modules/stylelint-checkstyle-formatter/index.js || exit 0",
"test:nightwatch": "cross-env BABEL_ENV=development node -r dotenv-safe/config -r babel-register ./node_modules/.bin/nightwatch --config ./tests/Drupal/Nightwatch/nightwatch.conf.js"
diff --git a/core/tests/Drupal/Nightwatch/globals.js b/core/tests/Drupal/Nightwatch/globals.js
index fe50dfa..72b97ea 100644
--- a/core/tests/Drupal/Nightwatch/globals.js
+++ b/core/tests/Drupal/Nightwatch/globals.js
@@ -31,12 +31,11 @@ module.exports = {
browser.drupalLogConsole &&
(!browser.drupalLogConsoleOnlyOnError || browser.currentTest.results.errors > 0 || browser.currentTest.results.failed > 0)
) {
- let testName = browser.currentTest.name || browser.currentTest.module;
- testName = testName.split(' ').join('-');
const resultPath = path.join(__dirname, `../../../${nightwatchSettings.output_folder}/consoleLogs/${browser.currentTest.module}`);
const status = browser.currentTest.results.errors > 0 || browser.currentTest.results.failed > 0 ? 'FAILED' : 'PASSED';
mkdirp.sync(resultPath);
- const now = new Date().toString().split(' ').join('-');
+ const now = new Date().toString().replace(/[\s]+/g, '-');
+ const testName = (browser.currentTest.name || browser.currentTest.module).replace(/[\s/]+/g, '-');
browser
.getLog('browser', (logEntries) => {
const browserLog = JSON.stringify(logEntries, null, ' ');