ui5-test-runner 5.13.1 → 6.0.0-beta.2

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.
Files changed (186) hide show
  1. package/README.md +3 -2
  2. package/dist/Npm.js +80 -0
  3. package/dist/browsers/IBrowser.js +1 -0
  4. package/dist/browsers/factory.js +9 -0
  5. package/dist/browsers/puppeteer.js +158 -0
  6. package/dist/cli.js +20 -0
  7. package/dist/configuration/CommandLine.js +112 -0
  8. package/dist/configuration/Configuration.js +1 -0
  9. package/dist/configuration/ConfigurationValidator.js +79 -0
  10. package/dist/configuration/Option.js +1 -0
  11. package/dist/configuration/OptionValidationError.js +15 -0
  12. package/dist/configuration/indexedOptions.js +13 -0
  13. package/dist/configuration/options.js +191 -0
  14. package/dist/configuration/validators/OptionValidator.js +1 -0
  15. package/dist/configuration/validators/boolean.js +15 -0
  16. package/dist/configuration/validators/browser.js +11 -0
  17. package/dist/configuration/validators/fsEntry.js +70 -0
  18. package/dist/configuration/validators/index.js +20 -0
  19. package/dist/configuration/validators/integer.js +10 -0
  20. package/dist/configuration/validators/percent.js +17 -0
  21. package/dist/configuration/validators/regexp.js +20 -0
  22. package/dist/configuration/validators/string.js +7 -0
  23. package/dist/configuration/validators/timeout.js +24 -0
  24. package/dist/configuration/validators/url.js +8 -0
  25. package/dist/modes/ModeFunction.js +1 -0
  26. package/dist/modes/Modes.js +9 -0
  27. package/dist/modes/execute.js +27 -0
  28. package/dist/modes/help.js +3 -0
  29. package/dist/modes/log/ILogStorage.js +1 -0
  30. package/dist/modes/log/LogMetrics.js +9 -0
  31. package/dist/modes/log/LogReader.js +37 -0
  32. package/dist/modes/log/LogStorage.js +68 -0
  33. package/dist/modes/log/REserve.js +101 -0
  34. package/dist/modes/log/index.js +58 -0
  35. package/dist/modes/test/REserve.js +31 -0
  36. package/dist/modes/test/agent.js +8 -0
  37. package/dist/modes/test/browser.js +37 -0
  38. package/dist/modes/test/index.js +66 -0
  39. package/dist/modes/test/pageTask.js +145 -0
  40. package/dist/modes/test/report.js +3 -0
  41. package/dist/modes/test/server.js +109 -0
  42. package/dist/modes/version.js +11 -0
  43. package/dist/platform/Exit.js +139 -0
  44. package/dist/platform/FileSystem.js +13 -0
  45. package/dist/platform/Host.js +10 -0
  46. package/dist/platform/Http.js +38 -0
  47. package/dist/platform/Path.js +5 -0
  48. package/dist/platform/Process.js +133 -0
  49. package/dist/platform/Terminal.js +47 -0
  50. package/dist/platform/Thread.js +43 -0
  51. package/dist/platform/ZLib.js +7 -0
  52. package/dist/platform/assert.js +17 -0
  53. package/dist/platform/constants.js +5 -0
  54. package/dist/platform/environment.js +28 -0
  55. package/dist/platform/index.js +13 -0
  56. package/dist/platform/logger/ILogger.js +1 -0
  57. package/dist/platform/logger/allCompressed.js +54 -0
  58. package/dist/platform/logger/compress.js +277 -0
  59. package/dist/platform/logger/output/BaseLoggerOutput.js +158 -0
  60. package/dist/platform/logger/output/InteractiveLoggerOutput.js +102 -0
  61. package/dist/platform/logger/output/StaticLoggerOutput.js +32 -0
  62. package/dist/platform/logger/output/factory.js +10 -0
  63. package/dist/platform/logger/output.js +58 -0
  64. package/dist/platform/logger/proxy.js +6 -0
  65. package/dist/platform/logger/toInternalLogAttributes.js +22 -0
  66. package/dist/platform/logger/types.js +7 -0
  67. package/dist/platform/logger.js +138 -0
  68. package/dist/platform/mock.js +104 -0
  69. package/dist/platform/version.js +8 -0
  70. package/dist/platform/workerBootstrap.js +21 -0
  71. package/dist/reports/html.js +46 -0
  72. package/dist/types/AgentState.js +1 -0
  73. package/dist/types/CommonTestReportFormat.js +50 -0
  74. package/dist/types/IError.js +1 -0
  75. package/dist/types/IUserInterfaceController.js +1 -0
  76. package/dist/types/typeUtilities.js +1 -0
  77. package/dist/ui/agent.js +3 -0
  78. package/dist/ui/html-report.js +2 -0
  79. package/dist/ui/lib.js +1 -0
  80. package/dist/ui/log-viewer.js +2 -0
  81. package/dist/utils/node/Folder.js +28 -0
  82. package/dist/utils/node/FramedStreamReader.js +86 -0
  83. package/dist/utils/node/FramedStreamWriter.js +27 -0
  84. package/dist/utils/shared/ProgressBar.js +43 -0
  85. package/dist/utils/shared/TestReportBuilder.js +48 -0
  86. package/dist/utils/shared/memoize.js +19 -0
  87. package/dist/utils/shared/object.js +8 -0
  88. package/dist/utils/shared/parallelize.js +59 -0
  89. package/dist/utils/shared/string.js +23 -0
  90. package/dist/utils/shared/toIError.js +17 -0
  91. package/package.json +73 -50
  92. package/.releaserc +0 -5
  93. package/index.js +0 -175
  94. package/jest.config.json +0 -31
  95. package/src/add-test-pages.js +0 -67
  96. package/src/batch.js +0 -214
  97. package/src/browsers.js +0 -319
  98. package/src/capabilities/index.js +0 -204
  99. package/src/capabilities/tests/basic/iframe.html +0 -8
  100. package/src/capabilities/tests/basic/index.html +0 -12
  101. package/src/capabilities/tests/basic/index.js +0 -20
  102. package/src/capabilities/tests/basic/ui5.html +0 -24
  103. package/src/capabilities/tests/dynamic-include/index.js +0 -21
  104. package/src/capabilities/tests/dynamic-include/mix.html +0 -11
  105. package/src/capabilities/tests/dynamic-include/one.html +0 -11
  106. package/src/capabilities/tests/dynamic-include/post.js +0 -3
  107. package/src/capabilities/tests/dynamic-include/test.js +0 -1
  108. package/src/capabilities/tests/dynamic-include/two.html +0 -11
  109. package/src/capabilities/tests/index.js +0 -16
  110. package/src/capabilities/tests/local-storage/index.html +0 -16
  111. package/src/capabilities/tests/local-storage/index.js +0 -21
  112. package/src/capabilities/tests/screenshot/index.html +0 -23
  113. package/src/capabilities/tests/screenshot/index.js +0 -24
  114. package/src/capabilities/tests/scripts/coverage.html +0 -32
  115. package/src/capabilities/tests/scripts/iframe.html +0 -18
  116. package/src/capabilities/tests/scripts/index.js +0 -59
  117. package/src/capabilities/tests/scripts/qunit.html +0 -22
  118. package/src/capabilities/tests/scripts/testsuite.html +0 -10
  119. package/src/capabilities/tests/scripts/testsuite.js +0 -8
  120. package/src/capabilities/tests/timeout/index.html +0 -21
  121. package/src/capabilities/tests/timeout/index.js +0 -19
  122. package/src/capabilities/tests/traces/index.html +0 -18
  123. package/src/capabilities/tests/traces/index.js +0 -81
  124. package/src/capabilities/tests/ui5/focus.html +0 -89
  125. package/src/capabilities/tests/ui5/index.js +0 -39
  126. package/src/capabilities/tests/ui5/language.html +0 -50
  127. package/src/capabilities/tests/ui5/timezone.html +0 -27
  128. package/src/clean.js +0 -22
  129. package/src/cors.js +0 -21
  130. package/src/coverage.js +0 -384
  131. package/src/csv-reader.js +0 -36
  132. package/src/csv-writer.js +0 -55
  133. package/src/defaults/.nycrc.json +0 -4
  134. package/src/defaults/browser.js +0 -217
  135. package/src/defaults/happy-dom.js +0 -123
  136. package/src/defaults/jsdom/compatibility.js +0 -163
  137. package/src/defaults/jsdom/debug.js +0 -23
  138. package/src/defaults/jsdom/resource-loader.js +0 -44
  139. package/src/defaults/jsdom/sap.ui.test.matchers.visible.js +0 -39
  140. package/src/defaults/jsdom.js +0 -95
  141. package/src/defaults/json-report.js +0 -36
  142. package/src/defaults/junit-xml-report.js +0 -90
  143. package/src/defaults/playwright.js +0 -142
  144. package/src/defaults/puppeteer.js +0 -124
  145. package/src/defaults/report/common.js +0 -38
  146. package/src/defaults/report/decompress.js +0 -19
  147. package/src/defaults/report/default.html +0 -99
  148. package/src/defaults/report/main.js +0 -69
  149. package/src/defaults/report/progress.js +0 -60
  150. package/src/defaults/report/styles.css +0 -66
  151. package/src/defaults/report.js +0 -91
  152. package/src/defaults/scan-ui5.js +0 -26
  153. package/src/defaults/selenium-webdriver/chrome.js +0 -39
  154. package/src/defaults/selenium-webdriver/edge.js +0 -24
  155. package/src/defaults/selenium-webdriver/firefox.js +0 -30
  156. package/src/defaults/selenium-webdriver.js +0 -129
  157. package/src/defaults/text-report.js +0 -108
  158. package/src/defaults/webdriverio.js +0 -80
  159. package/src/end.js +0 -62
  160. package/src/endpoints.js +0 -219
  161. package/src/error.js +0 -54
  162. package/src/get-job-progress.js +0 -78
  163. package/src/handle.js +0 -43
  164. package/src/if.js +0 -10
  165. package/src/inject/jest2qunit.js +0 -289
  166. package/src/inject/opa-iframe-coverage.js +0 -22
  167. package/src/inject/post.js +0 -141
  168. package/src/inject/qunit-hooks.js +0 -107
  169. package/src/inject/qunit-redirect.js +0 -65
  170. package/src/inject/ui5-coverage.js +0 -33
  171. package/src/job-mode.js +0 -65
  172. package/src/job.js +0 -493
  173. package/src/npm.js +0 -136
  174. package/src/options.js +0 -95
  175. package/src/output.js +0 -739
  176. package/src/parallelize.js +0 -63
  177. package/src/qunit-hooks.js +0 -219
  178. package/src/report.js +0 -89
  179. package/src/reserve.js +0 -25
  180. package/src/start.js +0 -133
  181. package/src/symbols.js +0 -8
  182. package/src/tests.js +0 -183
  183. package/src/timeout.js +0 -53
  184. package/src/tools.js +0 -179
  185. package/src/ui5.js +0 -199
  186. package/src/unhandled.js +0 -32
