selenium: Update wdio-mediawiki

wdio-mediawiki v1.1.1:
- Includes wdio-defaults.conf.js file that vastly simplifies wdio.conf.js.
- Replaces @wdio/spec-reporter with @wdio/dot-reporter.
- Introduces video recording.

Bug: T283597
Change-Id: I603626d20eb060ba6d90b1a91d49afe13e29d945
This commit is contained in:
sahil 2021-05-27 17:42:00 +05:30
parent fa325f1ea5
commit 5fca7c2f51
3 changed files with 147 additions and 189 deletions

232
package-lock.json generated
View file

@ -438,6 +438,12 @@
"@types/responselike": "*"
}
},
"@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",
@ -598,6 +604,39 @@
"glob": "^7.1.2"
}
},
"@wdio/dot-reporter": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/@wdio/dot-reporter/-/dot-reporter-6.11.0.tgz",
"integrity": "sha512-0EmRTVazuNXrn4YVhhJ39brSUlsRg+WE22MSU1cNO1xif011C6MKE7ZS5HbS528uSY0dEFYxApyQJ/4TM4bhqQ==",
"dev": true,
"requires": {
"@wdio/reporter": "6.11.0",
"chalk": "^4.0.0"
}
},
"@wdio/junit-reporter": {
"version": "6.1.9",
"resolved": "https://registry.npmjs.org/@wdio/junit-reporter/-/junit-reporter-6.1.9.tgz",
"integrity": "sha512-ml6m1SwRjScDsU/5Iarm+mbp3l9lg+QMR5KGsvi5gt/xylsMl3aIxRdMxFEcgcpoXQP+QUEktPkp1SURfOXG1g==",
"dev": true,
"requires": {
"@wdio/reporter": "6.1.9",
"json-stringify-safe": "^5.0.1",
"junit-report-builder": "^2.0.0",
"validator": "^13.0.0"
},
"dependencies": {
"@wdio/reporter": {
"version": "6.1.9",
"resolved": "https://registry.npmjs.org/@wdio/reporter/-/reporter-6.1.9.tgz",
"integrity": "sha512-3eQ8VcloL27Ev27EQIGS/BlmRrAeSu/e7ZHbQ3SN6E8eDpbJ7UZauO5mh+XqAq7a2LF8Sd5PMLnJ3RKlGtw+kA==",
"dev": true,
"requires": {
"fs-extra": "^9.0.0"
}
}
}
},
"@wdio/local-runner": {
"version": "6.1.12",
"resolved": "https://registry.npmjs.org/@wdio/local-runner/-/local-runner-6.1.12.tgz",
@ -651,11 +690,12 @@
}
},
"@wdio/reporter": {
"version": "6.1.9",
"resolved": "https://registry.npmjs.org/@wdio/reporter/-/reporter-6.1.9.tgz",
"integrity": "sha512-3eQ8VcloL27Ev27EQIGS/BlmRrAeSu/e7ZHbQ3SN6E8eDpbJ7UZauO5mh+XqAq7a2LF8Sd5PMLnJ3RKlGtw+kA==",
"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"
}
},
@ -674,18 +714,6 @@
"webdriverio": "6.1.12"
}
},
"@wdio/spec-reporter": {
"version": "6.1.12",
"resolved": "https://registry.npmjs.org/@wdio/spec-reporter/-/spec-reporter-6.1.12.tgz",
"integrity": "sha512-84hRQZvnrp2URoKsxi+9l0T3Qr/vueMKz1WPKNaDEiIqB1dP3L6Fl09THXXr5uy+FwMUJ1aee+twH0VwRV5haQ==",
"dev": true,
"requires": {
"@wdio/reporter": "6.1.9",
"chalk": "^4.0.0",
"easy-table": "^1.1.1",
"pretty-ms": "^7.0.0"
}
},
"@wdio/sync": {
"version": "6.1.8",
"resolved": "https://registry.npmjs.org/@wdio/sync/-/sync-6.1.8.tgz",
@ -1324,13 +1352,6 @@
"wrap-ansi": "^6.2.0"
}
},
"clone": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
"integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=",
"dev": true,
"optional": true
},
"clone-regexp": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-2.2.0.tgz",
@ -1614,6 +1635,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",
@ -1674,16 +1701,6 @@
"integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==",
"dev": true
},
"defaults": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz",
"integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=",
"dev": true,
"optional": true,
"requires": {
"clone": "^1.0.2"
}
},
"defer-to-connect": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.0.tgz",
@ -1968,24 +1985,6 @@
}
}
},
"easy-table": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/easy-table/-/easy-table-1.1.1.tgz",
"integrity": "sha512-C9Lvm0WFcn2RgxbMnTbXZenMIWcBtkzMr+dWqq/JsVoGFSVUVlPqeOa5LP5kM0I3zoOazFpckOEb2/0LDFfToQ==",
"dev": true,
"requires": {
"ansi-regex": "^3.0.0",
"wcwidth": ">=1.0.1"
},
"dependencies": {
"ansi-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"dev": true
}
}
},
"ecc-jsbn": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
@ -3085,9 +3084,9 @@
"dev": true
},
"fsevents": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.1.tgz",
"integrity": "sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw==",
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
"dev": true,
"optional": true
},
@ -4229,6 +4228,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.3",
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.3.tgz",
@ -4585,6 +4596,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",
@ -4877,18 +4905,18 @@
"dev": true
},
"mime-db": {
"version": "1.45.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz",
"integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==",
"version": "1.47.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
"integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==",
"dev": true
},
"mime-types": {
"version": "2.1.28",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz",
"integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==",
"version": "2.1.30",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
"integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
"dev": true,
"requires": {
"mime-db": "1.45.0"
"mime-db": "1.47.0"
}
},
"mimic-fn": {
@ -5248,14 +5276,41 @@
"dev": true
},
"mwbot": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/mwbot/-/mwbot-1.0.10.tgz",
"integrity": "sha1-pEC9ZmOnYoq1t5lgnpjLL8ThM8k=",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/mwbot/-/mwbot-2.0.0.tgz",
"integrity": "sha512-9iTx8oFMntC60yyaPJjN4GEgiQlal7i03jATu7kq5b9BGW5aNz7YbrpjaciLNr0Z33PTdQe0hRTJ0JdUJi2WQg==",
"dev": true,
"requires": {
"bluebird": "^3.4.6",
"request": "^2.75.0",
"semlog": "^0.6.10"
"bluebird": "^3.7.2",
"request": "^2.88.2",
"semlog": "^0.6.10",
"semver": "7.3.4"
},
"dependencies": {
"lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"requires": {
"yallist": "^4.0.0"
}
},
"semver": {
"version": "7.3.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz",
"integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
}
},
"yallist": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
"dev": true
}
}
},
"natural-compare": {
@ -5530,12 +5585,6 @@
"error-ex": "^1.2.0"
}
},
"parse-ms": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz",
"integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==",
"dev": true
},
"parse-passwd": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz",
@ -5811,15 +5860,6 @@
"react-is": "^17.0.1"
}
},
"pretty-ms": {
"version": "7.0.1",
"resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz",
"integrity": "sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==",
"dev": true,
"requires": {
"parse-ms": "^2.1.0"
}
},
"prettyjson": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/prettyjson/-/prettyjson-1.2.1.tgz",
@ -7095,6 +7135,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",
@ -7176,23 +7222,13 @@
}
}
},
"wcwidth": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz",
"integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=",
"dev": true,
"optional": true,
"requires": {
"defaults": "^1.0.3"
}
},
"wdio-mediawiki": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/wdio-mediawiki/-/wdio-mediawiki-1.0.0.tgz",
"integrity": "sha512-eKrPx3MHTQvWaI+YUi6pLmebOdsdBegnx5MJx8m9ejh6US7TIKKzLmsh9p9gfj6PW7HzHNN/e8EkDwKo3M0kJg==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/wdio-mediawiki/-/wdio-mediawiki-1.1.1.tgz",
"integrity": "sha512-bbOnxzxuCJXG5KaccoeUyc525f9rxfaTqjWm26AWRPoKx2i4+jp9qlXQ+WywqwL4CvMen9by396s2DA/is1pmA==",
"dev": true,
"requires": {
"mwbot": "1.0.10"
"mwbot": "2.0.0"
}
},
"webdriver": {
@ -7331,6 +7367,12 @@
"integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==",
"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",

View file

@ -8,9 +8,10 @@
},
"devDependencies": {
"@wdio/cli": "6.1.12",
"@wdio/dot-reporter": "6.11.0",
"@wdio/junit-reporter": "6.1.9",
"@wdio/local-runner": "6.1.12",
"@wdio/mocha-framework": "6.1.8",
"@wdio/spec-reporter": "6.1.12",
"@wdio/sync": "6.1.8",
"eslint-config-wikimedia": "0.20.0",
"grunt": "1.4.0",
@ -18,7 +19,7 @@
"grunt-eslint": "23.0.0",
"grunt-stylelint": "0.16.0",
"stylelint-config-wikimedia": "0.10.3",
"wdio-mediawiki": "1.0.0",
"wdio-mediawiki": "1.1.1",
"webdriverio": "6.1.12"
}
}

