@sapui5/sap.fe.test 1.101.0 → 1.102.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/sap/fe/test/.library +1 -1
- package/src/sap/fe/test/CollaborationClient.js +77 -0
- package/src/sap/fe/test/CollaborationClient.ts +105 -0
- package/src/sap/fe/test/FeMocks.js +1 -1
- package/src/sap/fe/test/FeMocks.ts +6 -2
- package/src/sap/fe/test/JestTemplatingHelper.js +51 -22
- package/src/sap/fe/test/JestTemplatingHelper.ts +46 -19
- package/src/sap/fe/test/ListReport.js +7 -15
- package/src/sap/fe/test/LocationUtil.js +12 -16
- package/src/sap/fe/test/ObjectPage.js +38 -6
- package/src/sap/fe/test/Shell.js +94 -34
- package/src/sap/fe/test/TemplatePage.js +14 -0
- package/src/sap/fe/test/UI5MockHelper.js +99 -18
- package/src/sap/fe/test/UI5MockHelper.ts +81 -14
- package/src/sap/fe/test/api/CollaborationAPI.js +215 -0
- package/src/sap/fe/test/api/CollaborationAPI.ts +240 -0
- package/src/sap/fe/test/api/DialogMassEditActions.js +115 -0
- package/src/sap/fe/test/api/DialogMassEditAssertions.js +174 -0
- package/src/sap/fe/test/api/DialogType.js +11 -2
- package/src/sap/fe/test/api/HeaderAssertions.js +76 -41
- package/src/sap/fe/test/api/TableAPI.js +30 -34
- package/src/sap/fe/test/api/TableActions.js +1 -1
- package/src/sap/fe/test/api/TableAssertions.js +51 -46
- package/src/sap/fe/test/builder/MacroFieldBuilder.js +161 -156
- package/src/sap/fe/test/builder/MdcTableBuilder.js +89 -12
- package/src/sap/fe/test/library.js +1 -1
- package/src/sap/fe/test/massEdit.js +0 -62
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AnyAnnotation, ConverterOutput, EntitySet, Property } from "@sap-ux/annotation-converter";
|
|
2
|
-
import
|
|
2
|
+
import compiler from "@sap/cds-compiler";
|
|
3
3
|
import * as fs from "fs";
|
|
4
4
|
import * as path from "path";
|
|
5
5
|
import { format, RequiredOptions } from "prettier";
|
|
@@ -85,6 +85,15 @@ expect.extend({
|
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
+
export const formatBuildingBlockXML = function (xmlString: string | string[]) {
|
|
89
|
+
if (Array.isArray(xmlString)) {
|
|
90
|
+
xmlString = xmlString.join("");
|
|
91
|
+
}
|
|
92
|
+
let xmlFormatted = formatXML(xmlString);
|
|
93
|
+
xmlFormatted = xmlFormatted.replace(/uid--id-[0-9]{13}-[0-9]/g, "uid--id");
|
|
94
|
+
return xmlFormatted;
|
|
95
|
+
};
|
|
96
|
+
|
|
88
97
|
export const getControlAttribute = function (controlSelector: string, attributeName: string, xmlDom: Node) {
|
|
89
98
|
const selector = `string(/root${controlSelector}/@${attributeName})`;
|
|
90
99
|
return runXPathQuery(selector, xmlDom);
|
|
@@ -93,6 +102,10 @@ export const getControlAttribute = function (controlSelector: string, attributeN
|
|
|
93
102
|
const serializeXML = function (xmlDom: Node) {
|
|
94
103
|
const serializer = new window.XMLSerializer();
|
|
95
104
|
const xmlString = serializer.serializeToString(xmlDom);
|
|
105
|
+
return formatXML(xmlString);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const formatXML = function (xmlString: string) {
|
|
96
109
|
return format(
|
|
97
110
|
xmlString,
|
|
98
111
|
{ parser: "xml", xmlWhitespaceSensitivity: "ignore" } as Partial<RequiredOptions> /* options by the Prettier XML plugin */
|
|
@@ -102,34 +115,48 @@ const serializeXML = function (xmlDom: Node) {
|
|
|
102
115
|
/**
|
|
103
116
|
* Compile a CDS file into an EDMX file.
|
|
104
117
|
*
|
|
105
|
-
* @param
|
|
106
|
-
*
|
|
107
|
-
* @
|
|
118
|
+
* @param cdsUrl The path to the file containing the CDS definition. This file must declare the namespace sap.fe.test and a service JestService
|
|
119
|
+
* @param options Options for creating the EDMX output
|
|
120
|
+
* @param edmxFileName Allows you to override the name of the compiled EDMX metadata file
|
|
121
|
+
* @returns The path of the generated EDMX
|
|
108
122
|
*/
|
|
109
|
-
export const compileCDS = function (
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
123
|
+
export const compileCDS = function (
|
|
124
|
+
cdsUrl: string,
|
|
125
|
+
options: compiler.ODataOptions = {},
|
|
126
|
+
edmxFileName = path.basename(cdsUrl).replace(".cds", ".xml")
|
|
127
|
+
) {
|
|
128
|
+
const cdsString = fs.readFileSync(cdsUrl, "utf-8");
|
|
129
|
+
const edmxContent = cds2edmx(cdsString, "sap.fe.test.JestService", options);
|
|
130
|
+
const dir = path.resolve(cdsUrl, "..", "gen");
|
|
131
|
+
|
|
132
|
+
const edmxFilePath = path.resolve(dir, edmxFileName);
|
|
133
|
+
|
|
134
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
118
135
|
|
|
119
|
-
fs.writeFileSync(
|
|
120
|
-
return
|
|
136
|
+
fs.writeFileSync(edmxFilePath, edmxContent);
|
|
137
|
+
return edmxFilePath;
|
|
121
138
|
};
|
|
122
139
|
|
|
123
140
|
/**
|
|
124
141
|
* Compile CDS to EDMX.
|
|
125
142
|
*
|
|
126
143
|
* @param cds The CDS model. It must define at least one service.
|
|
127
|
-
* @param service The fully-qualified name of the service to
|
|
144
|
+
* @param service The fully-qualified name of the service to be compiled. Defaults to "sap.fe.test.JestService".
|
|
145
|
+
* @param options Options for creating the EDMX output
|
|
128
146
|
* @returns The compiled service model as EDMX.
|
|
129
147
|
*/
|
|
130
|
-
export function cds2edmx(cds: string, service
|
|
131
|
-
const csn = compileSources({ "string.cds": cds }, {});
|
|
132
|
-
|
|
148
|
+
export function cds2edmx(cds: string, service = "sap.fe.test.JestService", options: compiler.ODataOptions = {}) {
|
|
149
|
+
const csn = compiler.compileSources({ "string.cds": cds }, {});
|
|
150
|
+
|
|
151
|
+
const edmxOptions: compiler.ODataOptions = {
|
|
152
|
+
odataForeignKeys: true,
|
|
153
|
+
odataFormat: "structured",
|
|
154
|
+
odataContainment: false,
|
|
155
|
+
...options,
|
|
156
|
+
service: service
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const edmx = compiler.to.edmx(csn, edmxOptions);
|
|
133
160
|
if (!edmx) {
|
|
134
161
|
throw new Error(`Compilation failed. Hint: Make sure that the CDS model defines service ${service}.`);
|
|
135
162
|
}
|
|
@@ -382,12 +382,6 @@ sap.ui.define(
|
|
|
382
382
|
.description("Seeing Contact Card with Avatar Image in ListReport")
|
|
383
383
|
.execute();
|
|
384
384
|
},
|
|
385
|
-
iSeeQuickViewPopover: function () {
|
|
386
|
-
return OpaBuilder.create(this)
|
|
387
|
-
.hasType("sap.ui.mdc.link.Panel")
|
|
388
|
-
.description("Seeing Quick View Popover")
|
|
389
|
-
.execute();
|
|
390
|
-
},
|
|
391
385
|
iSeeAvatarImage: function (sImageSource) {
|
|
392
386
|
return OpaBuilder.create(this)
|
|
393
387
|
.hasType("sap.m.Avatar")
|
|
@@ -507,22 +501,20 @@ sap.ui.define(
|
|
|
507
501
|
},
|
|
508
502
|
iSeeDraftIndicator: function () {
|
|
509
503
|
return OpaBuilder.create(this)
|
|
510
|
-
.hasType("sap.m.
|
|
504
|
+
.hasType("sap.m.ObjectMarker")
|
|
511
505
|
.hasProperties({
|
|
512
|
-
|
|
506
|
+
type: "Draft"
|
|
513
507
|
})
|
|
514
508
|
.description("Draft indicator is visible")
|
|
515
509
|
.execute();
|
|
516
510
|
},
|
|
517
511
|
iSeeDraftIndicatorLocked: function (user) {
|
|
518
|
-
var
|
|
519
|
-
|
|
520
|
-
[user]
|
|
521
|
-
);
|
|
512
|
+
var props = user ? { type: "LockedBy", additionalInfo: user } : { type: "Locked" };
|
|
513
|
+
|
|
522
514
|
return OpaBuilder.create(this)
|
|
523
|
-
.hasType("sap.m.
|
|
524
|
-
.hasProperties(
|
|
525
|
-
.description("Draft indicator is visible and
|
|
515
|
+
.hasType("sap.m.ObjectMarker")
|
|
516
|
+
.hasProperties(props)
|
|
517
|
+
.description("Draft indicator is visible and locked" + (user ? " by '" + user + "'" : ""))
|
|
526
518
|
.execute();
|
|
527
519
|
},
|
|
528
520
|
iSeeIconTabWithProperties: function (mProperties) {
|
|
@@ -3,45 +3,41 @@
|
|
|
3
3
|
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
4
|
|
|
5
5
|
*/
|
|
6
|
-
sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"], function(OpaBuilder, Opa5, Utils) {
|
|
6
|
+
sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"], function (OpaBuilder, Opa5, Utils) {
|
|
7
7
|
"use strict";
|
|
8
8
|
|
|
9
9
|
// Match with V4Freestyle and SO Apps
|
|
10
|
-
var getHash = function(oRootView) {
|
|
11
|
-
if (!(typeof oRootView.getController().getRouter === "function")) {
|
|
10
|
+
var getHash = function (oRootView, bGetHashFromWindow) {
|
|
11
|
+
if (bGetHashFromWindow || !(typeof oRootView.getController().getRouter === "function")) {
|
|
12
12
|
var oWindow = Opa5.getWindow();
|
|
13
13
|
return oWindow.window.location.hash;
|
|
14
14
|
}
|
|
15
|
-
return oRootView
|
|
16
|
-
.getController()
|
|
17
|
-
.getRouter()
|
|
18
|
-
.getHashChanger()
|
|
19
|
-
.getHash();
|
|
15
|
+
return oRootView.getController().getRouter().getHashChanger().getHash();
|
|
20
16
|
};
|
|
21
|
-
var getRootViewId = function(sFlpAppName) {
|
|
17
|
+
var getRootViewId = function (sFlpAppName) {
|
|
22
18
|
return new RegExp(Utils.formatMessage("^application-{0}-component---app(RootView)?$", sFlpAppName));
|
|
23
19
|
};
|
|
24
20
|
|
|
25
21
|
return {
|
|
26
|
-
create: function(sFlpAppName) {
|
|
22
|
+
create: function (sFlpAppName) {
|
|
27
23
|
return {
|
|
28
24
|
actions: {},
|
|
29
25
|
assertions: {
|
|
30
|
-
iCheckCurrentHashStartsWith: function(sHash) {
|
|
26
|
+
iCheckCurrentHashStartsWith: function (sHash, bGetHashFromWindow) {
|
|
31
27
|
return OpaBuilder.create(this)
|
|
32
28
|
.hasId(getRootViewId(sFlpAppName))
|
|
33
|
-
.check(function(aRootViews) {
|
|
34
|
-
var sCurrentHash = getHash(aRootViews[0]);
|
|
29
|
+
.check(function (aRootViews) {
|
|
30
|
+
var sCurrentHash = getHash(aRootViews[0], bGetHashFromWindow);
|
|
35
31
|
return sCurrentHash.indexOf(sHash) === 0;
|
|
36
32
|
})
|
|
37
33
|
.description("Checking hash starts with " + sHash)
|
|
38
34
|
.execute();
|
|
39
35
|
},
|
|
40
|
-
iCheckCurrentHashDoesNotContain: function(sPart) {
|
|
36
|
+
iCheckCurrentHashDoesNotContain: function (sPart, bGetHashFromWindow) {
|
|
41
37
|
return OpaBuilder.create(this)
|
|
42
38
|
.hasId(getRootViewId(sFlpAppName))
|
|
43
|
-
.check(function(aRootViews) {
|
|
44
|
-
var sCurrentHash = getHash(aRootViews[0]);
|
|
39
|
+
.check(function (aRootViews) {
|
|
40
|
+
var sCurrentHash = getHash(aRootViews[0], bGetHashFromWindow);
|
|
45
41
|
return sCurrentHash.indexOf(sPart) === -1;
|
|
46
42
|
})
|
|
47
43
|
.description("Checking hash doesn't contain " + sPart)
|
|
@@ -278,6 +278,15 @@ sap.ui.define(
|
|
|
278
278
|
.description("Pressing 'More Links' button")
|
|
279
279
|
.execute();
|
|
280
280
|
},
|
|
281
|
+
iClickQuickViewTitleLink: function (sText) {
|
|
282
|
+
return OpaBuilder.create(this)
|
|
283
|
+
.hasType("sap.m.Link")
|
|
284
|
+
.isDialogElement(true)
|
|
285
|
+
.hasProperties({ text: sText })
|
|
286
|
+
.doPress()
|
|
287
|
+
.description("Navigating via quickview title link '" + sText + "'")
|
|
288
|
+
.execute();
|
|
289
|
+
},
|
|
281
290
|
iClickLinkWithText: function (sText) {
|
|
282
291
|
return OpaBuilder.create(this)
|
|
283
292
|
.hasType("sap.m.Link")
|
|
@@ -526,6 +535,28 @@ sap.ui.define(
|
|
|
526
535
|
return new FormAssertions(_getFormBuilder(this, vFormIdentifier), vFormIdentifier);
|
|
527
536
|
},
|
|
528
537
|
|
|
538
|
+
iSeeMessageButton: function (messageType, messageButtonText) {
|
|
539
|
+
var message = {
|
|
540
|
+
Error: {
|
|
541
|
+
"type": "Negative"
|
|
542
|
+
},
|
|
543
|
+
Warning: {
|
|
544
|
+
"type": "Critical"
|
|
545
|
+
},
|
|
546
|
+
Information: {
|
|
547
|
+
"type": "Neutral"
|
|
548
|
+
}
|
|
549
|
+
};
|
|
550
|
+
return OpaBuilder.create(this)
|
|
551
|
+
.hasType("sap.fe.common.MessageButton")
|
|
552
|
+
.hasProperties({
|
|
553
|
+
text: messageButtonText,
|
|
554
|
+
type: message[messageType]["type"]
|
|
555
|
+
})
|
|
556
|
+
.description("Messagebutton is visible with " + message[messageType]["type"] + " button type")
|
|
557
|
+
.execute();
|
|
558
|
+
},
|
|
559
|
+
|
|
529
560
|
iSeeLinkWithText: function (sText) {
|
|
530
561
|
return OpaBuilder.create(this)
|
|
531
562
|
.hasType("sap.m.Link")
|
|
@@ -565,12 +596,6 @@ sap.ui.define(
|
|
|
565
596
|
.execute()
|
|
566
597
|
);
|
|
567
598
|
},
|
|
568
|
-
iSeeQuickViewPopover: function () {
|
|
569
|
-
return OpaBuilder.create(this)
|
|
570
|
-
.hasType("sap.ui.mdc.link.Panel")
|
|
571
|
-
.description("Seeing Quick View Details in ObjectPage")
|
|
572
|
-
.execute();
|
|
573
|
-
},
|
|
574
599
|
iSeeContactPopoverWithAvatarImage: function (sImageSource) {
|
|
575
600
|
return OpaBuilder.create(this)
|
|
576
601
|
.hasType("sap.ui.mdc.link.Panel")
|
|
@@ -644,6 +669,13 @@ sap.ui.define(
|
|
|
644
669
|
.description("FLP link with text '" + sDescription + "' is present")
|
|
645
670
|
.execute();
|
|
646
671
|
},
|
|
672
|
+
iSeeLabel: function (sDescription) {
|
|
673
|
+
return OpaBuilder.create(this)
|
|
674
|
+
.hasType("sap.m.Label")
|
|
675
|
+
.hasProperties({ text: sDescription })
|
|
676
|
+
.description("Label '" + sDescription + "' is present")
|
|
677
|
+
.execute();
|
|
678
|
+
},
|
|
647
679
|
iSeeSimpleFormWithLabel: function (sDescription) {
|
|
648
680
|
return OpaBuilder.create(this)
|
|
649
681
|
.hasType("sap.m.Label")
|
package/src/sap/fe/test/Shell.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
4
|
|
|
5
5
|
*/
|
|
6
|
-
sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"], function(OpaBuilder, Opa5, Utils) {
|
|
6
|
+
sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"], function (OpaBuilder, Opa5, Utils) {
|
|
7
7
|
"use strict";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -34,15 +34,11 @@ sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"
|
|
|
34
34
|
* @name sap.fe.test.Shell#iNavigateBack
|
|
35
35
|
* @public
|
|
36
36
|
*/
|
|
37
|
-
iNavigateBack: function() {
|
|
38
|
-
return OpaBuilder.create(this)
|
|
39
|
-
.hasId("backBtn")
|
|
40
|
-
.doPress()
|
|
41
|
-
.description("Navigating back via shell")
|
|
42
|
-
.execute();
|
|
37
|
+
iNavigateBack: function () {
|
|
38
|
+
return OpaBuilder.create(this).hasId("backBtn").doPress().description("Navigating back via shell").execute();
|
|
43
39
|
},
|
|
44
40
|
/**
|
|
45
|
-
* Navigates to the launch pad via home button.
|
|
41
|
+
* Navigates to the launch pad via the home button.
|
|
46
42
|
*
|
|
47
43
|
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
48
44
|
*
|
|
@@ -50,10 +46,10 @@ sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"
|
|
|
50
46
|
* @name sap.fe.test.Shell#iNavigateHome
|
|
51
47
|
* @public
|
|
52
48
|
*/
|
|
53
|
-
iNavigateHome: function() {
|
|
49
|
+
iNavigateHome: function () {
|
|
54
50
|
return OpaBuilder.create(this)
|
|
55
51
|
.hasId("shell-header")
|
|
56
|
-
.do(function() {
|
|
52
|
+
.do(function () {
|
|
57
53
|
// the logo is not a UI5 control
|
|
58
54
|
var oTestWindow = Opa5.getWindow();
|
|
59
55
|
oTestWindow.document.getElementById("shell-header-logo").click();
|
|
@@ -70,7 +66,7 @@ sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"
|
|
|
70
66
|
* @name sap.fe.test.Shell#iOpenNavigationMenu
|
|
71
67
|
* @public
|
|
72
68
|
*/
|
|
73
|
-
iOpenNavigationMenu: function() {
|
|
69
|
+
iOpenNavigationMenu: function () {
|
|
74
70
|
return OpaBuilder.create(this)
|
|
75
71
|
.hasId("shellAppTitle")
|
|
76
72
|
.doPress()
|
|
@@ -87,7 +83,7 @@ sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"
|
|
|
87
83
|
* @name sap.fe.test.Shell#iNavigateViaMenu
|
|
88
84
|
* @public
|
|
89
85
|
*/
|
|
90
|
-
iNavigateViaMenu: function(sItem) {
|
|
86
|
+
iNavigateViaMenu: function (sItem) {
|
|
91
87
|
return OpaBuilder.create(this)
|
|
92
88
|
.hasId("sapUshellNavHierarchyItems")
|
|
93
89
|
.doOnAggregation("items", OpaBuilder.Matchers.properties({ title: sItem }), OpaBuilder.Actions.press())
|
|
@@ -104,32 +100,29 @@ sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"
|
|
|
104
100
|
* @name sap.fe.test.Shell#iPressTile
|
|
105
101
|
* @public
|
|
106
102
|
*/
|
|
107
|
-
iPressTile: function(sTarget) {
|
|
103
|
+
iPressTile: function (sTarget) {
|
|
108
104
|
return this.waitFor({
|
|
109
105
|
controlType: "sap.ushell.ui.launchpad.Tile",
|
|
110
|
-
matchers: function(oTile) {
|
|
106
|
+
matchers: function (oTile) {
|
|
111
107
|
return oTile.getTarget() === "#" + sTarget;
|
|
112
108
|
},
|
|
113
|
-
actions: function(oTile) {
|
|
114
|
-
oTile
|
|
115
|
-
.getTileViews()[0]
|
|
116
|
-
.$()
|
|
117
|
-
.trigger("tap");
|
|
109
|
+
actions: function (oTile) {
|
|
110
|
+
oTile.getTileViews()[0].$().trigger("tap");
|
|
118
111
|
},
|
|
119
|
-
success: function(oTile) {
|
|
112
|
+
success: function (oTile) {
|
|
120
113
|
Opa5.assert.ok(true, Utils.formatMessage("Clicking on tile with target '{0}'", sTarget));
|
|
121
114
|
},
|
|
122
115
|
errorMessage: "Could not find the tile"
|
|
123
116
|
});
|
|
124
117
|
},
|
|
125
|
-
iOpenDefaultValues: function() {
|
|
118
|
+
iOpenDefaultValues: function () {
|
|
126
119
|
return OpaBuilder.create(this)
|
|
127
120
|
.hasId("meAreaHeaderButton")
|
|
128
121
|
.doPress()
|
|
129
122
|
.description("Opening FLP Default Values dialog")
|
|
130
123
|
.execute();
|
|
131
124
|
},
|
|
132
|
-
iEnterAValueForUserDefaults: function(oField, vValue) {
|
|
125
|
+
iEnterAValueForUserDefaults: function (oField, vValue) {
|
|
133
126
|
return OpaBuilder.create(this)
|
|
134
127
|
.hasProperties({
|
|
135
128
|
name: oField.field
|
|
@@ -139,7 +132,7 @@ sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"
|
|
|
139
132
|
.description("Entering text in the field '" + oField.field + "' with value '" + oField + "'")
|
|
140
133
|
.execute();
|
|
141
134
|
},
|
|
142
|
-
iSelectAListItem: function(sOption) {
|
|
135
|
+
iSelectAListItem: function (sOption) {
|
|
143
136
|
return OpaBuilder.create(this)
|
|
144
137
|
.hasType("sap.m.StandardListItem")
|
|
145
138
|
.hasProperties({ title: sOption })
|
|
@@ -147,7 +140,7 @@ sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"
|
|
|
147
140
|
.description("Selecting item: " + sOption)
|
|
148
141
|
.execute();
|
|
149
142
|
},
|
|
150
|
-
iLaunchExtendedParameterDialog: function(sProperty) {
|
|
143
|
+
iLaunchExtendedParameterDialog: function (sProperty) {
|
|
151
144
|
return OpaBuilder.create(this)
|
|
152
145
|
.hasType("sap.m.Button")
|
|
153
146
|
.isDialogElement()
|
|
@@ -158,7 +151,7 @@ sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"
|
|
|
158
151
|
.description("Launching Extended Parameter Dialog")
|
|
159
152
|
.execute();
|
|
160
153
|
},
|
|
161
|
-
iClickOnButtonWithText: function(sText) {
|
|
154
|
+
iClickOnButtonWithText: function (sText) {
|
|
162
155
|
return OpaBuilder.create(this)
|
|
163
156
|
.hasType("sap.m.Button")
|
|
164
157
|
.hasProperties({
|
|
@@ -168,7 +161,7 @@ sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"
|
|
|
168
161
|
.description("Clicking on button with text: " + sText)
|
|
169
162
|
.execute();
|
|
170
163
|
},
|
|
171
|
-
iClickOnButtonWithIcon: function(sIcon) {
|
|
164
|
+
iClickOnButtonWithIcon: function (sIcon) {
|
|
172
165
|
return OpaBuilder.create(this)
|
|
173
166
|
.hasType("sap.m.Button")
|
|
174
167
|
.hasProperties({
|
|
@@ -180,13 +173,10 @@ sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"
|
|
|
180
173
|
}
|
|
181
174
|
},
|
|
182
175
|
assertions: {
|
|
183
|
-
iSeeFlpDashboard: function() {
|
|
184
|
-
return OpaBuilder.create(this)
|
|
185
|
-
.hasId("sapUshellDashboardPage")
|
|
186
|
-
.description("Seeing FLP Dashboard")
|
|
187
|
-
.execute();
|
|
176
|
+
iSeeFlpDashboard: function () {
|
|
177
|
+
return OpaBuilder.create(this).hasId("sapUshellDashboardPage").description("Seeing FLP Dashboard").execute();
|
|
188
178
|
},
|
|
189
|
-
iShouldSeeTheAppTile: function(sTitle) {
|
|
179
|
+
iShouldSeeTheAppTile: function (sTitle) {
|
|
190
180
|
return OpaBuilder.create(this)
|
|
191
181
|
.hasType("sap.ushell.ui.launchpad.Tile")
|
|
192
182
|
.hasProperties({
|
|
@@ -195,7 +185,7 @@ sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"
|
|
|
195
185
|
.description("Seeing Tile " + sTitle)
|
|
196
186
|
.execute();
|
|
197
187
|
},
|
|
198
|
-
iSeeShellNavHierarchyItem: function(sItemTitle, iItemPosition, iItemNumbers, sItemDesc) {
|
|
188
|
+
iSeeShellNavHierarchyItem: function (sItemTitle, iItemPosition, iItemNumbers, sItemDesc) {
|
|
199
189
|
return OpaBuilder.create(this)
|
|
200
190
|
.viewId(null)
|
|
201
191
|
.hasId("sapUshellNavHierarchyItems")
|
|
@@ -213,13 +203,83 @@ sap.ui.define(["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils"
|
|
|
213
203
|
)
|
|
214
204
|
.execute();
|
|
215
205
|
},
|
|
216
|
-
iSeeShellAppTitle: function(sTitle) {
|
|
206
|
+
iSeeShellAppTitle: function (sTitle) {
|
|
217
207
|
return OpaBuilder.create(this)
|
|
218
208
|
.viewId(null)
|
|
219
209
|
.hasId("shellAppTitle")
|
|
220
210
|
.hasProperties({ text: sTitle })
|
|
221
211
|
.description(sTitle + " is the Shell App Title")
|
|
222
212
|
.execute();
|
|
213
|
+
},
|
|
214
|
+
/**
|
|
215
|
+
* Check an intent-based navigation.
|
|
216
|
+
* The function checks the semantic object and the action within the URL of an application.
|
|
217
|
+
* Optionally, further URL parameters can be checked.
|
|
218
|
+
*
|
|
219
|
+
* @param {string} sSemanticObject The semantic object of the application
|
|
220
|
+
* @param {string} sAction The action of the application
|
|
221
|
+
* @param {Array} [aURLParams] More URL parameters to be checked. The pattern is:
|
|
222
|
+
* <code><pre>
|
|
223
|
+
* [{
|
|
224
|
+
* property: <expected name of URL parameter>,
|
|
225
|
+
* value: <expected value of URL parameter>
|
|
226
|
+
* }]
|
|
227
|
+
* </pre></code>
|
|
228
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
229
|
+
* @function
|
|
230
|
+
* @name sap.fe.test.Shell#iCheckIntentBasedNavigation
|
|
231
|
+
* @public
|
|
232
|
+
*/
|
|
233
|
+
iCheckIntentBasedNavigation: function (sSemanticObject, sAction, aURLParams) {
|
|
234
|
+
function _hasAllURLParameters(oURLParams, aInputURLParams) {
|
|
235
|
+
try {
|
|
236
|
+
aInputURLParams.forEach(function (oParam) {
|
|
237
|
+
if (oURLParams.hasOwnProperty(oParam.property)) {
|
|
238
|
+
if (oURLParams[oParam.property][0] !== oParam.value) {
|
|
239
|
+
throw "input parameter not equal to actual URL parameter";
|
|
240
|
+
}
|
|
241
|
+
} else {
|
|
242
|
+
throw "input parameter not found in URL";
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
return true;
|
|
246
|
+
} catch (error) {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return OpaBuilder.create(this)
|
|
252
|
+
.check(function () {
|
|
253
|
+
var oParsedHash = Opa5.getWindow()
|
|
254
|
+
.sap.ushell.Container.getService("URLParsing")
|
|
255
|
+
.parseShellHash(Opa5.getWindow().document.location.hash);
|
|
256
|
+
if (oParsedHash.semanticObject === sSemanticObject && oParsedHash.action === sAction) {
|
|
257
|
+
return !aURLParams || _hasAllURLParameters(oParsedHash.params, aURLParams) ? true : false;
|
|
258
|
+
} else {
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
})
|
|
262
|
+
.error(function () {
|
|
263
|
+
var sHash = Opa5.getWindow().document.location.hash,
|
|
264
|
+
sLogErr = "Expected properties/values: ";
|
|
265
|
+
Opa5.assert.ok(false, "Current hash value: " + sHash);
|
|
266
|
+
Opa5.assert.ok(false, "Expected semantic object: " + sSemanticObject);
|
|
267
|
+
Opa5.assert.ok(false, "Expected action: " + sAction);
|
|
268
|
+
if (aURLParams) {
|
|
269
|
+
aURLParams.forEach(function (oParam) {
|
|
270
|
+
sLogErr = sLogErr + oParam.property + "=" + oParam.value + ",";
|
|
271
|
+
});
|
|
272
|
+
Opa5.assert.ok(false, sLogErr);
|
|
273
|
+
}
|
|
274
|
+
})
|
|
275
|
+
.success(
|
|
276
|
+
"Navigation successful. SemanticObject: " +
|
|
277
|
+
sSemanticObject +
|
|
278
|
+
", Action: " +
|
|
279
|
+
sAction +
|
|
280
|
+
" and all URL parameters are valid."
|
|
281
|
+
)
|
|
282
|
+
.execute();
|
|
223
283
|
}
|
|
224
284
|
}
|
|
225
285
|
}
|
|
@@ -23,6 +23,8 @@ sap.ui.define(
|
|
|
23
23
|
"sap/fe/test/api/DialogValueHelpAssertions",
|
|
24
24
|
"sap/fe/test/api/DialogCreateActions",
|
|
25
25
|
"sap/fe/test/api/DialogCreateAssertions",
|
|
26
|
+
"sap/fe/test/api/DialogMassEditActions",
|
|
27
|
+
"sap/fe/test/api/DialogMassEditAssertions",
|
|
26
28
|
"sap/fe/test/api/TableAssertions",
|
|
27
29
|
"sap/fe/test/api/TableActions",
|
|
28
30
|
"sap/fe/test/api/ChartAssertions",
|
|
@@ -52,6 +54,8 @@ sap.ui.define(
|
|
|
52
54
|
DialogValueHelpAssertions,
|
|
53
55
|
DialogCreateActions,
|
|
54
56
|
DialogCreateAssertions,
|
|
57
|
+
DialogMassEditActions,
|
|
58
|
+
DialogMassEditAssertions,
|
|
55
59
|
TableAssertions,
|
|
56
60
|
TableActions,
|
|
57
61
|
ChartAssertions,
|
|
@@ -116,6 +120,10 @@ sap.ui.define(
|
|
|
116
120
|
return bAction
|
|
117
121
|
? new DialogCreateActions(oDialogBuilder, vDialogIdentifier)
|
|
118
122
|
: new DialogCreateAssertions(oDialogBuilder, vDialogIdentifier);
|
|
123
|
+
case DialogType.MassEdit:
|
|
124
|
+
return bAction
|
|
125
|
+
? new DialogMassEditActions(oDialogBuilder, vDialogIdentifier)
|
|
126
|
+
: new DialogMassEditAssertions(oDialogBuilder, vDialogIdentifier);
|
|
119
127
|
default:
|
|
120
128
|
return bAction
|
|
121
129
|
? new DialogActions(oDialogBuilder, vDialogIdentifier)
|
|
@@ -470,6 +478,12 @@ sap.ui.define(
|
|
|
470
478
|
.description(Utils.formatMessage("Seeing message strip with properties='{0}'", mProperties))
|
|
471
479
|
.execute();
|
|
472
480
|
},
|
|
481
|
+
iSeeQuickViewPopover: function () {
|
|
482
|
+
return OpaBuilder.create(this)
|
|
483
|
+
.hasType("sap.ui.mdc.link.Panel")
|
|
484
|
+
.description("Seeing Quick View Popover")
|
|
485
|
+
.execute();
|
|
486
|
+
},
|
|
473
487
|
iSeeQuickViewTitleLink: function (sDescription) {
|
|
474
488
|
return OpaBuilder.create(this)
|
|
475
489
|
.hasType("sap.m.Link")
|