ui5-test-runner 5.10.1 → 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 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
@@ -9,7 +9,8 @@
9
9
  ],
10
10
  "collectCoverage": true,
11
11
  "collectCoverageFrom": [
12
- "src/*.js"
12
+ "src/*.js",
13
+ "src/defaults/junit-xml-report.js"
13
14
  ],
14
15
  "coveragePathIgnorePatterns": [
15
16
  "\\.spec\\.js",
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "ui5-test-runner",
3
- "version": "5.10.1",
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.3"
57
+ "reserve": "2.3.4"
53
58
  },
54
59
  "devDependencies": {
55
- "@openui5/types": "^1.140.0",
56
- "@ui5/cli": "^4.0.26",
57
- "@ui5/middleware-code-coverage": "^2.0.1",
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.1",
69
+ "rimraf": "^6.1.0",
70
+ "semantic-release": "^25.0.2",
64
71
  "standard": "^17.1.2",
65
- "typescript": "^5.9.2",
72
+ "typescript": "^5.9.3",
66
73
  "ui5-tooling-transpile": "^3.9.2"
67
74
  },
68
75
  "optionalDependencies": {
@@ -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) {
@@ -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
- if (!options.visible) {
14
- chromeOptions.addArguments('--headless=new')
15
- chromeOptions.addArguments('--log-level=3')
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)
@@ -30,7 +30,8 @@ require('./browser')({
30
30
  ['browser', 'chrome', 'firefox', 'edge'],
31
31
  'visible',
32
32
  ['-s, --server <server>', 'Selenium server URL', url],
33
- 'binary'
33
+ 'binary',
34
+ 'unsecure'
34
35
  ]
35
36
  },
36
37
 
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. This may cause issues with the shutdown'))()
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/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
- const childProcesses = await pidtree(startProcess.pid, { advanced: true })
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