diff --git a/package-lock.json b/package-lock.json index 420b28211..e57ab1166 100644 --- a/package-lock.json +++ b/package-lock.json @@ -751,6 +751,12 @@ "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", "dev": true }, + "@types/cucumber": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@types/cucumber/-/cucumber-6.0.1.tgz", + "integrity": "sha512-+GZV6xfN0MeN9shDCdny8GbC8N0+U6uca8cjyaJndcwmrUhwS6qOU2vmYn0d71EOwJF568/v3SxJ8VKxuZNYRw==", + "dev": true + }, "@types/http-cache-semantics": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz", @@ -918,6 +924,30 @@ "glob": "^7.1.2" } }, + "@wdio/junit-reporter": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@wdio/junit-reporter/-/junit-reporter-6.11.0.tgz", + "integrity": "sha512-wOc1SYEHdGaLdO3zdcJ0U55p/LxMZL4erHSeqHMSJZLtuNPJYvj3RgRrhnVYMcnR6OjzIMC/acQ/hU2QwrzXNQ==", + "dev": true, + "requires": { + "@wdio/reporter": "6.11.0", + "json-stringify-safe": "^5.0.1", + "junit-report-builder": "^2.1.0", + "validator": "^13.0.0" + }, + "dependencies": { + "@wdio/reporter": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@wdio/reporter/-/reporter-6.11.0.tgz", + "integrity": "sha512-SStNZZUI0bXI+omyIU6ql4Rh+Dews1dz1GlowHDrBxwKMPyAwytgYokXLn3zr+E3tkHDiRyJjQxfDetBWBGmtg==", + "dev": true, + "requires": { + "@types/cucumber": "^6.0.1", + "fs-extra": "^9.0.0" + } + } + } + }, "@wdio/local-runner": { "version": "6.1.16", "resolved": "https://registry.npmjs.org/@wdio/local-runner/-/local-runner-6.1.16.tgz", @@ -2221,6 +2251,12 @@ "assert-plus": "^1.0.0" } }, + "date-format": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/date-format/-/date-format-0.0.2.tgz", + "integrity": "sha1-+v1Ej3IRXvHitzkVWukvK+bCjdE=", + "dev": true + }, "dateformat": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", @@ -5420,6 +5456,18 @@ "verror": "1.10.0" } }, + "junit-report-builder": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/junit-report-builder/-/junit-report-builder-2.1.0.tgz", + "integrity": "sha512-Ioj5I4w18ZcHFaaisqCKdh1z+ipzN7sA2JB+h+WOlGcOMWm0FFN1dfxkgc2I4EXfhSP/mOfM3W43uFzEdz4sTw==", + "dev": true, + "requires": { + "date-format": "0.0.2", + "lodash": "^4.17.15", + "make-dir": "^1.3.0", + "xmlbuilder": "^10.0.0" + } + }, "keyv": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.1.tgz", @@ -5900,6 +5948,23 @@ "yallist": "^2.1.2" } }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, "make-iterator": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/make-iterator/-/make-iterator-1.0.1.tgz", @@ -9110,6 +9175,12 @@ "spdx-expression-parse": "^3.0.0" } }, + "validator": { + "version": "13.6.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.6.0.tgz", + "integrity": "sha512-gVgKbdbHgtxpRyR8K0O6oFZPhhB5tT1jeEHZR0Znr9Svg03U0+r9DXWMrnRAB+HtCStDQKlaIZm42tVsVjqtjg==", + "dev": true + }, "verror": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", @@ -9364,6 +9435,12 @@ "integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w==", "dev": true }, + "xmlbuilder": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-10.1.1.tgz", + "integrity": "sha512-OyzrcFLL/nb6fMGHbiRDuPup9ljBycsdCypwuyg5AAHvyWzGfChJpCXMG88AGTIMFhGZ9RccFN1e6lhg3hkwKg==", + "dev": true + }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/package.json b/package.json index d3085aa1d..e2c93fa03 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "devDependencies": { "@wdio/cli": "6.1.16", + "@wdio/junit-reporter": "6.11.0", "@wdio/local-runner": "6.1.16", "@wdio/mocha-framework": "6.1.14", "@wdio/spec-reporter": "6.1.14", diff --git a/tests/selenium/wdio.conf.js b/tests/selenium/wdio.conf.js index 196cd2276..5ab8117d7 100644 --- a/tests/selenium/wdio.conf.js +++ b/tests/selenium/wdio.conf.js @@ -4,6 +4,8 @@ * See also: http://webdriver.io/guide/testrunner/configurationfile.html */ const fs = require( 'fs' ), + path = require( 'path' ), + logPath = process.env.LOG_DIR || path.join( __dirname, '/log' ), saveScreenshot = require( 'wdio-mediawiki' ).saveScreenshot; exports.config = { @@ -57,13 +59,24 @@ exports.config = { // Setting this enables automatic screenshots for when a browser command fails // It is also used by afterTest for capturig failed assertions. - screenshotPath: process.env.LOG_DIR || __dirname + '/log', + screenshotPath: logPath, // Default timeout for each waitFor* command. waitforTimeout: 10 * 1000, - // See also: http://webdriver.io/guide/testrunner/reporters.html - reporters: [ 'spec' ], + // See: + // https://webdriver.io/docs/dot-reporter + // https://webdriver.io/docs/junit-reporter + reporters: [ + 'spec', + [ 'junit', { + outputDir: logPath, + outputFileFormat: function () { + const makeFilenameDate = new Date().toISOString().replace( /[:.]/g, '-' ); + return `WDIO.xunit-${makeFilenameDate}.xml`; + } + } ] + ], // See also: http://mochajs.org mochaOpts: {