View file

@ -1,96 +1,11 @@
/**
* See also: http://webdriver.io/guide/testrunner/configurationfile.html
*/
'use strict';
const fs = require( 'fs' ),
saveScreenshot = require( 'wdio-mediawiki' ).saveScreenshot;
const { config } = require( 'wdio-mediawiki/wdio-defaults.conf.js' );
exports.config = {
// ==================
// Automation Protocols
// ==================
// See https://webdriver.io/docs/automationProtocols/
automationProtocol: 'devtools',
// ======
// Custom WDIO config specific to MediaWiki
// ======
// Use in a test as `browser.options.<key>`.
// Defaults are for convenience with MediaWiki-Vagrant
// Wiki admin
mwUser: process.env.MEDIAWIKI_USER || 'Admin',
mwPwd: process.env.MEDIAWIKI_PASSWORD || 'vagrant',
// Base for browser.url() and Page#openTitle()
baseUrl: ( process.env.MW_SERVER || 'http://127.0.0.1:8080' ) + (
process.env.MW_SCRIPT_PATH || '/w'
),
// ==================
// Test Files
// ==================
specs: [
__dirname + '/specs/*.js'
],
// ============
// Capabilities
// ============
capabilities: [ {
// https://sites.google.com/a/chromium.org/chromedriver/capabilities
browserName: 'chrome',
maxInstances: 1,
'goog:chromeOptions': {
// If DISPLAY is set, assume developer asked non-headless or CI with Xvfb.
// Otherwise, use --headless (added in Chrome 59)
// https://chromium.googlesource.com/chromium/src/+/59.0.3030.0/headless/README.md
args: [
...( process.env.DISPLAY ? [] : [ '--headless' ] ),
// Chrome sandbox does not work in Docker
...( fs.existsSync( '/.dockerenv' ) ? [ '--no-sandbox' ] : [] )
]
}
} ],
// ===================
// Test Configurations
// ===================
// Level of verbosity: silent | verbose | command | data | result | error
logLevel: 'error',
// Setting this enables automatic screenshots for when a browser command fails
// It is also used by afterTest for capturing failed assertions.
screenshotPath: process.env.LOG_DIR || __dirname + '/log',
// Default timeout for each waitFor* command.
waitforTimeout: 10 * 1000,
// See also: http://webdriver.io/guide/testrunner/reporters.html
reporters: [ 'spec' ],
// See also: http://mochajs.org
mochaOpts: {
ui: 'bdd',
timeout: 60 * 1000
},
// =====
// Hooks
// =====
/**
* Save a screenshot when test fails.
*
* @param {Object} test Mocha Test object
*/
afterTest: function ( test ) {
if ( !test.passed ) {
const filePath = saveScreenshot( test.title );
console.log( '\n\tScreenshot: ' + filePath + '\n' );
}
}
exports.config = { ...config
// Override, or add to, the setting from wdio-mediawiki.
// Learn more at https://webdriver.io/docs/configurationfile/
//
// Example:
// logLevel: 'info',
};