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.
- package/README.md +3 -2
- package/dist/Npm.js +80 -0
- package/dist/browsers/IBrowser.js +1 -0
- package/dist/browsers/factory.js +9 -0
- package/dist/browsers/puppeteer.js +158 -0
- package/dist/cli.js +20 -0
- package/dist/configuration/CommandLine.js +112 -0
- package/dist/configuration/Configuration.js +1 -0
- package/dist/configuration/ConfigurationValidator.js +79 -0
- package/dist/configuration/Option.js +1 -0
- package/dist/configuration/OptionValidationError.js +15 -0
- package/dist/configuration/indexedOptions.js +13 -0
- package/dist/configuration/options.js +191 -0
- package/dist/configuration/validators/OptionValidator.js +1 -0
- package/dist/configuration/validators/boolean.js +15 -0
- package/dist/configuration/validators/browser.js +11 -0
- package/dist/configuration/validators/fsEntry.js +70 -0
- package/dist/configuration/validators/index.js +20 -0
- package/dist/configuration/validators/integer.js +10 -0
- package/dist/configuration/validators/percent.js +17 -0
- package/dist/configuration/validators/regexp.js +20 -0
- package/dist/configuration/validators/string.js +7 -0
- package/dist/configuration/validators/timeout.js +24 -0
- package/dist/configuration/validators/url.js +8 -0
- package/dist/modes/ModeFunction.js +1 -0
- package/dist/modes/Modes.js +9 -0
- package/dist/modes/execute.js +27 -0
- package/dist/modes/help.js +3 -0
- package/dist/modes/log/ILogStorage.js +1 -0
- package/dist/modes/log/LogMetrics.js +9 -0
- package/dist/modes/log/LogReader.js +37 -0
- package/dist/modes/log/LogStorage.js +68 -0
- package/dist/modes/log/REserve.js +101 -0
- package/dist/modes/log/index.js +58 -0
- package/dist/modes/test/REserve.js +31 -0
- package/dist/modes/test/agent.js +8 -0
- package/dist/modes/test/browser.js +37 -0
- package/dist/modes/test/index.js +66 -0
- package/dist/modes/test/pageTask.js +145 -0
- package/dist/modes/test/report.js +3 -0
- package/dist/modes/test/server.js +109 -0
- package/dist/modes/version.js +11 -0
- package/dist/platform/Exit.js +139 -0
- package/dist/platform/FileSystem.js +13 -0
- package/dist/platform/Host.js +10 -0
- package/dist/platform/Http.js +38 -0
- package/dist/platform/Path.js +5 -0
- package/dist/platform/Process.js +133 -0
- package/dist/platform/Terminal.js +47 -0
- package/dist/platform/Thread.js +43 -0
- package/dist/platform/ZLib.js +7 -0
- package/dist/platform/assert.js +17 -0
- package/dist/platform/constants.js +5 -0
- package/dist/platform/environment.js +28 -0
- package/dist/platform/index.js +13 -0
- package/dist/platform/logger/ILogger.js +1 -0
- package/dist/platform/logger/allCompressed.js +54 -0
- package/dist/platform/logger/compress.js +277 -0
- package/dist/platform/logger/output/BaseLoggerOutput.js +158 -0
- package/dist/platform/logger/output/InteractiveLoggerOutput.js +102 -0
- package/dist/platform/logger/output/StaticLoggerOutput.js +32 -0
- package/dist/platform/logger/output/factory.js +10 -0
- package/dist/platform/logger/output.js +58 -0
- package/dist/platform/logger/proxy.js +6 -0
- package/dist/platform/logger/toInternalLogAttributes.js +22 -0
- package/dist/platform/logger/types.js +7 -0
- package/dist/platform/logger.js +138 -0
- package/dist/platform/mock.js +104 -0
- package/dist/platform/version.js +8 -0
- package/dist/platform/workerBootstrap.js +21 -0
- package/dist/reports/html.js +46 -0
- package/dist/types/AgentState.js +1 -0
- package/dist/types/CommonTestReportFormat.js +50 -0
- package/dist/types/IError.js +1 -0
- package/dist/types/IUserInterfaceController.js +1 -0
- package/dist/types/typeUtilities.js +1 -0
- package/dist/ui/agent.js +3 -0
- package/dist/ui/html-report.js +2 -0
- package/dist/ui/lib.js +1 -0
- package/dist/ui/log-viewer.js +2 -0
- package/dist/utils/node/Folder.js +28 -0
- package/dist/utils/node/FramedStreamReader.js +86 -0
- package/dist/utils/node/FramedStreamWriter.js +27 -0
- package/dist/utils/shared/ProgressBar.js +43 -0
- package/dist/utils/shared/TestReportBuilder.js +48 -0
- package/dist/utils/shared/memoize.js +19 -0
- package/dist/utils/shared/object.js +8 -0
- package/dist/utils/shared/parallelize.js +59 -0
- package/dist/utils/shared/string.js +23 -0
- package/dist/utils/shared/toIError.js +17 -0
- package/package.json +73 -50
- package/.releaserc +0 -5
- package/index.js +0 -175
- package/jest.config.json +0 -31
- package/src/add-test-pages.js +0 -67
- package/src/batch.js +0 -214
- package/src/browsers.js +0 -319
- package/src/capabilities/index.js +0 -204
- package/src/capabilities/tests/basic/iframe.html +0 -8
- package/src/capabilities/tests/basic/index.html +0 -12
- package/src/capabilities/tests/basic/index.js +0 -20
- package/src/capabilities/tests/basic/ui5.html +0 -24
- package/src/capabilities/tests/dynamic-include/index.js +0 -21
- package/src/capabilities/tests/dynamic-include/mix.html +0 -11
- package/src/capabilities/tests/dynamic-include/one.html +0 -11
- package/src/capabilities/tests/dynamic-include/post.js +0 -3
- package/src/capabilities/tests/dynamic-include/test.js +0 -1
- package/src/capabilities/tests/dynamic-include/two.html +0 -11
- package/src/capabilities/tests/index.js +0 -16
- package/src/capabilities/tests/local-storage/index.html +0 -16
- package/src/capabilities/tests/local-storage/index.js +0 -21
- package/src/capabilities/tests/screenshot/index.html +0 -23
- package/src/capabilities/tests/screenshot/index.js +0 -24
- package/src/capabilities/tests/scripts/coverage.html +0 -32
- package/src/capabilities/tests/scripts/iframe.html +0 -18
- package/src/capabilities/tests/scripts/index.js +0 -59
- package/src/capabilities/tests/scripts/qunit.html +0 -22
- package/src/capabilities/tests/scripts/testsuite.html +0 -10
- package/src/capabilities/tests/scripts/testsuite.js +0 -8
- package/src/capabilities/tests/timeout/index.html +0 -21
- package/src/capabilities/tests/timeout/index.js +0 -19
- package/src/capabilities/tests/traces/index.html +0 -18
- package/src/capabilities/tests/traces/index.js +0 -81
- package/src/capabilities/tests/ui5/focus.html +0 -89
- package/src/capabilities/tests/ui5/index.js +0 -39
- package/src/capabilities/tests/ui5/language.html +0 -50
- package/src/capabilities/tests/ui5/timezone.html +0 -27
- package/src/clean.js +0 -22
- package/src/cors.js +0 -21
- package/src/coverage.js +0 -384
- package/src/csv-reader.js +0 -36
- package/src/csv-writer.js +0 -55
- package/src/defaults/.nycrc.json +0 -4
- package/src/defaults/browser.js +0 -217
- package/src/defaults/happy-dom.js +0 -123
- package/src/defaults/jsdom/compatibility.js +0 -163
- package/src/defaults/jsdom/debug.js +0 -23
- package/src/defaults/jsdom/resource-loader.js +0 -44
- package/src/defaults/jsdom/sap.ui.test.matchers.visible.js +0 -39
- package/src/defaults/jsdom.js +0 -95
- package/src/defaults/json-report.js +0 -36
- package/src/defaults/junit-xml-report.js +0 -90
- package/src/defaults/playwright.js +0 -142
- package/src/defaults/puppeteer.js +0 -124
- package/src/defaults/report/common.js +0 -38
- package/src/defaults/report/decompress.js +0 -19
- package/src/defaults/report/default.html +0 -99
- package/src/defaults/report/main.js +0 -69
- package/src/defaults/report/progress.js +0 -60
- package/src/defaults/report/styles.css +0 -66
- package/src/defaults/report.js +0 -91
- package/src/defaults/scan-ui5.js +0 -26
- package/src/defaults/selenium-webdriver/chrome.js +0 -39
- package/src/defaults/selenium-webdriver/edge.js +0 -24
- package/src/defaults/selenium-webdriver/firefox.js +0 -30
- package/src/defaults/selenium-webdriver.js +0 -129
- package/src/defaults/text-report.js +0 -108
- package/src/defaults/webdriverio.js +0 -80
- package/src/end.js +0 -62
- package/src/endpoints.js +0 -219
- package/src/error.js +0 -54
- package/src/get-job-progress.js +0 -78
- package/src/handle.js +0 -43
- package/src/if.js +0 -10
- package/src/inject/jest2qunit.js +0 -289
- package/src/inject/opa-iframe-coverage.js +0 -22
- package/src/inject/post.js +0 -141
- package/src/inject/qunit-hooks.js +0 -107
- package/src/inject/qunit-redirect.js +0 -65
- package/src/inject/ui5-coverage.js +0 -33
- package/src/job-mode.js +0 -65
- package/src/job.js +0 -493
- package/src/npm.js +0 -136
- package/src/options.js +0 -95
- package/src/output.js +0 -739
- package/src/parallelize.js +0 -63
- package/src/qunit-hooks.js +0 -219
- package/src/report.js +0 -89
- package/src/reserve.js +0 -25
- package/src/start.js +0 -133
- package/src/symbols.js +0 -8
- package/src/tests.js +0 -183
- package/src/timeout.js +0 -53
- package/src/tools.js +0 -179
- package/src/ui5.js +0 -199
- package/src/unhandled.js +0 -32
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const assert = require('assert')
|
|
4
|
-
|
|
5
|
-
module.exports = [{
|
|
6
|
-
label: 'Local storage (1)',
|
|
7
|
-
url: 'local-storage/index.html?value=1',
|
|
8
|
-
endpoint: ({ body }) => {
|
|
9
|
-
const { initial, modified } = body
|
|
10
|
-
assert.ok(initial === undefined, 'The local storage starts empty')
|
|
11
|
-
assert.ok(modified === '1', 'The local storage can be used')
|
|
12
|
-
}
|
|
13
|
-
}, {
|
|
14
|
-
label: 'Local storage (2)',
|
|
15
|
-
url: 'local-storage/index.html?value=2',
|
|
16
|
-
endpoint: ({ body }) => {
|
|
17
|
-
const { initial, modified } = body
|
|
18
|
-
assert.ok(initial === undefined, 'The local storage starts empty')
|
|
19
|
-
assert.ok(modified === '2', 'The local storage can be used')
|
|
20
|
-
}
|
|
21
|
-
}]
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<body>
|
|
4
|
-
<H1>screenshot</H1>
|
|
5
|
-
<p>Checks if the browser supports screenshot</p>
|
|
6
|
-
<input type="text" id="first" value="first">
|
|
7
|
-
<input type="text" id="second" value="second">
|
|
8
|
-
<span style="font-size: 32rem;">😉</span>
|
|
9
|
-
<script src="/inject/post.js"></script>
|
|
10
|
-
<script>
|
|
11
|
-
document.getElementById('first').focus()
|
|
12
|
-
const post = window['ui5-test-runner/post']
|
|
13
|
-
post('/_/log', { step:'screenshot' })
|
|
14
|
-
.then(() => {
|
|
15
|
-
const current = document.activeElement
|
|
16
|
-
return post('/_/log', {
|
|
17
|
-
step: 'focus',
|
|
18
|
-
current: current ? current.id : ''
|
|
19
|
-
})
|
|
20
|
-
})
|
|
21
|
-
</script>
|
|
22
|
-
</body>
|
|
23
|
-
</html>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const assert = require('assert')
|
|
4
|
-
const { screenshot } = require('../../../browsers')
|
|
5
|
-
const { stat } = require('fs/promises')
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
label: 'Screenshot',
|
|
9
|
-
for: capabilities => !!capabilities.screenshot,
|
|
10
|
-
url: 'screenshot/index.html',
|
|
11
|
-
endpoint: async function ({ body: { step, current } }, url) {
|
|
12
|
-
const { job } = this
|
|
13
|
-
if (step === 'screenshot') {
|
|
14
|
-
const fileName = await screenshot(job, url, 'screenshot')
|
|
15
|
-
const fileInfo = await stat(fileName)
|
|
16
|
-
assert.ok(fileInfo.isFile(), 'The file was generated')
|
|
17
|
-
assert.ok(fileInfo.size > 1024, 'The file contains something')
|
|
18
|
-
return false
|
|
19
|
-
} else {
|
|
20
|
-
assert.strictEqual(current, 'first')
|
|
21
|
-
return true
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<body>
|
|
4
|
-
<h1>Coverage in an iframe</h1>
|
|
5
|
-
<p>Checks if the coverage information can be hooked in the iframe</p>
|
|
6
|
-
<script>
|
|
7
|
-
// As generated by Istanbul
|
|
8
|
-
function cov_1y52ey2l1c() {
|
|
9
|
-
var global = new Function("return this")();
|
|
10
|
-
var gcv = "__coverage__";
|
|
11
|
-
var path = "coverage.html";
|
|
12
|
-
var coverageData = {
|
|
13
|
-
path: path,
|
|
14
|
-
_coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
|
|
15
|
-
hash: "55ef335c1997f49832eb59e4836d886c3923dbfb",
|
|
16
|
-
status: "ko"
|
|
17
|
-
};
|
|
18
|
-
var coverage = global[gcv] || (global[gcv] = {});
|
|
19
|
-
if (!coverage[path] || coverage[path].hash !== hash) {
|
|
20
|
-
coverage[path] = coverageData;
|
|
21
|
-
}
|
|
22
|
-
var actualCoverage = coverage[path];
|
|
23
|
-
{// @ts-ignore
|
|
24
|
-
cov_1y52ey2l1c = function () { return actualCoverage; };
|
|
25
|
-
}
|
|
26
|
-
return actualCoverage;
|
|
27
|
-
}
|
|
28
|
-
cov_1y52ey2l1c();
|
|
29
|
-
cov_1y52ey2l1c().status = "ok";
|
|
30
|
-
</script>
|
|
31
|
-
</body>
|
|
32
|
-
</html>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>IFrame Coverage</title>
|
|
5
|
-
</head>
|
|
6
|
-
<body>
|
|
7
|
-
<h1>IFrame Coverage</h1>
|
|
8
|
-
<p>Checks if the coverage information can be extracted from the iframe</p>
|
|
9
|
-
<iframe src="coverage.html"></iframe>
|
|
10
|
-
<script>
|
|
11
|
-
document.querySelector('iframe').addEventListener('load', () => {
|
|
12
|
-
const xhr = new XMLHttpRequest()
|
|
13
|
-
xhr.open('POST', '/_/log')
|
|
14
|
-
xhr.send(JSON.stringify(window.__coverage__ || {}))
|
|
15
|
-
})
|
|
16
|
-
</script>
|
|
17
|
-
</body>
|
|
18
|
-
</html>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const assert = require('assert')
|
|
4
|
-
|
|
5
|
-
function qUnitEndpoints (data) {
|
|
6
|
-
const { endpoint } = data
|
|
7
|
-
if (!this.calls) {
|
|
8
|
-
this.calls = {}
|
|
9
|
-
}
|
|
10
|
-
if (!this.calls[endpoint]) {
|
|
11
|
-
this.calls[endpoint] = 1
|
|
12
|
-
} else {
|
|
13
|
-
++this.calls[endpoint]
|
|
14
|
-
}
|
|
15
|
-
if (endpoint === 'QUnit/done') {
|
|
16
|
-
assert.ok(this.calls['QUnit/begin'], 'QUnit/begin was triggered')
|
|
17
|
-
assert.ok(this.calls['QUnit/log'], 'QUnit/log was triggered')
|
|
18
|
-
assert.ok(this.calls['QUnit/testDone'], 'QUnit/testDone was triggered')
|
|
19
|
-
return true
|
|
20
|
-
}
|
|
21
|
-
return false
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
module.exports = [{
|
|
25
|
-
label: 'Scripts (QUnit)',
|
|
26
|
-
for: capabilities => !!capabilities.scripts,
|
|
27
|
-
url: 'scripts/qunit.html',
|
|
28
|
-
scripts: ['post.js', 'qunit-hooks.js'],
|
|
29
|
-
endpoint: qUnitEndpoints
|
|
30
|
-
}, {
|
|
31
|
-
label: 'Scripts (TestSuite)',
|
|
32
|
-
for: capabilities => !!capabilities.scripts,
|
|
33
|
-
url: 'scripts/testsuite.html',
|
|
34
|
-
scripts: ['post.js', 'qunit-redirect.js'],
|
|
35
|
-
endpoint: function (data) {
|
|
36
|
-
assert(data.endpoint === 'addTestPages', 'addTestPages was triggered')
|
|
37
|
-
assert(data.body.type === 'suite', 'type = suite')
|
|
38
|
-
assert(data.body.pages.length === 2, 'Two pages received')
|
|
39
|
-
const pages = [
|
|
40
|
-
'/unit/unitTests.qunit.html',
|
|
41
|
-
'/integration/opaTests.iframe.qunit.html'
|
|
42
|
-
]
|
|
43
|
-
pages.forEach((page, index) => assert(data.body.pages[index].endsWith(page), page))
|
|
44
|
-
}
|
|
45
|
-
}, {
|
|
46
|
-
label: 'Scripts (External QUnit)',
|
|
47
|
-
for: capabilities => !!capabilities.scripts && !capabilities.modules.includes('jsdom'),
|
|
48
|
-
url: 'https://ui5.sap.com/test-resources/sap/m/demokit/orderbrowser/webapp/test/Test.qunit.html?testsuite=test-resources/sap/ui/demo/orderbrowser/testsuite.qunit&test=unit/unitTests',
|
|
49
|
-
scripts: ['post.js', 'qunit-hooks.js'],
|
|
50
|
-
endpoint: qUnitEndpoints
|
|
51
|
-
}, {
|
|
52
|
-
label: 'Scripts (IFrame Coverage)',
|
|
53
|
-
for: capabilities => !!capabilities.scripts,
|
|
54
|
-
url: 'scripts/iframe.html',
|
|
55
|
-
scripts: ['opa-iframe-coverage.js'],
|
|
56
|
-
endpoint: ({ body }) => {
|
|
57
|
-
assert.strictEqual(body['coverage.html'].status, 'ok')
|
|
58
|
-
}
|
|
59
|
-
}]
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>qunit</title>
|
|
5
|
-
<script id="sap-ui-bootstrap"
|
|
6
|
-
src="https://ui5.sap.com/resources/sap-ui-core.js"
|
|
7
|
-
></script>
|
|
8
|
-
<link rel="stylesheet" type="text/css" href="https://ui5.sap.com/resources/sap/ui/thirdparty/qunit-2.css">
|
|
9
|
-
<script src="https://ui5.sap.com/resources/sap/ui/thirdparty/qunit-2.js"></script>
|
|
10
|
-
</head>
|
|
11
|
-
<body>
|
|
12
|
-
<div id="qunit"></div>
|
|
13
|
-
<div id="qunit-fixture"></div>
|
|
14
|
-
<script>
|
|
15
|
-
QUnit.module('module', function () {
|
|
16
|
-
QUnit.test("test", function (assert) {
|
|
17
|
-
assert.ok(true, 'assert')
|
|
18
|
-
})
|
|
19
|
-
})
|
|
20
|
-
</script>
|
|
21
|
-
</body>
|
|
22
|
-
</html>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
window.suite = function () {
|
|
2
|
-
'use strict'
|
|
3
|
-
const suite = new window.parent.jsUnitTestSuite() // eslint-disable-line new-cap
|
|
4
|
-
const path = window.location.pathname.substring(0, window.location.pathname.lastIndexOf('/') + 1)
|
|
5
|
-
suite.addTestPage(`${path}unit/unitTests.qunit.html`)
|
|
6
|
-
suite.addTestPage(`${path}integration/opaTests.iframe.qunit.html`)
|
|
7
|
-
return suite
|
|
8
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<body>
|
|
4
|
-
<H1>timeout</H1>
|
|
5
|
-
<p>Check if the ping rate is ensured</p>
|
|
6
|
-
<script>
|
|
7
|
-
const parameters = new URLSearchParams(location.search)
|
|
8
|
-
const rate = parseInt(parameters.get('rate'), 10)
|
|
9
|
-
const wait = parseInt(parameters.get('wait'), 10)
|
|
10
|
-
const steps = []
|
|
11
|
-
setTimeout(() => {
|
|
12
|
-
const xhr = new XMLHttpRequest()
|
|
13
|
-
xhr.open('POST', '/_/log')
|
|
14
|
-
xhr.send(JSON.stringify({ steps }))
|
|
15
|
-
}, wait)
|
|
16
|
-
setInterval(() => {
|
|
17
|
-
steps.push(Date.now())
|
|
18
|
-
}, rate)
|
|
19
|
-
</script>
|
|
20
|
-
</body>
|
|
21
|
-
</html>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const assert = require('assert')
|
|
4
|
-
|
|
5
|
-
module.exports = [{
|
|
6
|
-
label: 'Timeout (100ms)',
|
|
7
|
-
url: 'timeout/index.html?rate=100&wait=1000',
|
|
8
|
-
endpoint: ({ body }) => {
|
|
9
|
-
const { steps } = body
|
|
10
|
-
assert.ok(steps.length > 8, 'The right number of steps is generated')
|
|
11
|
-
}
|
|
12
|
-
}, {
|
|
13
|
-
label: 'Timeout (250ms)',
|
|
14
|
-
url: 'timeout/index.html?rate=250&wait=1250',
|
|
15
|
-
endpoint: ({ body }) => {
|
|
16
|
-
const { steps } = body
|
|
17
|
-
assert.ok(steps.length > 3, 'The right number of steps is generated')
|
|
18
|
-
}
|
|
19
|
-
}]
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<body>
|
|
4
|
-
<H1>console</H1>
|
|
5
|
-
<p>Checks if the browser supports traces</p>
|
|
6
|
-
<script>
|
|
7
|
-
console.log('A simple string')
|
|
8
|
-
console.log('A quoted "string"')
|
|
9
|
-
console.log('complex parameters', 1, true, { property: 'value' })
|
|
10
|
-
console.warn('A warning')
|
|
11
|
-
console.error('An error')
|
|
12
|
-
console.info('An info')
|
|
13
|
-
const xhr = new XMLHttpRequest()
|
|
14
|
-
xhr.open('POST', '/_/log')
|
|
15
|
-
xhr.send('{}')
|
|
16
|
-
</script>
|
|
17
|
-
</body>
|
|
18
|
-
</html>
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const { $browsers } = require('../../../symbols')
|
|
4
|
-
const { join } = require('path')
|
|
5
|
-
const { stat } = require('fs/promises')
|
|
6
|
-
const { stop } = require('../../../browsers')
|
|
7
|
-
const { buildCsvReader } = require('../../../csv-reader')
|
|
8
|
-
const assert = require('assert')
|
|
9
|
-
|
|
10
|
-
const expectedLogs = [{
|
|
11
|
-
type: 'log',
|
|
12
|
-
text: 'A simple string'
|
|
13
|
-
}, {
|
|
14
|
-
type: 'log',
|
|
15
|
-
text: 'A quoted "string"'
|
|
16
|
-
}, {
|
|
17
|
-
type: 'log',
|
|
18
|
-
text: /^"?complex parameters"? 1 true / // Not sure how objects are handled
|
|
19
|
-
}, {
|
|
20
|
-
type: /warning|warn/,
|
|
21
|
-
text: 'A warning'
|
|
22
|
-
}, {
|
|
23
|
-
type: 'error',
|
|
24
|
-
text: 'An error'
|
|
25
|
-
}, {
|
|
26
|
-
type: /info|log/, // selenium-webdriver
|
|
27
|
-
text: 'An info'
|
|
28
|
-
}]
|
|
29
|
-
|
|
30
|
-
function equal (value, expected, label) {
|
|
31
|
-
if (typeof expected === 'string') {
|
|
32
|
-
return value === expected
|
|
33
|
-
}
|
|
34
|
-
return !!value.match(expected)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function unquote (string) {
|
|
38
|
-
if (string.startsWith('"') && string.endsWith('"')) {
|
|
39
|
-
return string.substring(1, string.length - 1)
|
|
40
|
-
.replace(/\\"/g, '"')
|
|
41
|
-
}
|
|
42
|
-
return string
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
module.exports = {
|
|
46
|
-
label: 'Console logs',
|
|
47
|
-
for: capabilities => Array.isArray(capabilities.traces) && capabilities.traces.includes('console'),
|
|
48
|
-
url: 'traces/index.html',
|
|
49
|
-
endpoint: async function (_, url) {
|
|
50
|
-
const { job } = this
|
|
51
|
-
const { reportDir } = job[$browsers][url]
|
|
52
|
-
this.stopExpected = true
|
|
53
|
-
await stop(this.job, url)
|
|
54
|
-
const consolePath = join(reportDir, 'console.csv')
|
|
55
|
-
const consoleStat = await stat(consolePath)
|
|
56
|
-
if (!consoleStat.isFile()) {
|
|
57
|
-
throw new Error('missing console.csv')
|
|
58
|
-
}
|
|
59
|
-
const logsReader = buildCsvReader(consolePath)
|
|
60
|
-
let logIndex = 0
|
|
61
|
-
for await (const log of logsReader) {
|
|
62
|
-
assert.strictEqual(typeof log.timestamp, 'string', 'timestamp exists')
|
|
63
|
-
assert.ok(log.timestamp.match(/^[0-9]+$/), 'timestamp is a number')
|
|
64
|
-
const {
|
|
65
|
-
type: expectedType,
|
|
66
|
-
text: expectedText
|
|
67
|
-
} = expectedLogs[logIndex]
|
|
68
|
-
let { text } = log
|
|
69
|
-
const match = text.match(/^https?[^ ]+ (\d+:\d+ )?(.*)/)
|
|
70
|
-
if (match) {
|
|
71
|
-
text = unquote(match[2])
|
|
72
|
-
}
|
|
73
|
-
if (equal(log.type, expectedType) && equal(text, expectedText)) {
|
|
74
|
-
if (++logIndex === expectedLogs.length) {
|
|
75
|
-
break
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
assert.strictEqual(logIndex, expectedLogs.length, 'All expected logs were found')
|
|
80
|
-
}
|
|
81
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!DOCTYPE html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<script id='sap-ui-bootstrap'
|
|
7
|
-
src='https://ui5.sap.com/resources/sap-ui-core.js'
|
|
8
|
-
data-sap-ui-libs='sap.m'
|
|
9
|
-
data-sap-ui-theme='sap_horizon'
|
|
10
|
-
data-sap-ui-compatVersion='edge'>
|
|
11
|
-
</script>
|
|
12
|
-
<script id="myXml" type="text/xmldata">
|
|
13
|
-
<mvc:View xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" controllerName="myController" displayBlock="true">
|
|
14
|
-
<App>
|
|
15
|
-
<Page title="Table Example">
|
|
16
|
-
<Table id="myTable"
|
|
17
|
-
items="{/items}"
|
|
18
|
-
mode="SingleSelectMaster"
|
|
19
|
-
>
|
|
20
|
-
<headerToolbar>
|
|
21
|
-
<Toolbar>
|
|
22
|
-
<Title text="Sample Table"/>
|
|
23
|
-
</Toolbar>
|
|
24
|
-
</headerToolbar>
|
|
25
|
-
<columns>
|
|
26
|
-
<Column>
|
|
27
|
-
<Text text="Name"/>
|
|
28
|
-
</Column>
|
|
29
|
-
<Column>
|
|
30
|
-
<Text text="Age"/>
|
|
31
|
-
</Column>
|
|
32
|
-
</columns>
|
|
33
|
-
<items>
|
|
34
|
-
<ColumnListItem>
|
|
35
|
-
<cells>
|
|
36
|
-
<Text text="{name}"/>
|
|
37
|
-
<Text text="{age}"/>
|
|
38
|
-
</cells>
|
|
39
|
-
</ColumnListItem>
|
|
40
|
-
</items>
|
|
41
|
-
</Table>
|
|
42
|
-
</Page>
|
|
43
|
-
</App>
|
|
44
|
-
</mvc:View>
|
|
45
|
-
</script>
|
|
46
|
-
<script>
|
|
47
|
-
sap.ui.require([
|
|
48
|
-
"sap/ui/core/mvc/Controller",
|
|
49
|
-
"sap/ui/core/mvc/XMLView",
|
|
50
|
-
"sap/m/Dialog",
|
|
51
|
-
"sap/m/Button"
|
|
52
|
-
], function (Controller, XMLView, Dialog, Button) {
|
|
53
|
-
Controller.extend("myController", {
|
|
54
|
-
onInit: function () {
|
|
55
|
-
var model = new sap.ui.model.json.JSONModel();
|
|
56
|
-
model.setData({
|
|
57
|
-
items: [
|
|
58
|
-
{name: "John Doe", age: 30},
|
|
59
|
-
{name: "Jane Smith", age: 25},
|
|
60
|
-
{name: "Max Mustermann", age: 40}
|
|
61
|
-
]
|
|
62
|
-
});
|
|
63
|
-
this.getView().setModel(model);
|
|
64
|
-
// Set focus on the second row
|
|
65
|
-
this.getView().byId("myTable").attachEventOnce("updateFinished", function() {
|
|
66
|
-
// Need to do it asynchronously or the first item is selected instead
|
|
67
|
-
setTimeout(() => {
|
|
68
|
-
const listItem = this.getItems()[1];
|
|
69
|
-
listItem.focus();
|
|
70
|
-
|
|
71
|
-
// Notify the test framework
|
|
72
|
-
const xhr = new XMLHttpRequest();
|
|
73
|
-
xhr.open('POST', '/_/log');
|
|
74
|
-
xhr.send(JSON.stringify({
|
|
75
|
-
'is-focus-set': document.activeElement.id === listItem.getFocusDomRef()?.id,
|
|
76
|
-
}));
|
|
77
|
-
}, 0);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
XMLView.create({definition: jQuery('#myXml').html()}).then(function (oView) {
|
|
83
|
-
oView.placeAt(document.querySelector('body'));
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
</script>
|
|
87
|
-
</head>
|
|
88
|
-
<body class='sapUiBody'></body>
|
|
89
|
-
</html>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const assert = require('assert')
|
|
4
|
-
|
|
5
|
-
module.exports = [{
|
|
6
|
-
label: 'UI5 focus handling',
|
|
7
|
-
for: capabilities => !capabilities.modules.includes('jsdom'), // does not work on JSDOM
|
|
8
|
-
url: 'ui5/focus.html',
|
|
9
|
-
endpoint: ({ body }) => {
|
|
10
|
-
assert.strictEqual(body['is-focus-set'], true)
|
|
11
|
-
}
|
|
12
|
-
}, {
|
|
13
|
-
label: 'UI5 language handling (EN)',
|
|
14
|
-
for: () => false, // capabilities => capabilities.modules.includes('puppeteer'),
|
|
15
|
-
url: 'ui5/language.html',
|
|
16
|
-
args: ['--language en'],
|
|
17
|
-
endpoint: ({ body }) => {
|
|
18
|
-
assert.strictEqual(body.language, 'en')
|
|
19
|
-
assert.strictEqual(body.message, 'No matching items found.')
|
|
20
|
-
}
|
|
21
|
-
}, {
|
|
22
|
-
label: 'UI5 language handling (DE)',
|
|
23
|
-
for: () => false, // capabilities => capabilities.modules.includes('puppeteer'),
|
|
24
|
-
url: 'ui5/language.html',
|
|
25
|
-
args: ['--language de'],
|
|
26
|
-
endpoint: ({ body }) => {
|
|
27
|
-
assert.strictEqual(body.language, 'de')
|
|
28
|
-
assert.strictEqual(body.message, 'Keine passenden Elemente gefunden.')
|
|
29
|
-
}
|
|
30
|
-
}, {
|
|
31
|
-
label: 'UI5 language handling (FR)',
|
|
32
|
-
for: () => false, // capabilities => capabilities.modules.includes('puppeteer'),
|
|
33
|
-
url: 'ui5/language.html',
|
|
34
|
-
args: ['--language fr'],
|
|
35
|
-
endpoint: ({ body }) => {
|
|
36
|
-
assert.strictEqual(body.language, 'fr')
|
|
37
|
-
assert.strictEqual(body.message, 'Aucun élément concordant trouvé.')
|
|
38
|
-
}
|
|
39
|
-
}]
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!DOCTYPE html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<script id='sap-ui-bootstrap'
|
|
7
|
-
src='https://ui5.sap.com/resources/sap-ui-core.js'
|
|
8
|
-
data-sap-ui-libs='sap.m'
|
|
9
|
-
data-sap-ui-theme='sap_horizon'
|
|
10
|
-
data-sap-ui-compatVersion='edge'>
|
|
11
|
-
</script>
|
|
12
|
-
<style>
|
|
13
|
-
html, body { height: 100%; }
|
|
14
|
-
</style>
|
|
15
|
-
<script id="myXml" type="text/xmldata">
|
|
16
|
-
<mvc:View
|
|
17
|
-
xmlns:mvc="sap.ui.core.mvc"
|
|
18
|
-
xmlns="sap.m"
|
|
19
|
-
controllerName="myController"
|
|
20
|
-
displayBlock="true"
|
|
21
|
-
height="100%"
|
|
22
|
-
>
|
|
23
|
-
<MessagePage showHeader="false" icon="sap-icon://filter"/>
|
|
24
|
-
</mvc:View>
|
|
25
|
-
</script>
|
|
26
|
-
<script>
|
|
27
|
-
sap.ui.require([
|
|
28
|
-
"sap/ui/core/mvc/Controller",
|
|
29
|
-
"sap/ui/core/mvc/XMLView"
|
|
30
|
-
], function (Controller, XMLView, Dialog, Button) {
|
|
31
|
-
Controller.extend("myController", {
|
|
32
|
-
onAfterRendering: function () {
|
|
33
|
-
// Notify the test framework
|
|
34
|
-
const xhr = new XMLHttpRequest();
|
|
35
|
-
xhr.open('POST', '/_/log');
|
|
36
|
-
xhr.send(JSON.stringify({
|
|
37
|
-
language: navigator.language,
|
|
38
|
-
message: document.querySelector('.sapMMessagePageMainText').innerText
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
XMLView.create({definition: jQuery('#myXml').html()}).then(function (oView) {
|
|
44
|
-
oView.placeAt(document.querySelector('body'));
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
</script>
|
|
48
|
-
</head>
|
|
49
|
-
<body class='sapUiBody'></body>
|
|
50
|
-
</html>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!DOCTYPE html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<script id='sap-ui-bootstrap'
|
|
7
|
-
src='https://ui5.sap.com/resources/sap-ui-core.js'
|
|
8
|
-
data-sap-ui-libs='sap.m'
|
|
9
|
-
data-sap-ui-theme='sap_horizon'
|
|
10
|
-
data-sap-ui-compatVersion='edge'>
|
|
11
|
-
</script>
|
|
12
|
-
<style>
|
|
13
|
-
html, body { height: 100%; }
|
|
14
|
-
</style>
|
|
15
|
-
<script>
|
|
16
|
-
sap.ui.require([
|
|
17
|
-
"sap/ui/core/date/UI5Date",
|
|
18
|
-
], function (UI5Date) {
|
|
19
|
-
console.log(UI5Date.getInstance(2025,2,15,23,2,0))
|
|
20
|
-
});
|
|
21
|
-
</script>
|
|
22
|
-
</head>
|
|
23
|
-
<body class='sapUiBody'>
|
|
24
|
-
<pre>TZ=UTC node . --webapp . --url http://localhost:0/src/capabilities/tests/ui5/timezone.html --debug-keep-browser-open -- --visible</pre>
|
|
25
|
-
and check the console
|
|
26
|
-
</body>
|
|
27
|
-
</html>
|
package/src/clean.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const { getOutput } = require('./output')
|
|
2
|
-
const { describeHandle } = require('./handle')
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
cleanHandles (job) {
|
|
6
|
-
const output = getOutput(job)
|
|
7
|
-
const activeHandles = process._getActiveHandles ? process._getActiveHandles() : []
|
|
8
|
-
let displayWarning = true
|
|
9
|
-
for (const handle of activeHandles) {
|
|
10
|
-
const { className, label } = describeHandle(handle)
|
|
11
|
-
output.debug('handle', 'active handle', label)
|
|
12
|
-
if (className === 'TLSSocket' || className === 'Socket') {
|
|
13
|
-
if (displayWarning) {
|
|
14
|
-
displayWarning = false
|
|
15
|
-
output.detectedLeakOfHandles()
|
|
16
|
-
}
|
|
17
|
-
output.debug('handle', className, label)
|
|
18
|
-
handle.destroy()
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
package/src/cors.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
custom: function (request, response) {
|
|
5
|
-
const origin = request.headers.origin
|
|
6
|
-
if (request.method === 'OPTIONS') {
|
|
7
|
-
response.writeHead(200, {
|
|
8
|
-
'Access-Control-Allow-Origin': origin,
|
|
9
|
-
Vary: 'Origin',
|
|
10
|
-
'Access-Control-Allow-Headers': '*',
|
|
11
|
-
'Access-Control-Allow-Methods': '*',
|
|
12
|
-
'Access-Control-Allow-Credentials': 'true'
|
|
13
|
-
})
|
|
14
|
-
response.end()
|
|
15
|
-
} else if (origin) {
|
|
16
|
-
response.setHeader('Access-Control-Allow-Origin', origin)
|
|
17
|
-
response.setHeader('Vary', 'Origin')
|
|
18
|
-
response.setHeader('Access-Control-Allow-Credentials', 'true')
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|