ui5-test-runner 5.10.0 → 5.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/jest.config.json +2 -1
- package/package.json +15 -8
- package/src/defaults/browser.js +4 -2
- package/src/defaults/junit-xml-report.js +4 -1
- package/src/defaults/playwright.js +8 -1
- package/src/defaults/selenium-webdriver/chrome.js +5 -5
- package/src/defaults/selenium-webdriver.js +2 -1
- package/src/job.js +2 -4
- package/src/output.js +1 -1
- package/src/report.js +4 -6
- package/src/start.js +8 -1
package/README.md
CHANGED
|
@@ -49,3 +49,4 @@ A self-sufficient test runner for UI5 applications enabling parallel execution o
|
|
|
49
49
|
* [Marian Zeis](https://github.com/marianfoo): Documentation page revamp [PR #54](https://github.com/ArnaudBuchholz/ui5-test-runner/pull/54)
|
|
50
50
|
* [Raj Singh](https://github.com/rajxsingh): Basic HTTP Authentication in Puppeteer [PR #71](https://github.com/ArnaudBuchholz/ui5-test-runner/pull/71)
|
|
51
51
|
* [Andreas Kunz](https://github.com/akudev): Improved documentation for TypeScript testing and reviewed `nyc` settings handling [PR #110](https://github.com/ArnaudBuchholz/ui5-test-runner/pull/110)
|
|
52
|
+
* [Juri Zeisler](https://github.com/juriz889): Added screenshots to the JUnit XML Report [PR #158](https://github.com/ArnaudBuchholz/ui5-test-runner/pull/158)
|
package/jest.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ui5-test-runner",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.0",
|
|
4
4
|
"description": "Standalone test runner for UI5",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"ui5-test-runner": "./index.js"
|
|
8
8
|
},
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public",
|
|
11
|
+
"provenance": true
|
|
12
|
+
},
|
|
9
13
|
"engines": {
|
|
10
14
|
"node": ">=18"
|
|
11
15
|
},
|
|
@@ -23,7 +27,8 @@
|
|
|
23
27
|
"test:text-report": "node ./src/defaults/text-report.js ./test/report",
|
|
24
28
|
"build:doc": "node build/doc",
|
|
25
29
|
"clean": "npm uninstall -g ui5-test-runner puppeteer nyc selenium-webdriver playwright webdriverio jsdom",
|
|
26
|
-
"update": "ncu -i --format group"
|
|
30
|
+
"update": "ncu -i --format group",
|
|
31
|
+
"semantic-release": "semantic-release"
|
|
27
32
|
},
|
|
28
33
|
"repository": {
|
|
29
34
|
"type": "git",
|
|
@@ -49,20 +54,22 @@
|
|
|
49
54
|
"pidtree": "^0.6.0",
|
|
50
55
|
"punybind": "^1.2.1",
|
|
51
56
|
"punyexpr": "1.2.0",
|
|
52
|
-
"reserve": "2.3.
|
|
57
|
+
"reserve": "2.3.4"
|
|
53
58
|
},
|
|
54
59
|
"devDependencies": {
|
|
55
|
-
"@openui5/types": "^1.
|
|
56
|
-
"@
|
|
57
|
-
"@ui5/
|
|
60
|
+
"@openui5/types": "^1.142.0",
|
|
61
|
+
"@semantic-release/npm": "^13.1.2",
|
|
62
|
+
"@ui5/cli": "^4.0.35",
|
|
63
|
+
"@ui5/middleware-code-coverage": "^2.0.2",
|
|
58
64
|
"dotenv": "^16.5.0",
|
|
59
65
|
"jest": "^29.7.0",
|
|
60
66
|
"nock": "^14.0.10",
|
|
61
67
|
"npm-check-updates": "^18.3.0",
|
|
62
68
|
"nyc": "^17.1.0",
|
|
63
|
-
"rimraf": "^6.0
|
|
69
|
+
"rimraf": "^6.1.0",
|
|
70
|
+
"semantic-release": "^25.0.2",
|
|
64
71
|
"standard": "^17.1.2",
|
|
65
|
-
"typescript": "^5.9.
|
|
72
|
+
"typescript": "^5.9.3",
|
|
66
73
|
"ui5-tooling-transpile": "^3.9.2"
|
|
67
74
|
},
|
|
68
75
|
"optionalDependencies": {
|
package/src/defaults/browser.js
CHANGED
|
@@ -158,9 +158,11 @@ module.exports = ({
|
|
|
158
158
|
'--disable-gpu',
|
|
159
159
|
'--disable-extensions',
|
|
160
160
|
'--log-level=3',
|
|
161
|
-
`--window-size=${options.viewportWidth},${options.viewportHeight}
|
|
162
|
-
`--lang=${options.language.join(',')}`
|
|
161
|
+
`--window-size=${options.viewportWidth},${options.viewportHeight}`
|
|
163
162
|
]
|
|
163
|
+
if (options.language) {
|
|
164
|
+
args.push(`--lang=${options.language.join(',')}`)
|
|
165
|
+
}
|
|
164
166
|
if (!options.visible) {
|
|
165
167
|
args.push('--headless=new')
|
|
166
168
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// Based on specification from llg[.]cubic[.]org/docs/junit/
|
|
4
4
|
|
|
5
|
-
const { join } = require('path')
|
|
5
|
+
const { join, basename } = require('path')
|
|
6
6
|
const { writeFile } = require('fs').promises
|
|
7
7
|
const [, , reportDir] = process.argv
|
|
8
8
|
|
|
@@ -47,6 +47,9 @@ async function main () {
|
|
|
47
47
|
time="${time}"`
|
|
48
48
|
}
|
|
49
49
|
>`)
|
|
50
|
+
if (test.screenshot) {
|
|
51
|
+
o(` <system-out>[[ATTACHMENT|${join(basename(reportDir), qunitPage.id, test.screenshot)}]]</system-out>`)
|
|
52
|
+
}
|
|
50
53
|
if (test.skip) {
|
|
51
54
|
o(' <skipped></skipped>')
|
|
52
55
|
} else if (!test.report) {
|
|
@@ -76,8 +76,15 @@ require('./browser')({
|
|
|
76
76
|
networkWriter
|
|
77
77
|
}) {
|
|
78
78
|
const browsers = require(modules.playwright)
|
|
79
|
+
const args = []
|
|
80
|
+
|
|
81
|
+
if (options.browser === 'chromium' && options.unsecure) {
|
|
82
|
+
args.push('--disable-web-security')
|
|
83
|
+
}
|
|
84
|
+
|
|
79
85
|
browser = await browsers[options.browser].launch({
|
|
80
|
-
headless: !options.visible
|
|
86
|
+
headless: !options.visible,
|
|
87
|
+
args
|
|
81
88
|
})
|
|
82
89
|
|
|
83
90
|
let recordVideo
|
|
@@ -10,12 +10,12 @@ module.exports = async ({
|
|
|
10
10
|
const chrome = require(join(settings.modules['selenium-webdriver'], 'chrome'))
|
|
11
11
|
|
|
12
12
|
const chromeOptions = new chrome.Options()
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const chromeArgs = options.chromeArgs()
|
|
14
|
+
for (const arg of chromeArgs) {
|
|
15
|
+
if (arg !== 'true') {
|
|
16
|
+
chromeOptions.addArguments(arg)
|
|
17
|
+
}
|
|
16
18
|
}
|
|
17
|
-
chromeOptions.addArguments('--start-maximized')
|
|
18
|
-
chromeOptions.addArguments('--disable-extensions')
|
|
19
19
|
chromeOptions.setLoggingPrefs(loggingPreferences)
|
|
20
20
|
if (options.binary) {
|
|
21
21
|
chromeOptions.setChromeBinaryPath(options.binary)
|
package/src/job.js
CHANGED
|
@@ -20,7 +20,8 @@ function buildArgs (parameters) {
|
|
|
20
20
|
const after = []
|
|
21
21
|
let browser = []
|
|
22
22
|
Object.keys(parameters).forEach(name => {
|
|
23
|
-
if (name === '--') {
|
|
23
|
+
if (name === '--' || name === 'browserArgs') {
|
|
24
|
+
browser = parameters[name]
|
|
24
25
|
return
|
|
25
26
|
}
|
|
26
27
|
const value = parameters[name]
|
|
@@ -41,9 +42,6 @@ function buildArgs (parameters) {
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
})
|
|
44
|
-
if (parameters['--']) {
|
|
45
|
-
browser = parameters['--']
|
|
46
|
-
}
|
|
47
45
|
const stringify = args => args.map(value => value.toString())
|
|
48
46
|
return {
|
|
49
47
|
before: stringify(before),
|
package/src/output.js
CHANGED
|
@@ -469,7 +469,7 @@ function build (job) {
|
|
|
469
469
|
},
|
|
470
470
|
|
|
471
471
|
failedToTerminateStartCommand () {
|
|
472
|
-
wrap(() => log(job, '⚠️ [STRTCT] Failed to terminate start command
|
|
472
|
+
wrap(() => log(job, '⚠️ [STRTCT] Failed to query and terminate all start command child processes, some may leak'))()
|
|
473
473
|
},
|
|
474
474
|
|
|
475
475
|
browserStart (url) {
|
package/src/report.js
CHANGED
|
@@ -7,8 +7,10 @@ const { filename, allocPromise } = require('./tools')
|
|
|
7
7
|
const { fork } = require('child_process')
|
|
8
8
|
const { getOutput } = require('./output')
|
|
9
9
|
|
|
10
|
-
async function
|
|
11
|
-
|
|
10
|
+
async function save (job) {
|
|
11
|
+
// Ensure the file is treated as CommonJS
|
|
12
|
+
await writeFile(join(job.reportDir, 'package.json'), '{"type": "commonjs"}')
|
|
13
|
+
await writeFile(join(job.reportDir, 'job.js'), `module.exports = ${JSON.stringify(job, (key, value) => {
|
|
12
14
|
if (value && value instanceof RegExp) {
|
|
13
15
|
return value.toString()
|
|
14
16
|
}
|
|
@@ -16,10 +18,6 @@ async function serialize (job, filename, json) {
|
|
|
16
18
|
}, 2)}`)
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
async function save (job) {
|
|
20
|
-
await serialize(job, 'job', job)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
21
|
function generateTextReport (job) {
|
|
24
22
|
const { promise, resolve } = allocPromise()
|
|
25
23
|
const childProcess = fork(
|
package/src/start.js
CHANGED
|
@@ -77,7 +77,13 @@ async function start (job) {
|
|
|
77
77
|
// eslint-disable-next-line no-unmodified-loop-condition
|
|
78
78
|
while (!startProcessExited && Date.now() - begin <= job.startTimeout) {
|
|
79
79
|
output.debug('start', `Getting start command ${startProcess.pid} child processes...`)
|
|
80
|
-
|
|
80
|
+
let childProcesses
|
|
81
|
+
try {
|
|
82
|
+
childProcesses = await pidtree(startProcess.pid, { advanced: true })
|
|
83
|
+
} catch (e) {
|
|
84
|
+
output.genericError(e)
|
|
85
|
+
break
|
|
86
|
+
}
|
|
81
87
|
output.debug('start', 'Child processes', JSON.stringify(childProcesses))
|
|
82
88
|
if (childProcesses.length === 0) {
|
|
83
89
|
try {
|
|
@@ -121,6 +127,7 @@ async function start (job) {
|
|
|
121
127
|
}
|
|
122
128
|
if (!startProcessExited) {
|
|
123
129
|
output.failedToTerminateStartCommand()
|
|
130
|
+
startProcess.kill()
|
|
124
131
|
}
|
|
125
132
|
}
|
|
126
133
|
|