@sapui5/sap.fe.test 1.130.6 → 1.132.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/package.json +1 -1
- package/src/sap/fe/test/.library +1 -1
- package/src/sap/fe/test/AppStateAdapter.js +1 -1
- package/src/sap/fe/test/JestFlexibilityHelper.js +3 -5
- package/src/sap/fe/test/JestTemplatingHelper.js +213 -34
- package/src/sap/fe/test/JestTemplatingHelper.tsx +200 -3
- package/src/sap/fe/test/ListReport.js +4 -1
- package/src/sap/fe/test/ObjectPage.js +3 -3
- package/src/sap/fe/test/Shell.js +277 -272
- package/src/sap/fe/test/Stubs.js +20 -18
- package/src/sap/fe/test/UI5MockHelper.js +13 -10
- package/src/sap/fe/test/UI5MockHelper.ts +12 -2
- package/src/sap/fe/test/Utils.js +4 -0
- package/src/sap/fe/test/api/CollaborationAPI.js +3 -3
- package/src/sap/fe/test/api/CollaborationAPI.ts +2 -1
- package/src/sap/fe/test/api/TableAssertions.js +2 -1
- package/src/sap/fe/test/builder/KPIBuilder.js +13 -0
- package/src/sap/fe/test/builder/MdcTableBuilder.js +15 -10
- package/src/sap/fe/test/internal/ConsoleErrorChecker.js +3 -5
- package/src/sap/fe/test/library.js +3 -2
- package/src/sap/fe/test/library.ts +1 -0
package/src/sap/fe/test/Shell.js
CHANGED
|
@@ -4,285 +4,290 @@
|
|
|
4
4
|
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
5
5
|
|
|
6
6
|
*/
|
|
7
|
-
sap.ui.define(
|
|
8
|
-
"
|
|
7
|
+
sap.ui.define(
|
|
8
|
+
["sap/ui/test/OpaBuilder", "sap/ui/test/Opa5", "sap/fe/test/Utils", "sap/ui/test/actions/Press"],
|
|
9
|
+
function (OpaBuilder, Opa5, Utils, Press) {
|
|
10
|
+
"use strict";
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
oTile
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
iSeeFlpDashboard: function () {
|
|
171
|
-
return OpaBuilder.create(this).hasId("mainShell").description("Seeing FLP Dashboard").execute();
|
|
172
|
-
},
|
|
173
|
-
iShouldSeeTheAppTile: function (sTitle) {
|
|
174
|
-
return OpaBuilder.create(this)
|
|
175
|
-
.hasType("sap.ushell.ui.launchpad.Tile")
|
|
176
|
-
.hasProperties({
|
|
177
|
-
target: sTitle
|
|
178
|
-
})
|
|
179
|
-
.description("Seeing Tile " + sTitle)
|
|
180
|
-
.execute();
|
|
181
|
-
},
|
|
182
|
-
iSeeNavigateBack: function () {
|
|
183
|
-
return OpaBuilder.create(this).hasId("backBtn").description("I see the back navigation button").execute();
|
|
12
|
+
/**
|
|
13
|
+
* Constructs a test page definition for the shell.
|
|
14
|
+
* @class Provides a test page definition for the shell.
|
|
15
|
+
*
|
|
16
|
+
* When using {@link sap.fe.test.JourneyRunner}, this page is made available by default via <code>onTheShell</code>.
|
|
17
|
+
* @param {...object} [aAdditionalPageDefinitions] Additional custom page functions, provided in an object containing <code>actions</code> and <code>assertions</code>
|
|
18
|
+
* @returns {sap.fe.test.Shell} A shell page definition
|
|
19
|
+
* @name sap.fe.test.Shell
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
function ShellPage(aAdditionalPageDefinitions) {
|
|
23
|
+
aAdditionalPageDefinitions = Array.isArray(arguments[0]) ? arguments[0] : Array.prototype.slice.call(arguments, 0);
|
|
24
|
+
return Utils.mergeObjects.apply(
|
|
25
|
+
Utils,
|
|
26
|
+
[
|
|
27
|
+
{
|
|
28
|
+
actions: {
|
|
29
|
+
/**
|
|
30
|
+
* Navigates back via shell back button.
|
|
31
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
32
|
+
* @function
|
|
33
|
+
* @name sap.fe.test.Shell#iNavigateBack
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
iNavigateBack: function () {
|
|
37
|
+
return OpaBuilder.create(this)
|
|
38
|
+
.hasId("backBtn")
|
|
39
|
+
.doPress()
|
|
40
|
+
.description("Navigating back via shell")
|
|
41
|
+
.execute();
|
|
42
|
+
},
|
|
43
|
+
/**
|
|
44
|
+
* Navigates to the launch pad via the home button.
|
|
45
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
46
|
+
* @function
|
|
47
|
+
* @name sap.fe.test.Shell#iNavigateHome
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
iNavigateHome: function () {
|
|
51
|
+
return OpaBuilder.create(this)
|
|
52
|
+
.hasId("shell-header")
|
|
53
|
+
.do(function () {
|
|
54
|
+
// the logo is not a UI5 control
|
|
55
|
+
var oTestWindow = Opa5.getWindow();
|
|
56
|
+
oTestWindow.document.getElementById("shell-header-logo").click();
|
|
57
|
+
})
|
|
58
|
+
.description("Pressing Home button in Shell header")
|
|
59
|
+
.execute();
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* Opens the navigation menu in the shell header.
|
|
63
|
+
* @param {string} [NavigationTitle] The title of the navigation menu to be clicked. If undefined the menu is identified by the internal id only.
|
|
64
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
65
|
+
* @function
|
|
66
|
+
* @name sap.fe.test.Shell#iOpenNavigationMenu
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
iOpenNavigationMenu: function (NavigationTitle) {
|
|
70
|
+
return OpaBuilder.create(this)
|
|
71
|
+
.pollingInterval(1000) // the shell needs some time to prepare the navigation menu
|
|
72
|
+
.hasId("shellAppTitle")
|
|
73
|
+
.has(function (oShellObject) {
|
|
74
|
+
return NavigationTitle ? oShellObject.getText() === NavigationTitle : true;
|
|
75
|
+
})
|
|
76
|
+
.doPress()
|
|
77
|
+
.description("Expanding Shell Navigation Menu")
|
|
78
|
+
.execute();
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* Navigates via a navigation item in the shell's navigation menu.
|
|
82
|
+
* @param {string} sItem The label of the navigation item
|
|
83
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
84
|
+
* @function
|
|
85
|
+
* @name sap.fe.test.Shell#iNavigateViaMenu
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
iNavigateViaMenu: function (sItem) {
|
|
89
|
+
return OpaBuilder.create(this)
|
|
90
|
+
.hasId("sapUshellNavHierarchyItems")
|
|
91
|
+
.doOnAggregation("items", OpaBuilder.Matchers.properties({ title: sItem }), OpaBuilder.Actions.press())
|
|
92
|
+
.description(Utils.formatMessage("Navigating to '{0}' via Shell Navigation Menu", sItem))
|
|
93
|
+
.execute();
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* Selecting a tile in the launchpad by its target app, for example <code>iPressTile("SalesOrder-manage")</code>.
|
|
97
|
+
* @param {string} sTarget The target application (hash)
|
|
98
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
99
|
+
* @function
|
|
100
|
+
* @name sap.fe.test.Shell#iPressTile
|
|
101
|
+
* @public
|
|
102
|
+
*/
|
|
103
|
+
iPressTile: function (sTarget) {
|
|
104
|
+
return this.waitFor({
|
|
105
|
+
controlType: "sap.ushell.ui.launchpad.VizInstanceCdm",
|
|
106
|
+
matchers: function (oTile) {
|
|
107
|
+
return oTile.getTargetURL() === "#" + sTarget;
|
|
108
|
+
},
|
|
109
|
+
actions: new Press(),
|
|
110
|
+
success: function () {
|
|
111
|
+
Opa5.assert.ok(true, Utils.formatMessage("Clicking on tile with target '{0}'", sTarget));
|
|
112
|
+
},
|
|
113
|
+
errorMessage: "Could not find the tile"
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
iOpenDefaultValues: function () {
|
|
117
|
+
return OpaBuilder.create(this)
|
|
118
|
+
.hasId("userActionsMenuHeaderButton")
|
|
119
|
+
.doPress()
|
|
120
|
+
.description("Opening FLP Default Values dialog")
|
|
121
|
+
.execute();
|
|
122
|
+
},
|
|
123
|
+
iEnterAValueForUserDefaults: function (oField, vValue) {
|
|
124
|
+
return OpaBuilder.create(this)
|
|
125
|
+
.hasProperties({
|
|
126
|
+
name: oField.field
|
|
127
|
+
})
|
|
128
|
+
.isDialogElement()
|
|
129
|
+
.doEnterText(vValue)
|
|
130
|
+
.description("Entering text in the field '" + oField.field + "' with value '" + oField + "'")
|
|
131
|
+
.execute();
|
|
132
|
+
},
|
|
133
|
+
iSelectAListItem: function (sOption) {
|
|
134
|
+
return OpaBuilder.create(this)
|
|
135
|
+
.hasType("sap.m.StandardListItem")
|
|
136
|
+
.hasProperties({ title: sOption })
|
|
137
|
+
.doPress()
|
|
138
|
+
.description("Selecting item: " + sOption)
|
|
139
|
+
.execute();
|
|
140
|
+
},
|
|
141
|
+
iLaunchExtendedParameterDialog: function () {
|
|
142
|
+
return OpaBuilder.create(this)
|
|
143
|
+
.hasType("sap.m.Button")
|
|
144
|
+
.isDialogElement()
|
|
145
|
+
.hasProperties({
|
|
146
|
+
text: "Additional Values"
|
|
147
|
+
})
|
|
148
|
+
.doPress()
|
|
149
|
+
.description("Launching Extended Parameter Dialog")
|
|
150
|
+
.execute();
|
|
151
|
+
},
|
|
152
|
+
iClickOnButtonWithText: function (sText) {
|
|
153
|
+
return OpaBuilder.create(this)
|
|
154
|
+
.hasType("sap.m.Button")
|
|
155
|
+
.hasProperties({
|
|
156
|
+
text: sText
|
|
157
|
+
})
|
|
158
|
+
.doPress()
|
|
159
|
+
.description("Clicking on button with text: " + sText)
|
|
160
|
+
.execute();
|
|
161
|
+
},
|
|
162
|
+
iClickOnButtonWithIcon: function (sIcon) {
|
|
163
|
+
return OpaBuilder.create(this)
|
|
164
|
+
.hasType("sap.m.Button")
|
|
165
|
+
.hasProperties({
|
|
166
|
+
icon: "sap-icon://" + sIcon
|
|
167
|
+
})
|
|
168
|
+
.doPress()
|
|
169
|
+
.description("Clicking on button with icon: " + sIcon)
|
|
170
|
+
.execute();
|
|
171
|
+
}
|
|
184
172
|
},
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
.
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
173
|
+
assertions: {
|
|
174
|
+
iSeeFlpDashboard: function () {
|
|
175
|
+
return OpaBuilder.create(this).hasId("mainShell").description("Seeing FLP Dashboard").execute();
|
|
176
|
+
},
|
|
177
|
+
iShouldSeeTheAppTile: function (sTitle) {
|
|
178
|
+
return OpaBuilder.create(this)
|
|
179
|
+
.hasType("sap.ushell.ui.launchpad.VizInstanceCdm")
|
|
180
|
+
.hasProperties({
|
|
181
|
+
targetURL: sTitle
|
|
182
|
+
})
|
|
183
|
+
.description("Seeing Tile " + sTitle)
|
|
184
|
+
.execute();
|
|
185
|
+
},
|
|
186
|
+
iSeeNavigateBack: function () {
|
|
187
|
+
return OpaBuilder.create(this).hasId("backBtn").description("I see the back navigation button").execute();
|
|
188
|
+
},
|
|
189
|
+
iSeeShellNavHierarchyItem: function (sItemTitle, iItemPosition, iItemNumbers, sItemDesc) {
|
|
190
|
+
return OpaBuilder.create(this)
|
|
191
|
+
.viewId(null)
|
|
192
|
+
.hasId("backBtn")
|
|
193
|
+
.hasId("sapUshellNavHierarchyItems")
|
|
194
|
+
.hasAggregationLength("items", iItemNumbers)
|
|
195
|
+
.has(OpaBuilder.Matchers.aggregationAtIndex("items", iItemPosition - 1))
|
|
196
|
+
.hasProperties({ title: sItemTitle, description: sItemDesc })
|
|
197
|
+
.description(
|
|
198
|
+
Utils.formatMessage(
|
|
199
|
+
"Checking Navigation Hierarchy Items ({2}): Name={0}, Position={1}, Description={3}",
|
|
200
|
+
sItemTitle,
|
|
201
|
+
iItemPosition,
|
|
202
|
+
iItemNumbers,
|
|
203
|
+
sItemDesc
|
|
204
|
+
)
|
|
200
205
|
)
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
206
|
+
.execute();
|
|
207
|
+
},
|
|
208
|
+
iSeeShellAppTitle: function (sTitle) {
|
|
209
|
+
return OpaBuilder.create(this)
|
|
210
|
+
.viewId(null)
|
|
211
|
+
.hasId("shellAppTitle")
|
|
212
|
+
.hasProperties({ text: sTitle })
|
|
213
|
+
.description(sTitle + " is the Shell App Title")
|
|
214
|
+
.execute();
|
|
215
|
+
},
|
|
216
|
+
/**
|
|
217
|
+
* Check an intent-based navigation.
|
|
218
|
+
* The function checks the semantic object and the action within the URL of an application.
|
|
219
|
+
* Optionally, further URL parameters can be checked.
|
|
220
|
+
* @param {string} sSemanticObject The semantic object of the application
|
|
221
|
+
* @param {string} sAction The action of the application
|
|
222
|
+
* @param {Array} [aURLParams] More URL parameters to be checked. The pattern is:
|
|
223
|
+
* <code><pre>
|
|
224
|
+
* [{
|
|
225
|
+
* property: <expected name of URL parameter>,
|
|
226
|
+
* value: <expected value of URL parameter>
|
|
227
|
+
* }]
|
|
228
|
+
* </pre></code>
|
|
229
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
230
|
+
* @function
|
|
231
|
+
* @name sap.fe.test.Shell#iCheckIntentBasedNavigation
|
|
232
|
+
* @public
|
|
233
|
+
*/
|
|
234
|
+
iCheckIntentBasedNavigation: function (sSemanticObject, sAction, aURLParams) {
|
|
235
|
+
function _hasAllURLParameters(oURLParams, aInputURLParams) {
|
|
236
|
+
try {
|
|
237
|
+
aInputURLParams.forEach(function (oParam) {
|
|
238
|
+
if (oURLParams.hasOwnProperty(oParam.property)) {
|
|
239
|
+
if (oURLParams[oParam.property][0] !== oParam.value) {
|
|
240
|
+
throw "input parameter not equal to actual URL parameter";
|
|
241
|
+
}
|
|
242
|
+
} else {
|
|
243
|
+
throw "input parameter not found in URL";
|
|
237
244
|
}
|
|
245
|
+
});
|
|
246
|
+
return true;
|
|
247
|
+
} catch (error) {
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return OpaBuilder.create(this)
|
|
253
|
+
.check(function () {
|
|
254
|
+
var oParsedHash = Opa5.getWindow()
|
|
255
|
+
.sap.ushell.Container.getService("URLParsing")
|
|
256
|
+
.parseShellHash(Opa5.getWindow().document.location.hash);
|
|
257
|
+
if (oParsedHash.semanticObject === sSemanticObject && oParsedHash.action === sAction) {
|
|
258
|
+
return !aURLParams || _hasAllURLParameters(oParsedHash.params, aURLParams) ? true : false;
|
|
238
259
|
} else {
|
|
239
|
-
|
|
260
|
+
return false;
|
|
240
261
|
}
|
|
241
|
-
})
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
262
|
+
})
|
|
263
|
+
.error(function () {
|
|
264
|
+
var sHash = Opa5.getWindow().document.location.hash,
|
|
265
|
+
sLogErr = "Expected properties/values: ";
|
|
266
|
+
Opa5.assert.ok(false, "Current hash value: " + sHash);
|
|
267
|
+
Opa5.assert.ok(false, "Expected semantic object: " + sSemanticObject);
|
|
268
|
+
Opa5.assert.ok(false, "Expected action: " + sAction);
|
|
269
|
+
if (aURLParams) {
|
|
270
|
+
aURLParams.forEach(function (oParam) {
|
|
271
|
+
sLogErr = sLogErr + oParam.property + "=" + oParam.value + ",";
|
|
272
|
+
});
|
|
273
|
+
Opa5.assert.ok(false, sLogErr);
|
|
274
|
+
}
|
|
275
|
+
})
|
|
276
|
+
.success(
|
|
277
|
+
"Navigation successful. SemanticObject: " +
|
|
278
|
+
sSemanticObject +
|
|
279
|
+
", Action: " +
|
|
280
|
+
sAction +
|
|
281
|
+
" and all URL parameters are valid."
|
|
282
|
+
)
|
|
283
|
+
.execute();
|
|
246
284
|
}
|
|
247
|
-
|
|
248
|
-
return OpaBuilder.create(this)
|
|
249
|
-
.check(function () {
|
|
250
|
-
var oParsedHash = Opa5.getWindow()
|
|
251
|
-
.sap.ushell.Container.getService("URLParsing")
|
|
252
|
-
.parseShellHash(Opa5.getWindow().document.location.hash);
|
|
253
|
-
if (oParsedHash.semanticObject === sSemanticObject && oParsedHash.action === sAction) {
|
|
254
|
-
return !aURLParams || _hasAllURLParameters(oParsedHash.params, aURLParams) ? true : false;
|
|
255
|
-
} else {
|
|
256
|
-
return false;
|
|
257
|
-
}
|
|
258
|
-
})
|
|
259
|
-
.error(function () {
|
|
260
|
-
var sHash = Opa5.getWindow().document.location.hash,
|
|
261
|
-
sLogErr = "Expected properties/values: ";
|
|
262
|
-
Opa5.assert.ok(false, "Current hash value: " + sHash);
|
|
263
|
-
Opa5.assert.ok(false, "Expected semantic object: " + sSemanticObject);
|
|
264
|
-
Opa5.assert.ok(false, "Expected action: " + sAction);
|
|
265
|
-
if (aURLParams) {
|
|
266
|
-
aURLParams.forEach(function (oParam) {
|
|
267
|
-
sLogErr = sLogErr + oParam.property + "=" + oParam.value + ",";
|
|
268
|
-
});
|
|
269
|
-
Opa5.assert.ok(false, sLogErr);
|
|
270
|
-
}
|
|
271
|
-
})
|
|
272
|
-
.success(
|
|
273
|
-
"Navigation successful. SemanticObject: " +
|
|
274
|
-
sSemanticObject +
|
|
275
|
-
", Action: " +
|
|
276
|
-
sAction +
|
|
277
|
-
" and all URL parameters are valid."
|
|
278
|
-
)
|
|
279
|
-
.execute();
|
|
280
285
|
}
|
|
281
286
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
287
|
+
].concat(aAdditionalPageDefinitions)
|
|
288
|
+
);
|
|
289
|
+
}
|
|
286
290
|
|
|
287
|
-
|
|
288
|
-
}
|
|
291
|
+
return ShellPage;
|
|
292
|
+
}
|
|
293
|
+
);
|
package/src/sap/fe/test/Stubs.js
CHANGED
|
@@ -47,29 +47,31 @@ sap.ui.define([], function () {
|
|
|
47
47
|
|
|
48
48
|
stubMessageToast: function (oWindow) {
|
|
49
49
|
Stubs.prepareStubs(oWindow);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
oWindow.sap.ui.require(["sap/m/MessageToast"], (oMessageToast) => {
|
|
51
|
+
oWindow.sapFEStubs._sapMMessageToastShowOriginal = oMessageToast.show;
|
|
52
|
+
oWindow.sapFEStubs.setLastToastMessage = function (sMessage) {
|
|
53
|
+
oWindow.sapFEStubs._sapMMessageToastLastMessage = sMessage;
|
|
54
|
+
};
|
|
55
|
+
oWindow.sapFEStubs.getLastToastMessage = function () {
|
|
56
|
+
return oWindow.sapFEStubs._sapMMessageToastLastMessage;
|
|
57
|
+
};
|
|
58
|
+
oMessageToast.show = function (sMessage) {
|
|
59
|
+
oWindow.sapFEStubs.setLastToastMessage(sMessage);
|
|
60
|
+
return oWindow.sapFEStubs._sapMMessageToastShowOriginal.apply(this, arguments);
|
|
61
|
+
};
|
|
62
|
+
});
|
|
62
63
|
},
|
|
63
64
|
restoreMessageToast: function (oWindow) {
|
|
64
65
|
if (!oWindow.sapFEStubs || !oWindow.sapFEStubs._sapMMessageToastShowOriginal) {
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
oWindow.sap.ui.require(["sap/m/MessageToast"], (oMessageToast) => {
|
|
69
|
+
oMessageToast.show = oWindow.sapFEStubs._sapMMessageToastShowOriginal;
|
|
70
|
+
delete oWindow.sapFEStubs._sapMMessageToastShowOriginal;
|
|
71
|
+
delete oWindow.sapFEStubs._sapMMessageToastLastMessage;
|
|
72
|
+
delete oWindow.sapFEStubs.setLastToastMessage;
|
|
73
|
+
delete oWindow.sapFEStubs.getLastToastMessage;
|
|
74
|
+
});
|
|
73
75
|
},
|
|
74
76
|
|
|
75
77
|
stubMisc: function (oWindow) {
|