ui5-test-runner 5.6.2 โ†’ 5.7.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/index.js CHANGED
@@ -109,18 +109,32 @@ async function main () {
109
109
  await probeBrowser(job)
110
110
  await notifyAndExecuteTests(job)
111
111
  if (job.watch) {
112
- delete job.start
113
112
  if (!job.watching) {
113
+ job.status = 'Watching...'
114
+ let running = false
115
+ let rerun = false
116
+ const run = async () => {
117
+ running = true
118
+ do {
119
+ rerun = false
120
+ await recreateDir(job.reportDir)
121
+ await notifyAndExecuteTests(job)
122
+ } while (rerun)
123
+ running = false
124
+ job.status = 'Watching...'
125
+ }
114
126
  output.watching(job.watchFolder)
115
127
  watch(job.watchFolder, { recursive: true }, async (eventType, filename) => {
116
128
  output.changeDetected(eventType, filename)
117
- if (!job.start) {
118
- await recreateDir(job.reportDir)
119
- notifyAndExecuteTests(job)
129
+ if (running) {
130
+ rerun = true
131
+ } else {
132
+ run()
120
133
  }
121
134
  })
122
135
  job.watching = true
123
136
  }
137
+ return
124
138
  } else if (job.keepAlive) {
125
139
  job.status = 'Serving'
126
140
  return
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui5-test-runner",
3
- "version": "5.6.2",
3
+ "version": "5.7.0",
4
4
  "description": "Standalone test runner for UI5",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -48,20 +48,20 @@
48
48
  "ps-tree": "^1.2.0",
49
49
  "punybind": "^1.2.1",
50
50
  "punyexpr": "^1.0.4",
51
- "reserve": "2.1.0"
51
+ "reserve": "2.2.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@openui5/types": "^1.134.0",
54
+ "@openui5/types": "^1.135.0",
55
55
  "@ui5/cli": "^4.0.14",
56
56
  "@ui5/middleware-code-coverage": "^2.0.1",
57
- "dotenv": "^16.4.7",
57
+ "dotenv": "^16.5.0",
58
58
  "jest": "^29.7.0",
59
- "nock": "^14.0.1",
59
+ "nock": "^14.0.3",
60
60
  "nyc": "^17.1.0",
61
61
  "rimraf": "^6.0.1",
62
62
  "standard": "^17.1.2",
63
- "typescript": "^5.8.2",
64
- "ui5-tooling-transpile": "^3.7.3"
63
+ "typescript": "^5.8.3",
64
+ "ui5-tooling-transpile": "^3.7.5"
65
65
  },
66
66
  "optionalDependencies": {
67
67
  "fsevents": "^2.3.3"
package/src/browsers.js CHANGED
@@ -131,7 +131,7 @@ async function start (job, url, scripts = []) {
131
131
  }
132
132
  if (resolvedScripts.length) {
133
133
  resolvedScripts.unshift(`(function () {
134
- window['ui5-test-runner/base-host'] = 'http://${job.callbackHost}:${job.port}'
134
+ window['ui5-test-runner/base-host'] = 'http://${job.localhost}:${job.port}'
135
135
  }())`)
136
136
  }
137
137
  const progress = newProgress(job, url)
package/src/csv-writer.js CHANGED
@@ -4,6 +4,9 @@ const { writeFile } = require('fs/promises')
4
4
 
5
5
  const append = (fileName, line) => writeFile(fileName, line + '\n', { flag: 'a+' })
6
6
  const escape = value => {
7
+ if (value === undefined) {
8
+ return 'โ“'
9
+ }
7
10
  const stringValue = value.toString()
8
11
  if (stringValue.match(/\r|\n|\t|"/)) {
9
12
  return JSON.stringify(stringValue)
@@ -77,6 +77,7 @@ require('./browser')({
77
77
  if (driver && settings.capabilities.traces.includes('console')) {
78
78
  const logs = await driver.manage().logs().get(logging.Type.BROWSER)
79
79
  const logLevelMapping = {
80
+ DEBUG: 'debug',
80
81
  INFO: 'log',
81
82
  WARNING: 'warning',
82
83
  SEVERE: 'error'
package/src/job.js CHANGED
@@ -79,7 +79,7 @@ function getCommand (cwd) {
79
79
 
80
80
  const DEBUG_OPTION = '(๐Ÿž for debugging purpose)'
81
81
  const EXPERIMENTAL_OPTION = '[โš ๏ธ experimental]'
82
- const DANGEROURS_OPTION = '[๐Ÿ’ฃ use carefully]'
82
+ const DANGEROUS_OPTION = '[๐Ÿ’ฃ use carefully]'
83
83
 
84
84
  command
85
85
  .name(name)
@@ -112,7 +112,7 @@ function getCommand (cwd) {
112
112
  .option('-oi, --output-interval <interval>', '[๐Ÿ’ป๐Ÿ”—๐Ÿงช๐Ÿ“ก] Interval for reporting progress on non interactive output (CI/CD) (0 means no output)', timeout, 30000)
113
113
  .option('--offline [flag]', '[๐Ÿ’ป๐Ÿ”—๐Ÿงช๐Ÿ“ก] Limit network usage (implies --no-npm-install)', boolean, false)
114
114
  .option('--env <name=value...>', '[๐Ÿ’ป๐Ÿ”—๐Ÿงช๐Ÿ“ก] Set environment variable', arrayOf(string))
115
- .option('--callback-host <host>', `[๐Ÿ’ป๐Ÿ”—๐Ÿงช๐Ÿ“ก] ${DANGEROURS_OPTION} Hostname for callbacks`, string, 'localhost')
115
+ .option('--localhost <host>', `[๐Ÿ’ป๐Ÿ”—๐Ÿงช๐Ÿ“ก] ${DANGEROUS_OPTION} Hostname for legacy URLs and callbacks`, string, 'localhost')
116
116
 
117
117
  // Common to legacy and url
118
118
  .option('--webapp <path>', '[๐Ÿ’ป๐Ÿ”—] Base folder of the web application (relative to cwd)', 'webapp')
package/src/tests.js CHANGED
@@ -132,7 +132,7 @@ async function process (job) {
132
132
  module.exports = {
133
133
  async execute (job) {
134
134
  if (job.mode !== 'url') {
135
- job.url = [`http://localhost:${job.port}/${job.testsuite}`]
135
+ job.url = [`http://${job.localhost}:${job.port}/${job.testsuite}`]
136
136
  } else if (!job.browserCapabilities.scripts) {
137
137
  throw UTRError.BROWSER_MISS_SCRIPTS_CAPABILITY()
138
138
  }