ui5-test-runner 5.5.0 → 5.5.1
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/package.json +1 -1
- package/src/capabilities/index.js +5 -1
- package/src/capabilities/tests/ui5/index.js +39 -0
- package/src/capabilities/tests/ui5/language.html +50 -0
- package/src/qunit-hooks.js +1 -1
- package/src/capabilities/tests/ui5-focus/index.js +0 -12
- /package/src/capabilities/tests/{ui5-focus/index.html → ui5/focus.html} +0 -0
package/package.json
CHANGED
|
@@ -101,7 +101,7 @@ async function capabilities (job) {
|
|
|
101
101
|
|
|
102
102
|
const task = async (test) => {
|
|
103
103
|
const { promise, resolve } = allocPromise()
|
|
104
|
-
const { label, url, scripts, endpoint = () => { } } = test
|
|
104
|
+
const { label, url, args, scripts, endpoint = () => { } } = test
|
|
105
105
|
|
|
106
106
|
const listenerIndex = listeners.length
|
|
107
107
|
let pageUrl
|
|
@@ -159,6 +159,10 @@ async function capabilities (job) {
|
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
if (args) {
|
|
163
|
+
// TODO replace or concat ?
|
|
164
|
+
}
|
|
165
|
+
|
|
162
166
|
start(job, pageUrl, scripts)
|
|
163
167
|
.catch(reason => done(reason))
|
|
164
168
|
.then(() => {
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
}]
|
|
@@ -0,0 +1,50 @@
|
|
|
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>
|
package/src/qunit-hooks.js
CHANGED
|
@@ -91,7 +91,7 @@ async function done (job, urlWithHash, report) {
|
|
|
91
91
|
const { promise, resolve } = allocPromise()
|
|
92
92
|
page[$doneResolve] = resolve
|
|
93
93
|
page[$doneTimeout] = setTimeout(async () => {
|
|
94
|
-
if (job.browserCapabilities.screenshot) {
|
|
94
|
+
if (job.browserCapabilities.screenshot && job.screenshot) {
|
|
95
95
|
try {
|
|
96
96
|
await screenshot(job, url, 'done')
|
|
97
97
|
} catch (error) {
|
|
@@ -1,12 +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/index.html',
|
|
9
|
-
endpoint: ({ body }) => {
|
|
10
|
-
assert.strictEqual(body['is-focus-set'], true)
|
|
11
|
-
}
|
|
12
|
-
}]
|
|
File without changes
|