@@ -1,142 +0,0 @@
1
- 'use strict'
2
-
3
- const { join } = require('path')
4
- const { exec } = require('child_process')
5
-
6
- let browser
7
- let context
8
- let page
9
-
10
- require('./browser')({
11
- metadata: {
12
- name: 'playwright',
13
- options: [
14
- ['browser', 'chromium', 'firefox', 'webkit'],
15
- 'visible',
16
- 'viewport',
17
- 'language',
18
- 'unsecure',
19
- ['-v, --video', 'Record video', false],
20
- ['-n, --har', 'Record network activity with har file', false]
21
- ]
22
- },
23
-
24
- async capabilities ({ settings, options }) {
25
- const capabilities = {
26
- modules: ['playwright'],
27
- screenshot: '.png',
28
- scripts: true,
29
- traces: ['console', 'network']
30
- }
31
- if (!settings.modules) {
32
- return {
33
- ...capabilities,
34
- 'probe-with-modules': true
35
- }
36
- }
37
- return await new Promise((resolve, reject) => {
38
- exec('npx playwright install', (err, stdout, stderr) => {
39
- console.log(stdout)
40
- console.error(stderr)
41
- if (err) {
42
- reject(new Error('Unable to finalize playwright installation'))
43
- } else {
44
- resolve(capabilities)
45
- }
46
- })
47
- })
48
- },
49
-
50
- async screenshot ({ filename }) {
51
- if (page) {
52
- await page.screenshot({
53
- path: filename,
54
- fullPage: true
55
- })
56
- return true
57
- }
58
- },
59
-
60
- async beforeExit () {
61
- if (page) {
62
- await page.close()
63
- }
64
- if (context) {
65
- await context.close()
66
- }
67
- if (browser) {
68
- await browser.close()
69
- }
70
- },
71
-
72
- async run ({
73
- settings: { url, scripts, modules, dir },
74
- options,
75
- consoleWriter,
76
- networkWriter
77
- }) {
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
-
85
- browser = await browsers[options.browser].launch({
86
- headless: !options.visible,
87
- args
88
- })
89
-
90
- let recordVideo
91
- if (options.video) {
92
- recordVideo = {
93
- dir
94
- }
95
- }
96
-
97
- let recordHar
98
- if (options.har) {
99
- recordHar = {
100
- path: join(dir, 'network.har')
101
- }
102
- }
103
-
104
- context = await browser.newContext({
105
- viewport: {
106
- width: options.viewportWidth,
107
- height: options.viewportHeight
108
- },
109
- locale: options.language[0],
110
- bypassCSP: options.unsecure,
111
- ignoreHTTPSErrors: options.unsecure,
112
- recordVideo,
113
- recordHar
114
- })
115
-
116
- context.setDefaultNavigationTimeout(0)
117
-
118
- if (scripts && scripts.length) {
119
- for (const content of scripts) {
120
- await context.addInitScript({ content })
121
- }
122
- }
123
-
124
- page = await context.newPage()
125
-
126
- page
127
- .on('console', message => consoleWriter.append({
128
- type: message.type(),
129
- text: message.text()
130
- }))
131
- .on('response', response => {
132
- const request = response.request()
133
- networkWriter.append({
134
- method: request.method(),
135
- url: response.url(),
136
- status: response.status()
137
- })
138
- })
139
-
140
- await page.goto(url)
141
- }
142
- })
@@ -1,124 +0,0 @@
1
- 'use strict'
2
-
3
- let browser
4
- let page
5
-
6
- console.time('⏲ run ')
7
-
8
- require('./browser')({
9
- metadata: {
10
- name: 'puppeteer',
11
- options: [
12
- 'visible',
13
- ['--firefox [flag]', 'Use firefox instead of chrome', false],
14
- 'binary',
15
- 'viewport',
16
- 'language',
17
- 'unsecure',
18
- ['--basic-auth-username <username>', 'Username for basic authentication', ''],
19
- ['--basic-auth-password <password>', 'Password for basic authentication', '']
20
- ]
21
- },
22
-
23
- async capabilities ({ settings, options }) {
24
- return {
25
- modules: ['puppeteer'],
26
- screenshot: '.png',
27
- scripts: !options.firefox,
28
- traces: ['console', 'network']
29
- }
30
- },
31
-
32
- async screenshot ({ filename }) {
33
- if (page) {
34
- await page.screenshot({
35
- path: filename,
36
- fullPage: true
37
- })
38
- return true
39
- }
40
- },
41
-
42
- async beforeExit () {
43
- if (page) {
44
- await page.close()
45
- }
46
- if (browser) {
47
- await browser.close()
48
- }
49
- },
50
-
51
- async run ({
52
- settings: { url, scripts, modules },
53
- options,
54
- consoleWriter,
55
- networkWriter
56
- }) {
57
- console.timeEnd('⏲ run ')
58
- console.time('⏲ require ')
59
- const puppeteer = require(modules.puppeteer)
60
- console.timeEnd('⏲ require ')
61
-
62
- let args = []
63
- let product
64
- if (options.firefox) {
65
- product = 'firefox'
66
- } else {
67
- args = options.chromeArgs()
68
- }
69
-
70
- console.time('⏲ launch ')
71
- browser = await puppeteer.launch({
72
- product,
73
- executablePath: options.binary,
74
- headless: options.visible ? false : 'new',
75
- defaultViewport: null,
76
- args
77
- })
78
- console.timeEnd('⏲ launch ')
79
-
80
- page = (await browser.pages())[0]
81
-
82
- if (options.unsecure) {
83
- await page.setBypassCSP(true)
84
- }
85
-
86
- if (options.basicAuthUsername || options.basicAuthPassword) {
87
- await page.authenticate({ username: options.basicAuthUsername, password: options.basicAuthPassword })
88
- }
89
-
90
- page
91
- .on('console', message => consoleWriter.append({
92
- type: message.type(),
93
- text: message.text()
94
- }))
95
- .on('response', response => {
96
- const request = response.request()
97
- networkWriter.append({
98
- method: request.method(),
99
- url: response.url(),
100
- status: response.status()
101
- })
102
- })
103
-
104
- console.time('⏲ scripts ')
105
- if (scripts && scripts.length) {
106
- for (const script of scripts) {
107
- await page.evaluateOnNewDocument(script)
108
- }
109
- }
110
- console.timeEnd('⏲ scripts ')
111
-
112
- await page.setDefaultNavigationTimeout(0)
113
- console.time('⏲ navigate ')
114
- await page.goto(url)
115
- console.timeEnd('⏲ navigate ')
116
- },
117
-
118
- async error ({ error: e, exit }) {
119
- // Lots of threads on this message but no clear solution
120
- if (e.message === 'Navigation failed because browser has disconnected!') {
121
- await exit(0)
122
- }
123
- }
124
- })
@@ -1,38 +0,0 @@
1
- (function () {
2
- /* global punybind, punyexpr */
3
-
4
- const report = {}
5
-
6
- report.elapsed = function (start, end = Date.now()) {
7
- if (typeof end === 'string') {
8
- end = new Date(end).getTime()
9
- }
10
- if (typeof start === 'string') {
11
- start = new Date(start).getTime()
12
- }
13
- const ms = end - start
14
- if (isNaN(ms)) {
15
- return '-'
16
- }
17
- if (ms > 5000) {
18
- const mins = Math.floor(ms / 60000)
19
- const secs = Math.floor((ms % 60000) / 1000)
20
- return `${mins.toString().padStart(2, 0)}:${secs.toString().padStart(2, 0)}`
21
- }
22
- return `${ms} ms`
23
- }
24
-
25
- let setReady
26
- report.ready = new Promise(resolve => {
27
- setReady = resolve
28
- })
29
-
30
- window.addEventListener('load', () => {
31
- const safebind = punybind.use({
32
- compiler: punyexpr
33
- })
34
- safebind(document.body).then(setReady)
35
- })
36
-
37
- window.report = report
38
- }())
@@ -1,19 +0,0 @@
1
- /* global DecompressionStream */
2
- /* eslint-disable-next-line no-unused-vars */
3
- async function decompress (base64) {
4
- const bin = atob(base64)
5
- const uint8Array = new Uint8Array(bin.length)
6
- for (let i = 0; i < bin.length; ++i) {
7
- uint8Array[i] = bin.charCodeAt(i)
8
- }
9
- const readableStream = new ReadableStream({
10
- start (ctl) {
11
- ctl.enqueue(uint8Array)
12
- ctl.close()
13
- }
14
- })
15
- const decompressionStream = new DecompressionStream('gzip')
16
- const decompressedStream = readableStream.pipeThrough(decompressionStream)
17
- const jsonString = await new Response(decompressedStream).text()
18
- return JSON.parse(jsonString)
19
- }
@@ -1,99 +0,0 @@
1
- <html>
2
- <head>
3
- <title>ui5-test-runner</title>
4
- <link rel="stylesheet" href="/_/report/styles.css">
5
- <script>window.module = window.module || {}</script>
6
- <script src="/_/punyexpr.js"></script>
7
- <script>window.punyexpr = module.exports.punyexpr</script>
8
- <script src="/_/punybind.js"></script>
9
- <script src="/_/report/common.js"></script>
10
- <script src="/_/report/main.js"></script>
11
- </head>
12
- <body>
13
- <div {{if}}="!(qunitPage || qunitTest)">
14
- <h1>{{ status || 'Test report' }}</h1>
15
- <div {{if}}="end === undefined" class="elapsed">In progress since {{ elapsed(start) }}</div>
16
- <div {{else}} class="elapsed">Duration : {{ elapsed(start, end) }} <a href="#" id="download">&#128230;</a></div>
17
- <div {{if}}="timedOut">
18
- &#9202;&#65039; Timed out
19
- </div>
20
- <table style="visibility: {{ testPageUrls.length > 0 ? 'visible' : 'hidden' }};">
21
- <tr>
22
- <th>&nbsp;</th>
23
- <th class="count">Type</th>
24
- <th class="status" style="width: 10rem;"><div><span>Status</span></div></th>
25
- <th class="count">Tests</th>
26
- <th class="count">Passed</th>
27
- <th class="count">Failed</th>
28
- <th class="elapsed">Elapsed</th>
29
- </tr>
30
- <tr {{for}}="url of testPageUrls">
31
- <td class="truncated">
32
- <span {{if}}="qunitPages === undefined || !qunitPages[url]">{{ url }}</span>
33
- <a {{else}} href="#{{ qunitPages[url].id }}">{{ url }}</a>
34
- </td>
35
- <td>
36
- <span {{if}}="!qunitPages[url]">-</span>
37
- <span {{elseif}}="qunitPages[url].isOpa" title="OPA test">&#129404;</span>
38
- <span {{elseif}}="qunitPages[url].start" title="Unit test">&#129514;</span>
39
- </td>
40
- <td>
41
- <span {{if}}="!qunitPages[url]">-</span>
42
- <span {{elseif}}="qunitPages[url].failed">&#10060;</span>
43
- <span {{elseif}}="qunitPages[url].end">&#10004;&#65039;</span>
44
- <span {{if}}="!qunitPages[url].end">
45
- <progress max="{{ qunitPages[url].count }}" value="{{ qunitPages[url].failed + qunitPages[url].passed }}"></progress>
46
- </span>
47
- </td>
48
- <td>{{ qunitPages[url] ? qunitPages[url].count : '-' }}</td>
49
- <td>{{ qunitPages[url] ? qunitPages[url].passed : '-' }}</td>
50
- <td>{{ qunitPages[url] ? qunitPages[url].failed : '-' }}</td>
51
- <td>
52
- <span {{if}}="!qunitPages[url]">-</span>
53
- <span {{elseif}}="qunitPages[url].end === undefined">{{ elapsed(qunitPages[url].start) }}</span>
54
- <span {{else}}>{{ elapsed(qunitPages[url].start, qunitPages[url].end) }}</span>
55
- </td>
56
- </tr>
57
- </table>
58
- </div>
59
- <div {{if}}="qunitPage">
60
- <h1 class="truncated">{{ qunitPage.url }}</h1>
61
- <a href="#">&#9204; back to report</a>
62
- <div {{if}}="qunitPage.end === undefined" class="elapsed">In progress since {{ elapsed(qunitPage.start) }}</div>
63
- <div {{else}} class="elapsed">Duration : {{ elapsed(qunitPage.start, qunitPage.end) }}</div>
64
- <div {{if}}="timedOut">
65
- &#9202;&#65039; Timed out
66
- </div>
67
- <div {{for}}="module of qunitPage.modules">
68
- <h2>{{ module.name }}</h2>
69
- <div {{for}}="test of module.tests">
70
- <a {{if}}="!test.skip" href="#{{ qunitPage.id }}-{{ test.testId }}">{{ test.name }}</a>
71
- <span {{else}}>{{ test.name }}</span>
72
- <span {{if}}="test.skip">&#9208;&#65039;</span>
73
- <span {{elseif}}="!test.end" class="elapsed">{{ elapsed(test.start) }}</span>
74
- <span {{elseif}}="test.report && !test.report.failed">&#10004;&#65039; {{ elapsed(test.start, test.end) }}</span>
75
- <span {{elseif}}="test.report">&#10060; {{ elapsed(test.start, test.end) }}</span>
76
- </div>
77
- </div>
78
- </div>
79
- <div {{elseif}}="qunitTest">
80
- <h1 class="truncated">{{ qunitTest.url }}</h1>
81
- <a href="#">&#9204; back to report</a>
82
- <h2>{{ qunitTest.module }}</h2>
83
- <a href="#{{ qunitTest.pageId }}">&#9204; back to page</a>
84
- <h3>{{ qunitTest.name }}
85
- <span {{if}}="qunitTest.report && qunitTest.report.passed">&#10004;&#65039;</span>
86
- <span {{elseif}}="qunitTest.report">&#10060;</span>
87
- </h3>
88
- <div {{if}}="qunitTest.end === undefined" class="elapsed">In progress since {{ elapsed(qunitTest.start) }}</div>
89
- <div {{else}} class="elapsed">Duration : {{ elapsed(qunitTest.start, qunitTest.end) }}</div>
90
- <div {{for}}="log of qunitTest.logs">
91
- <pre {{if}}="log.result">&#10004;&#65039; {{ log.message }}</pre>
92
- <pre {{else}}>&#10060; {{ log.message }}</pre>
93
- <img {{if}}="log.screenshot" loading="lazy" class="log" src="{{ qunitTest.pageId }}/{{ log.screenshot }}" alt="Copy folder '{{ qunitTest.pageId }}' from the job report">
94
- </div>
95
- <img {{if}}="qunitTest.screenshot" loading="lazy" class="log" src="{{ qunitTest.pageId }}/{{ qunitTest.screenshot }}" alt="Copy folder '{{ qunitTest.pageId }}' from the job report">
96
- </div>
97
- <div style="display: {{ disconnected ? 'block' : 'none' }};">&#10060; Disconnected</div>
98
- </body>
99
- </html>
@@ -1,69 +0,0 @@
1
- /* global report, job */
2
- report.ready.then(update => {
3
- const hashChange = hash => {
4
- const [, pageId, testId] = (hash || '').match(/#?([^-]*)(?:-(.*))?/)
5
- let [qunitPage, qunitTest] = [null, null]
6
- if (pageId) {
7
- const url = Object.keys(job.qunitPages).find(pageUrl => job.qunitPages[pageUrl].id === pageId)
8
- if (!url) {
9
- return
10
- }
11
- qunitPage = { url, ...job.qunitPages[url] }
12
- if (testId) {
13
- let test
14
- let moduleName
15
- qunitPage.modules.every(module => module.tests.every(candidate => {
16
- if (candidate.testId === testId) {
17
- moduleName = module.name
18
- test = candidate
19
- return false
20
- }
21
- return true
22
- }))
23
- qunitPage = null
24
- if (test) {
25
- qunitTest = {
26
- url,
27
- pageId,
28
- module: moduleName,
29
- ...test
30
- }
31
- }
32
- }
33
- }
34
- update({
35
- ...job,
36
- qunitPage,
37
- qunitTest,
38
- elapsed: report.elapsed
39
- })
40
- }
41
-
42
- window.addEventListener('hashchange', () => {
43
- hashChange(location.hash)
44
- })
45
- if (window.location.href === 'about:srcdoc') {
46
- window.addEventListener('click', (event) => {
47
- const { href } = event.target
48
- if (href) {
49
- const lastHash = href.lastIndexOf('#')
50
- hashChange(href.substring(lastHash))
51
- }
52
- event.preventDefault()
53
- return false
54
- })
55
- }
56
- hashChange(location.hash)
57
-
58
- window.addEventListener('click', (event) => {
59
- if (event.target.id === 'download') {
60
- const link = this.document.createElement('a')
61
- const blob = new Blob([JSON.stringify(job)], {
62
- type: 'application/json'
63
- })
64
- link.setAttribute('href', URL.createObjectURL(blob))
65
- link.setAttribute('download', 'ui5-test-runner-job.json')
66
- link.click()
67
- }
68
- })
69
- })
@@ -1,60 +0,0 @@
1
- (function () {
2
- /* global report */
3
-
4
- report.ready.then(update => {
5
- let lastState = {}
6
-
7
- async function retry () {
8
- try {
9
- await fetch('/_/progress', { method: 'INFO' })
10
- location.hash = ''
11
- refresh()
12
- } catch (e) {
13
- setTimeout(retry, 250)
14
- }
15
- }
16
-
17
- async function refresh () {
18
- const [, page, test] = location.hash.match(/#?([^-]*)(?:-(.*))?/)
19
- let url = '/_/progress'
20
- if (page) {
21
- url += `?page=${page}`
22
- if (test) {
23
- url += `&test=${test}`
24
- }
25
- }
26
- let json
27
- try {
28
- const response = await fetch(url)
29
- json = await response.json()
30
- } catch (e) {
31
- update({
32
- ...lastState,
33
- disconnected: true
34
- })
35
- retry()
36
- return
37
- }
38
- if (test) {
39
- lastState = {
40
- qunitTest: json
41
- }
42
- } else if (page) {
43
- lastState = {
44
- qunitPage: json
45
- }
46
- } else {
47
- lastState = {
48
- ...json
49
- }
50
- }
51
- update({
52
- ...lastState,
53
- disconnected: false,
54
- elapsed: report.elapsed
55
- })
56
- setTimeout(refresh, 250)
57
- }
58
- refresh()
59
- })
60
- }())
@@ -1,66 +0,0 @@
1
- body {
2
- font-family: "Segoe UI", Arial, sans-serif;
3
- }
4
-
5
- h1 {
6
- margin-bottom: 0;
7
- }
8
-
9
- h2 {
10
- margin-bottom: 0;
11
- }
12
-
13
- h3 {
14
- margin-bottom: 0;
15
- }
16
-
17
- progress {
18
- width: 5rem;
19
- }
20
-
21
- th {
22
- text-align: left;
23
- }
24
-
25
- th.count {
26
- width: 5rem;
27
- }
28
-
29
- th.elapsed {
30
- width: 6rem;
31
- }
32
-
33
- th.status {
34
- width: 10rem;
35
- }
36
-
37
- a, a:hover {
38
- color: black;
39
- text-decoration: none;
40
- }
41
-
42
- a:hover {
43
- text-decoration: underline;
44
- text-decoration-style: dotted;
45
- }
46
-
47
- table {
48
- table-layout: fixed;
49
- width: 100%;
50
- }
51
-
52
- .truncated {
53
- overflow: hidden;
54
- text-overflow: ellipsis;
55
- white-space: nowrap;
56
- direction: rtl;
57
- text-align: left;
58
- }
59
-
60
- img.log {
61
- width: 50%;
62
- }
63
-
64
- img.log:hover {
65
- width: unset;
66
- }