@sapui5/sap.fe.test 1.101.0 → 1.103.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/BaseActions.js +86 -97
- package/src/sap/fe/test/BaseArrangements.js +4 -15
- package/src/sap/fe/test/BaseAssertions.js +39 -46
- 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 +10 -5
- package/src/sap/fe/test/Flexibility.js +115 -162
- package/src/sap/fe/test/JestTemplatingHelper.js +54 -24
- package/src/sap/fe/test/JestTemplatingHelper.ts +59 -30
- package/src/sap/fe/test/JourneyRunner.js +31 -37
- package/src/sap/fe/test/ListReport.js +10 -22
- package/src/sap/fe/test/LocationUtil.js +12 -16
- package/src/sap/fe/test/ObjectPage.js +64 -38
- package/src/sap/fe/test/Shell.js +94 -40
- package/src/sap/fe/test/TemplatePage.js +14 -2
- package/src/sap/fe/test/TemplatingTestUtils.js +20 -20
- package/src/sap/fe/test/UI5MockHelper.js +101 -21
- package/src/sap/fe/test/UI5MockHelper.ts +92 -26
- package/src/sap/fe/test/Utils.js +19 -20
- package/src/sap/fe/test/api/BaseAPI.js +11 -26
- package/src/sap/fe/test/api/ChartActions.js +116 -119
- package/src/sap/fe/test/api/ChartAssertions.js +18 -22
- package/src/sap/fe/test/api/CollaborationAPI.js +215 -0
- package/src/sap/fe/test/api/CollaborationAPI.ts +238 -0
- package/src/sap/fe/test/api/DialogAPI.js +11 -13
- package/src/sap/fe/test/api/DialogActions.js +8 -8
- package/src/sap/fe/test/api/DialogAssertions.js +8 -9
- package/src/sap/fe/test/api/DialogHelper.js +63 -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/DialogMessageActions.js +2 -1
- package/src/sap/fe/test/api/DialogType.js +11 -2
- package/src/sap/fe/test/api/DialogValueHelpActions.js +17 -39
- package/src/sap/fe/test/api/DialogValueHelpAssertions.js +11 -19
- package/src/sap/fe/test/api/FilterBarAPI.js +11 -12
- package/src/sap/fe/test/api/FilterBarActions.js +26 -40
- package/src/sap/fe/test/api/FilterBarAssertions.js +28 -47
- package/src/sap/fe/test/api/FooterActionsBase.js +3 -4
- package/src/sap/fe/test/api/FooterActionsOP.js +6 -10
- package/src/sap/fe/test/api/FooterAssertionsBase.js +5 -10
- package/src/sap/fe/test/api/FooterAssertionsOP.js +8 -13
- package/src/sap/fe/test/api/FormAPI.js +5 -6
- package/src/sap/fe/test/api/FormActions.js +11 -21
- package/src/sap/fe/test/api/FormAssertions.js +14 -20
- package/src/sap/fe/test/api/HeaderAPI.js +12 -27
- package/src/sap/fe/test/api/HeaderActions.js +10 -12
- package/src/sap/fe/test/api/HeaderActionsLR.js +76 -82
- package/src/sap/fe/test/api/HeaderAssertions.js +76 -59
- package/src/sap/fe/test/api/HeaderAssertionsLR.js +5 -8
- package/src/sap/fe/test/api/HeaderLR.js +7 -19
- package/src/sap/fe/test/api/KPICardAssertions.js +18 -37
- package/src/sap/fe/test/api/TableAPI.js +33 -47
- package/src/sap/fe/test/api/TableActions.js +3 -35
- package/src/sap/fe/test/api/TableAssertions.js +51 -69
- package/src/sap/fe/test/builder/FEBuilder.js +71 -75
- package/src/sap/fe/test/builder/MacroFieldBuilder.js +162 -156
- package/src/sap/fe/test/builder/MdcFieldBuilder.js +33 -29
- package/src/sap/fe/test/builder/MdcFilterFieldBuilder.js +9 -7
- package/src/sap/fe/test/builder/MdcTableBuilder.js +97 -16
- package/src/sap/fe/test/builder/VMBuilder.js +27 -43
- package/src/sap/fe/test/library.js +3 -2
- package/src/sap/fe/test/library.ts +1 -0
- package/src/sap/fe/test/massEdit.js +0 -62
|
@@ -17,7 +17,7 @@ sap.ui.define(
|
|
|
17
17
|
"sap/base/Log",
|
|
18
18
|
"sap/base/util/ObjectPath"
|
|
19
19
|
],
|
|
20
|
-
function(BaseObject, Opa5, Utils, BaseArrangements, BaseActions, BaseAssertions, Shell, opaQunit, Log, ObjectPath) {
|
|
20
|
+
function (BaseObject, Opa5, Utils, BaseArrangements, BaseActions, BaseAssertions, Shell, opaQunit, Log, ObjectPath) {
|
|
21
21
|
"use strict";
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -34,19 +34,17 @@ sap.ui.define(
|
|
|
34
34
|
* Constructs a new JourneyRunner instance.
|
|
35
35
|
*
|
|
36
36
|
* @class A JourneyRunner for executing integration tests with given settings.
|
|
37
|
-
*
|
|
38
37
|
* @param {object} [mSettings] The settings object
|
|
39
38
|
* @param {object} [mSettings.pages] The available Opa pages
|
|
40
39
|
* @param {object} [mSettings.opaConfig] The Opa configuration applied via {@link sap.ui.test.Opa5#sap.ui.test.Opa5.extendConfig}
|
|
41
40
|
* @param {string} [mSettings.launchUrl] The URL to the launching page (usually a FLP.html)
|
|
42
41
|
* @param {object} [mSettings.launchParameters] The URL launch parameters
|
|
43
42
|
* @param {boolean} [mSettings.async] If false (default), only one JourneyRunner is executed at a time
|
|
44
|
-
*
|
|
45
43
|
* @alias sap.fe.test.JourneyRunner
|
|
46
44
|
* @public
|
|
47
45
|
*/
|
|
48
46
|
var JourneyRunner = BaseObject.extend("sap.fe.test.JourneyRunner", {
|
|
49
|
-
constructor: function(mSettings) {
|
|
47
|
+
constructor: function (mSettings) {
|
|
50
48
|
BaseObject.apply(this);
|
|
51
49
|
// store a copy of the settings object
|
|
52
50
|
this._mInstanceSettings = Utils.mergeObjects(
|
|
@@ -72,15 +70,14 @@ sap.ui.define(
|
|
|
72
70
|
* @param {boolean} [mSettings.async] If false (default), only one JourneyRunner is executed at a time
|
|
73
71
|
* @param {Function[] | string[]} vJourneys The journeys to be executed. If a journey is represented as a string, it will be interpreted
|
|
74
72
|
* as a module path to the file that should be loaded. Else it is expected to be a function.
|
|
75
|
-
* Alternatively, instead of being wrapped in an array, the journeys can also be given as separate parameters:
|
|
73
|
+
* Alternatively, instead of being wrapped in an array, the journeys can also be given as separate parameters:
|
|
76
74
|
* <pre>.run(mSettings, Journey1, Journey2, ...)</pre>
|
|
77
75
|
* @returns {object} A <code>Promise</code> that is resolved after all tests have been executed
|
|
78
|
-
*
|
|
79
76
|
* @function
|
|
80
77
|
* @name sap.fe.test.JourneyRunner#run
|
|
81
78
|
* @public
|
|
82
79
|
*/
|
|
83
|
-
run: function(mSettings, vJourneys) {
|
|
80
|
+
run: function (mSettings, vJourneys) {
|
|
84
81
|
var iJourneyParameterIndex = 1;
|
|
85
82
|
if (!Utils.isOfType(mSettings, Object)) {
|
|
86
83
|
iJourneyParameterIndex = 0;
|
|
@@ -90,7 +87,8 @@ sap.ui.define(
|
|
|
90
87
|
}
|
|
91
88
|
|
|
92
89
|
var aJourneys = Array.prototype.slice.call(arguments, iJourneyParameterIndex); // journey-related parameter(s) as array
|
|
93
|
-
if (aJourneys && aJourneys.length && Array.isArray(aJourneys[0])) {
|
|
90
|
+
if (aJourneys && aJourneys.length && Array.isArray(aJourneys[0])) {
|
|
91
|
+
// if the first journey parameter is an array...
|
|
94
92
|
aJourneys = aJourneys[0]; // ...then unwrap it, to use this array itself
|
|
95
93
|
}
|
|
96
94
|
var bAsync = mSettings.async,
|
|
@@ -106,7 +104,7 @@ sap.ui.define(
|
|
|
106
104
|
.then(this._preRunActions.bind(this, mSettings))
|
|
107
105
|
.then(this._runActions.bind(this, aJourneys))
|
|
108
106
|
.then(this._postRunActions.bind(this, mSettings))
|
|
109
|
-
.catch(function(oError) {
|
|
107
|
+
.catch(function (oError) {
|
|
110
108
|
Log.error("JourneyRunner.run failed", oError);
|
|
111
109
|
});
|
|
112
110
|
|
|
@@ -127,12 +125,11 @@ sap.ui.define(
|
|
|
127
125
|
*
|
|
128
126
|
* @param {object} mSettings The settings object of the runner instance
|
|
129
127
|
* @returns {sap.ui.test.Opa} An Opa instance for the base actions
|
|
130
|
-
*
|
|
131
128
|
* @function
|
|
132
129
|
* @name sap.fe.test.JourneyRunner#getBaseActions
|
|
133
130
|
* @protected
|
|
134
131
|
*/
|
|
135
|
-
getBaseActions: function(mSettings) {
|
|
132
|
+
getBaseActions: function (mSettings) {
|
|
136
133
|
return new BaseActions();
|
|
137
134
|
},
|
|
138
135
|
|
|
@@ -146,12 +143,11 @@ sap.ui.define(
|
|
|
146
143
|
*
|
|
147
144
|
* @param {object} mSettings The settings object of the runner instance
|
|
148
145
|
* @returns {sap.ui.test.Opa} An Opa instance for the base assertions
|
|
149
|
-
*
|
|
150
146
|
* @function
|
|
151
147
|
* @name sap.fe.test.JourneyRunner#getBaseAssertions
|
|
152
148
|
* @protected
|
|
153
149
|
*/
|
|
154
|
-
getBaseAssertions: function(mSettings) {
|
|
150
|
+
getBaseAssertions: function (mSettings) {
|
|
155
151
|
return new BaseAssertions();
|
|
156
152
|
},
|
|
157
153
|
|
|
@@ -165,83 +161,83 @@ sap.ui.define(
|
|
|
165
161
|
*
|
|
166
162
|
* @param {object} mSettings The settings object of the runner instance
|
|
167
163
|
* @returns {sap.ui.test.Opa} An Opa instance for the base arrangements
|
|
168
|
-
*
|
|
169
164
|
* @function
|
|
170
165
|
* @name sap.fe.test.JourneyRunner#getBaseArrangements
|
|
171
166
|
* @protected
|
|
172
167
|
*/
|
|
173
|
-
getBaseArrangements: function(mSettings) {
|
|
168
|
+
getBaseArrangements: function (mSettings) {
|
|
174
169
|
return new BaseArrangements(mSettings);
|
|
175
170
|
},
|
|
176
171
|
|
|
177
|
-
_preRunActions: function(mSettings) {
|
|
172
|
+
_preRunActions: function (mSettings) {
|
|
178
173
|
Opa5.extendConfig(this._getOpaConfig(mSettings));
|
|
179
174
|
Opa5.createPageObjects(mSettings.pages);
|
|
180
175
|
},
|
|
181
176
|
|
|
182
|
-
_runActions: function(aJourneys) {
|
|
177
|
+
_runActions: function (aJourneys) {
|
|
183
178
|
var that = this,
|
|
184
179
|
pPromiseChain = Promise.resolve(),
|
|
185
180
|
fnRunnerResolve,
|
|
186
|
-
pRunnerEnds = new Promise(function(resolve) {
|
|
181
|
+
pRunnerEnds = new Promise(function (resolve) {
|
|
187
182
|
fnRunnerResolve = resolve;
|
|
188
183
|
});
|
|
189
184
|
|
|
190
185
|
Log.info("JourneyRunner started");
|
|
191
186
|
|
|
192
|
-
QUnit.done(function() {
|
|
187
|
+
QUnit.done(function () {
|
|
193
188
|
Log.info("JourneyRunner ended");
|
|
194
189
|
fnRunnerResolve();
|
|
195
190
|
});
|
|
196
191
|
|
|
197
|
-
aJourneys.forEach(function(vJourney) {
|
|
192
|
+
aJourneys.forEach(function (vJourney) {
|
|
198
193
|
if (Utils.isOfType(vJourney, String)) {
|
|
199
|
-
pPromiseChain = pPromiseChain.then(function() {
|
|
200
|
-
return new Promise(function(resolve, reject) {
|
|
201
|
-
sap.ui.require([vJourney], function(oJourney) {
|
|
194
|
+
pPromiseChain = pPromiseChain.then(function () {
|
|
195
|
+
return new Promise(function (resolve, reject) {
|
|
196
|
+
sap.ui.require([vJourney], function (oJourney) {
|
|
202
197
|
resolve(oJourney);
|
|
203
198
|
});
|
|
204
199
|
});
|
|
205
200
|
});
|
|
206
201
|
} else {
|
|
207
|
-
pPromiseChain = pPromiseChain.then(function() {
|
|
202
|
+
pPromiseChain = pPromiseChain.then(function () {
|
|
208
203
|
return vJourney;
|
|
209
204
|
});
|
|
210
205
|
}
|
|
211
206
|
pPromiseChain = pPromiseChain.then(that._runJourney);
|
|
212
207
|
});
|
|
213
|
-
return pPromiseChain.then(function() {
|
|
208
|
+
return pPromiseChain.then(function () {
|
|
214
209
|
return pRunnerEnds;
|
|
215
210
|
});
|
|
216
211
|
},
|
|
217
212
|
|
|
218
|
-
_runJourney: function(vJourney) {
|
|
213
|
+
_runJourney: function (vJourney) {
|
|
219
214
|
if (Utils.isOfType(vJourney, Function)) {
|
|
220
215
|
vJourney.call();
|
|
221
216
|
}
|
|
222
217
|
},
|
|
223
218
|
|
|
224
|
-
_postRunActions: function(mSettings) {
|
|
219
|
+
_postRunActions: function (mSettings) {
|
|
225
220
|
this._removePages(mSettings.pages);
|
|
226
221
|
Opa5.resetConfig();
|
|
227
222
|
},
|
|
228
223
|
|
|
229
|
-
_removePages: function(mPages) {
|
|
224
|
+
_removePages: function (mPages) {
|
|
230
225
|
var that = this;
|
|
231
|
-
mPages
|
|
232
|
-
Object.keys(mPages).forEach(function(sPageName) {
|
|
226
|
+
if (mPages) {
|
|
227
|
+
Object.keys(mPages).forEach(function (sPageName) {
|
|
233
228
|
var mPage = mPages[sPageName],
|
|
234
229
|
sClassName = that._createClassName(mPage.namespace || "sap.ui.test.opa.pageObject", sPageName);
|
|
235
230
|
// remove path entry to avoid error log flooding from OPA5 - it is newly created anyways
|
|
236
231
|
ObjectPath.set(sClassName, undefined);
|
|
237
232
|
});
|
|
233
|
+
}
|
|
238
234
|
},
|
|
239
235
|
|
|
240
|
-
_createClassName: function(sNameSpace, sName) {
|
|
236
|
+
_createClassName: function (sNameSpace, sName) {
|
|
241
237
|
return sNameSpace + "." + sName;
|
|
242
238
|
},
|
|
243
239
|
|
|
244
|
-
_getOpaConfig: function(mSettings) {
|
|
240
|
+
_getOpaConfig: function (mSettings) {
|
|
245
241
|
var oConfig = Object.assign(
|
|
246
242
|
{
|
|
247
243
|
viewNamespace: "sap.fe.templates",
|
|
@@ -272,12 +268,11 @@ sap.ui.define(
|
|
|
272
268
|
* Gets the global journey runner instance.
|
|
273
269
|
*
|
|
274
270
|
* @returns {object} The global default {@link sap.fe.test.JourneyRunner} instance
|
|
275
|
-
*
|
|
276
271
|
* @function
|
|
277
272
|
* @public
|
|
278
273
|
* @static
|
|
279
274
|
*/
|
|
280
|
-
JourneyRunner.getDefaultRunner = function() {
|
|
275
|
+
JourneyRunner.getDefaultRunner = function () {
|
|
281
276
|
if (!_oDefaultRunner) {
|
|
282
277
|
_oDefaultRunner = new JourneyRunner();
|
|
283
278
|
}
|
|
@@ -288,12 +283,11 @@ sap.ui.define(
|
|
|
288
283
|
* Sets the global journey runner instance.
|
|
289
284
|
*
|
|
290
285
|
* @param {sap.fe.test.JourneyRunner} oDefaultRunner Defines the global default {@link sap.fe.test.JourneyRunner} instance
|
|
291
|
-
*
|
|
292
286
|
* @function
|
|
293
287
|
* @public
|
|
294
288
|
* @static
|
|
295
289
|
*/
|
|
296
|
-
JourneyRunner.setDefaultRunner = function(oDefaultRunner) {
|
|
290
|
+
JourneyRunner.setDefaultRunner = function (oDefaultRunner) {
|
|
297
291
|
if (_oDefaultRunner) {
|
|
298
292
|
_oDefaultRunner.destroy();
|
|
299
293
|
}
|
|
@@ -309,7 +303,7 @@ sap.ui.define(
|
|
|
309
303
|
* @public
|
|
310
304
|
* @static
|
|
311
305
|
*/
|
|
312
|
-
JourneyRunner.run = function() {
|
|
306
|
+
JourneyRunner.run = function () {
|
|
313
307
|
var oRunner = JourneyRunner.getDefaultRunner();
|
|
314
308
|
oRunner.run.apply(oRunner, arguments);
|
|
315
309
|
};
|
|
@@ -61,19 +61,18 @@ sap.ui.define(
|
|
|
61
61
|
* <code><pre>
|
|
62
62
|
* var oListReportDefinition = new ListReport({ appId: "MyApp", componentId: "MyListReportId", entitySet: "MyEntitySet" });
|
|
63
63
|
* </pre></code>
|
|
64
|
-
*
|
|
65
64
|
* @param {object} oPageDefinition The required parameters
|
|
66
65
|
* @param {string} oPageDefinition.appId The app id (defined in the manifest root)
|
|
67
66
|
* @param {string} oPageDefinition.componentId The component id (defined in the target section for the list report within the manifest)
|
|
68
67
|
* @param {string} oPageDefinition.entitySet The entitySet (optional)(defined in the settings of the corresponding target component within the manifest)
|
|
69
68
|
* @param {string} oPageDefinition.contextPath The contextPath (optional)(defined in the settings of the corresponding target component within the manifest)
|
|
70
|
-
* @param {...object} [
|
|
69
|
+
* @param {...object} [aInAdditionalPageDefinitions] Additional custom page functions, provided in an object containing <code>actions</code> and <code>assertions</code>
|
|
71
70
|
* @returns {sap.fe.test.ListReport} A list report page definition
|
|
72
71
|
* @name sap.fe.test.ListReport
|
|
73
72
|
* @extends sap.fe.test.TemplatePage
|
|
74
73
|
* @public
|
|
75
74
|
*/
|
|
76
|
-
function ListReport(oPageDefinition,
|
|
75
|
+
function ListReport(oPageDefinition, aInAdditionalPageDefinitions) {
|
|
77
76
|
var sAppId = oPageDefinition.appId,
|
|
78
77
|
sComponentId = oPageDefinition.componentId,
|
|
79
78
|
sContextPath = oPageDefinition.contextPath,
|
|
@@ -164,7 +163,6 @@ sap.ui.define(
|
|
|
164
163
|
*
|
|
165
164
|
* @param {boolean} [bCollapse] Defines whether the header should be collapsed, else it is expanded (default)
|
|
166
165
|
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
167
|
-
*
|
|
168
166
|
* @function
|
|
169
167
|
* @name sap.fe.test.ListReport.actions#iCollapseExpandPageHeader
|
|
170
168
|
* @public
|
|
@@ -382,12 +380,6 @@ sap.ui.define(
|
|
|
382
380
|
.description("Seeing Contact Card with Avatar Image in ListReport")
|
|
383
381
|
.execute();
|
|
384
382
|
},
|
|
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
383
|
iSeeAvatarImage: function (sImageSource) {
|
|
392
384
|
return OpaBuilder.create(this)
|
|
393
385
|
.hasType("sap.m.Avatar")
|
|
@@ -428,9 +420,7 @@ sap.ui.define(
|
|
|
428
420
|
.execute();
|
|
429
421
|
},
|
|
430
422
|
iSeeDeleteConfirmation: function () {
|
|
431
|
-
return this._iSeeTheMessageToast(
|
|
432
|
-
oResourceBundleCore.getText("C_TRANSACTION_HELPER_OBJECT_PAGE_DELETE_TOAST_SINGULAR")
|
|
433
|
-
);
|
|
423
|
+
return this._iSeeTheMessageToast(oResourceBundleCore.getText("C_TRANSACTION_HELPER_DELETE_TOAST_SINGULAR"));
|
|
434
424
|
},
|
|
435
425
|
iSeePageTitle: function (sTitle) {
|
|
436
426
|
return OpaBuilder.create(this)
|
|
@@ -507,22 +497,20 @@ sap.ui.define(
|
|
|
507
497
|
},
|
|
508
498
|
iSeeDraftIndicator: function () {
|
|
509
499
|
return OpaBuilder.create(this)
|
|
510
|
-
.hasType("sap.m.
|
|
500
|
+
.hasType("sap.m.ObjectMarker")
|
|
511
501
|
.hasProperties({
|
|
512
|
-
|
|
502
|
+
type: "Draft"
|
|
513
503
|
})
|
|
514
504
|
.description("Draft indicator is visible")
|
|
515
505
|
.execute();
|
|
516
506
|
},
|
|
517
507
|
iSeeDraftIndicatorLocked: function (user) {
|
|
518
|
-
var
|
|
519
|
-
|
|
520
|
-
[user]
|
|
521
|
-
);
|
|
508
|
+
var props = user ? { type: "LockedBy", additionalInfo: user } : { type: "Locked" };
|
|
509
|
+
|
|
522
510
|
return OpaBuilder.create(this)
|
|
523
|
-
.hasType("sap.m.
|
|
524
|
-
.hasProperties(
|
|
525
|
-
.description("Draft indicator is visible and
|
|
511
|
+
.hasType("sap.m.ObjectMarker")
|
|
512
|
+
.hasProperties(props)
|
|
513
|
+
.description("Draft indicator is visible and locked" + (user ? " by '" + user + "'" : ""))
|
|
526
514
|
.execute();
|
|
527
515
|
},
|
|
528
516
|
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)
|
|
@@ -125,7 +125,6 @@ sap.ui.define(
|
|
|
125
125
|
* <code><pre>
|
|
126
126
|
* var oObjectPageDefinition = new ObjectPage({ appId: "MyApp", componentId: "MyObjectPageId", entitySet: "MyEntitySet" });
|
|
127
127
|
* </pre></code>
|
|
128
|
-
*
|
|
129
128
|
* @param {object} oPageDefinition The required parameters
|
|
130
129
|
* @param {string} oPageDefinition.appId The app id (defined in the manifest root)
|
|
131
130
|
* @param {string} oPageDefinition.componentId The component id (defined in the target section for the list report within the manifest)
|
|
@@ -154,7 +153,7 @@ sap.ui.define(
|
|
|
154
153
|
AnchorBarId = "fe::ObjectPage-anchBar",
|
|
155
154
|
PaginatorId = "fe::Paginator",
|
|
156
155
|
EditableHeaderTitleId = "EditableHeaderForm::EditableHeaderTitle",
|
|
157
|
-
|
|
156
|
+
PageEditMode = {
|
|
158
157
|
DISPLAY: "Display",
|
|
159
158
|
EDITABLE: "Editable"
|
|
160
159
|
},
|
|
@@ -262,7 +261,6 @@ sap.ui.define(
|
|
|
262
261
|
*
|
|
263
262
|
* @param {boolean} [bCollapse] Defines whether header should be collapsed, else it gets expanded (default)
|
|
264
263
|
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
265
|
-
*
|
|
266
264
|
* @function
|
|
267
265
|
* @name sap.fe.test.ObjectPage.actions#iCollapseExpandPageHeader
|
|
268
266
|
* @public
|
|
@@ -278,6 +276,15 @@ sap.ui.define(
|
|
|
278
276
|
.description("Pressing 'More Links' button")
|
|
279
277
|
.execute();
|
|
280
278
|
},
|
|
279
|
+
iClickQuickViewTitleLink: function (sText) {
|
|
280
|
+
return OpaBuilder.create(this)
|
|
281
|
+
.hasType("sap.m.Link")
|
|
282
|
+
.isDialogElement(true)
|
|
283
|
+
.hasProperties({ text: sText })
|
|
284
|
+
.doPress()
|
|
285
|
+
.description("Navigating via quickview title link '" + sText + "'")
|
|
286
|
+
.execute();
|
|
287
|
+
},
|
|
281
288
|
iClickLinkWithText: function (sText) {
|
|
282
289
|
return OpaBuilder.create(this)
|
|
283
290
|
.hasType("sap.m.Link")
|
|
@@ -300,15 +307,15 @@ sap.ui.define(
|
|
|
300
307
|
.execute();
|
|
301
308
|
},
|
|
302
309
|
iEnableLink: function (sText) {
|
|
303
|
-
|
|
304
|
-
OpaBuilder.
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
var vAggregationMatcher = FEBuilder.Matchers.deepAggregationMatcher("cells/items/items", [
|
|
311
|
+
OpaBuilder.Matchers.properties({ text: sText })
|
|
312
|
+
]);
|
|
313
|
+
return OpaBuilder.create(this)
|
|
314
|
+
.hasType("sap.m.ColumnListItem")
|
|
315
|
+
.has(vAggregationMatcher)
|
|
316
|
+
.doPress("selectMulti")
|
|
317
|
+
.description("The CheckBox for link " + sText + " is selected")
|
|
318
|
+
.execute();
|
|
312
319
|
},
|
|
313
320
|
iPressKeyboardShortcutOnSection: function (sShortcut, mProperties) {
|
|
314
321
|
return this._iPressKeyboardShortcut(undefined, sShortcut, mProperties, "sap.uxap.ObjectPageSection");
|
|
@@ -331,7 +338,6 @@ sap.ui.define(
|
|
|
331
338
|
* }
|
|
332
339
|
* </pre></code>
|
|
333
340
|
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
334
|
-
*
|
|
335
341
|
* @function
|
|
336
342
|
* @name sap.fe.test.ObjectPage.actions#iGoToSection
|
|
337
343
|
* @public
|
|
@@ -382,7 +388,6 @@ sap.ui.define(
|
|
|
382
388
|
*
|
|
383
389
|
* @param {string} sName The name of the section
|
|
384
390
|
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
385
|
-
*
|
|
386
391
|
* @private
|
|
387
392
|
*/
|
|
388
393
|
iOpenSectionWithTitle: function (sName) {
|
|
@@ -439,6 +444,19 @@ sap.ui.define(
|
|
|
439
444
|
.description("Click on the message")
|
|
440
445
|
)
|
|
441
446
|
.execute();
|
|
447
|
+
},
|
|
448
|
+
iClickBackOnMessageView: function () {
|
|
449
|
+
return OpaBuilder.create(this)
|
|
450
|
+
.hasType("sap.m.MessageView")
|
|
451
|
+
.isDialogElement(true)
|
|
452
|
+
.doOnChildren(
|
|
453
|
+
OpaBuilder.create(this)
|
|
454
|
+
.hasType("sap.m.Button")
|
|
455
|
+
.hasProperties({ icon: "sap-icon://nav-back" })
|
|
456
|
+
.doPress()
|
|
457
|
+
.description("Click on the message view back")
|
|
458
|
+
)
|
|
459
|
+
.execute();
|
|
442
460
|
}
|
|
443
461
|
},
|
|
444
462
|
/**
|
|
@@ -526,6 +544,28 @@ sap.ui.define(
|
|
|
526
544
|
return new FormAssertions(_getFormBuilder(this, vFormIdentifier), vFormIdentifier);
|
|
527
545
|
},
|
|
528
546
|
|
|
547
|
+
iSeeMessageButton: function (messageType, messageButtonText) {
|
|
548
|
+
var message = {
|
|
549
|
+
Error: {
|
|
550
|
+
"type": "Negative"
|
|
551
|
+
},
|
|
552
|
+
Warning: {
|
|
553
|
+
"type": "Critical"
|
|
554
|
+
},
|
|
555
|
+
Information: {
|
|
556
|
+
"type": "Neutral"
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
return OpaBuilder.create(this)
|
|
560
|
+
.hasType("sap.fe.common.MessageButton")
|
|
561
|
+
.hasProperties({
|
|
562
|
+
text: messageButtonText,
|
|
563
|
+
type: message[messageType]["type"]
|
|
564
|
+
})
|
|
565
|
+
.description("Messagebutton is visible with " + message[messageType]["type"] + " button type")
|
|
566
|
+
.execute();
|
|
567
|
+
},
|
|
568
|
+
|
|
529
569
|
iSeeLinkWithText: function (sText) {
|
|
530
570
|
return OpaBuilder.create(this)
|
|
531
571
|
.hasType("sap.m.Link")
|
|
@@ -565,12 +605,6 @@ sap.ui.define(
|
|
|
565
605
|
.execute()
|
|
566
606
|
);
|
|
567
607
|
},
|
|
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
608
|
iSeeContactPopoverWithAvatarImage: function (sImageSource) {
|
|
575
609
|
return OpaBuilder.create(this)
|
|
576
610
|
.hasType("sap.ui.mdc.link.Panel")
|
|
@@ -592,10 +626,10 @@ sap.ui.define(
|
|
|
592
626
|
.execute();
|
|
593
627
|
},
|
|
594
628
|
iSeeObjectPageInDisplayMode: function () {
|
|
595
|
-
return this._iSeeObjectPageInMode(
|
|
629
|
+
return this._iSeeObjectPageInMode(PageEditMode.DISPLAY);
|
|
596
630
|
},
|
|
597
631
|
iSeeObjectPageInEditMode: function () {
|
|
598
|
-
return this._iSeeObjectPageInMode(
|
|
632
|
+
return this._iSeeObjectPageInMode(PageEditMode.EDITABLE);
|
|
599
633
|
},
|
|
600
634
|
_iSeeObjectPageInMode: function (sMode) {
|
|
601
635
|
return OpaBuilder.create(this)
|
|
@@ -644,6 +678,13 @@ sap.ui.define(
|
|
|
644
678
|
.description("FLP link with text '" + sDescription + "' is present")
|
|
645
679
|
.execute();
|
|
646
680
|
},
|
|
681
|
+
iSeeLabel: function (sDescription) {
|
|
682
|
+
return OpaBuilder.create(this)
|
|
683
|
+
.hasType("sap.m.Label")
|
|
684
|
+
.hasProperties({ text: sDescription })
|
|
685
|
+
.description("Label '" + sDescription + "' is present")
|
|
686
|
+
.execute();
|
|
687
|
+
},
|
|
647
688
|
iSeeSimpleFormWithLabel: function (sDescription) {
|
|
648
689
|
return OpaBuilder.create(this)
|
|
649
690
|
.hasType("sap.m.Label")
|
|
@@ -712,9 +753,7 @@ sap.ui.define(
|
|
|
712
753
|
return this._iSeeTheMessageToast(oResourceBundleCore.getText("C_TRANSACTION_HELPER_OBJECT_SAVED"));
|
|
713
754
|
},
|
|
714
755
|
iSeeDeleteConfirmation: function () {
|
|
715
|
-
return this._iSeeTheMessageToast(
|
|
716
|
-
oResourceBundleCore.getText("C_TRANSACTION_HELPER_OBJECT_PAGE_DELETE_TOAST_SINGULAR")
|
|
717
|
-
);
|
|
756
|
+
return this._iSeeTheMessageToast(oResourceBundleCore.getText("C_TRANSACTION_HELPER_DELETE_TOAST_SINGULAR"));
|
|
718
757
|
},
|
|
719
758
|
iSeeConfirmMessageBoxWithTitle: function (sTitle) {
|
|
720
759
|
return OpaBuilder.create(this)
|
|
@@ -796,19 +835,6 @@ sap.ui.define(
|
|
|
796
835
|
.description("MessageItem is correctly displayed")
|
|
797
836
|
.execute();
|
|
798
837
|
},
|
|
799
|
-
iClickBackOnMessageView: function () {
|
|
800
|
-
return OpaBuilder.create(this)
|
|
801
|
-
.hasType("sap.m.MessageView")
|
|
802
|
-
.isDialogElement(true)
|
|
803
|
-
.doOnChildren(
|
|
804
|
-
OpaBuilder.create(this)
|
|
805
|
-
.hasType("sap.m.Button")
|
|
806
|
-
.hasProperties({ icon: "sap-icon://nav-back" })
|
|
807
|
-
.doPress()
|
|
808
|
-
.description("Click on the message view back")
|
|
809
|
-
)
|
|
810
|
-
.execute();
|
|
811
|
-
},
|
|
812
838
|
iCheckVisibilityOfButtonWithText: function (sText, bExpectedVisibility) {
|
|
813
839
|
return OpaBuilder.create(this)
|
|
814
840
|
.hasType("sap.m.Button")
|