@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.
Files changed (66) hide show
  1. package/package.json +1 -1
  2. package/src/sap/fe/test/.library +1 -1
  3. package/src/sap/fe/test/BaseActions.js +86 -97
  4. package/src/sap/fe/test/BaseArrangements.js +4 -15
  5. package/src/sap/fe/test/BaseAssertions.js +39 -46
  6. package/src/sap/fe/test/CollaborationClient.js +77 -0
  7. package/src/sap/fe/test/CollaborationClient.ts +105 -0
  8. package/src/sap/fe/test/FeMocks.js +1 -1
  9. package/src/sap/fe/test/FeMocks.ts +10 -5
  10. package/src/sap/fe/test/Flexibility.js +115 -162
  11. package/src/sap/fe/test/JestTemplatingHelper.js +54 -24
  12. package/src/sap/fe/test/JestTemplatingHelper.ts +59 -30
  13. package/src/sap/fe/test/JourneyRunner.js +31 -37
  14. package/src/sap/fe/test/ListReport.js +10 -22
  15. package/src/sap/fe/test/LocationUtil.js +12 -16
  16. package/src/sap/fe/test/ObjectPage.js +64 -38
  17. package/src/sap/fe/test/Shell.js +94 -40
  18. package/src/sap/fe/test/TemplatePage.js +14 -2
  19. package/src/sap/fe/test/TemplatingTestUtils.js +20 -20
  20. package/src/sap/fe/test/UI5MockHelper.js +101 -21
  21. package/src/sap/fe/test/UI5MockHelper.ts +92 -26
  22. package/src/sap/fe/test/Utils.js +19 -20
  23. package/src/sap/fe/test/api/BaseAPI.js +11 -26
  24. package/src/sap/fe/test/api/ChartActions.js +116 -119
  25. package/src/sap/fe/test/api/ChartAssertions.js +18 -22
  26. package/src/sap/fe/test/api/CollaborationAPI.js +215 -0
  27. package/src/sap/fe/test/api/CollaborationAPI.ts +238 -0
  28. package/src/sap/fe/test/api/DialogAPI.js +11 -13
  29. package/src/sap/fe/test/api/DialogActions.js +8 -8
  30. package/src/sap/fe/test/api/DialogAssertions.js +8 -9
  31. package/src/sap/fe/test/api/DialogHelper.js +63 -0
  32. package/src/sap/fe/test/api/DialogMassEditActions.js +115 -0
  33. package/src/sap/fe/test/api/DialogMassEditAssertions.js +174 -0
  34. package/src/sap/fe/test/api/DialogMessageActions.js +2 -1
  35. package/src/sap/fe/test/api/DialogType.js +11 -2
  36. package/src/sap/fe/test/api/DialogValueHelpActions.js +17 -39
  37. package/src/sap/fe/test/api/DialogValueHelpAssertions.js +11 -19
  38. package/src/sap/fe/test/api/FilterBarAPI.js +11 -12
  39. package/src/sap/fe/test/api/FilterBarActions.js +26 -40
  40. package/src/sap/fe/test/api/FilterBarAssertions.js +28 -47
  41. package/src/sap/fe/test/api/FooterActionsBase.js +3 -4
  42. package/src/sap/fe/test/api/FooterActionsOP.js +6 -10
  43. package/src/sap/fe/test/api/FooterAssertionsBase.js +5 -10
  44. package/src/sap/fe/test/api/FooterAssertionsOP.js +8 -13
  45. package/src/sap/fe/test/api/FormAPI.js +5 -6
  46. package/src/sap/fe/test/api/FormActions.js +11 -21
  47. package/src/sap/fe/test/api/FormAssertions.js +14 -20
  48. package/src/sap/fe/test/api/HeaderAPI.js +12 -27
  49. package/src/sap/fe/test/api/HeaderActions.js +10 -12
  50. package/src/sap/fe/test/api/HeaderActionsLR.js +76 -82
  51. package/src/sap/fe/test/api/HeaderAssertions.js +76 -59
  52. package/src/sap/fe/test/api/HeaderAssertionsLR.js +5 -8
  53. package/src/sap/fe/test/api/HeaderLR.js +7 -19
  54. package/src/sap/fe/test/api/KPICardAssertions.js +18 -37
  55. package/src/sap/fe/test/api/TableAPI.js +33 -47
  56. package/src/sap/fe/test/api/TableActions.js +3 -35
  57. package/src/sap/fe/test/api/TableAssertions.js +51 -69
  58. package/src/sap/fe/test/builder/FEBuilder.js +71 -75
  59. package/src/sap/fe/test/builder/MacroFieldBuilder.js +162 -156
  60. package/src/sap/fe/test/builder/MdcFieldBuilder.js +33 -29
  61. package/src/sap/fe/test/builder/MdcFilterFieldBuilder.js +9 -7
  62. package/src/sap/fe/test/builder/MdcTableBuilder.js +97 -16
  63. package/src/sap/fe/test/builder/VMBuilder.js +27 -43
  64. package/src/sap/fe/test/library.js +3 -2
  65. package/src/sap/fe/test/library.ts +1 -0
  66. package/src/sap/fe/test/massEdit.js +0 -62
@@ -12,7 +12,7 @@ sap.ui.define(
12
12
  "sap/fe/test/builder/MacroFieldBuilder",
13
13
  "./APIHelper"
14
14
  ],
15
- function(HeaderAPI, Utils, OpaBuilder, FEBuilder, FieldBuilder, APIHelper) {
15
+ function (HeaderAPI, Utils, OpaBuilder, FEBuilder, FieldBuilder, APIHelper) {
16
16
  "use strict";
17
17
 
18
18
  /**
@@ -26,7 +26,7 @@ sap.ui.define(
26
26
  * @hideconstructor
27
27
  * @public
28
28
  */
29
- var HeaderAssertions = function(oHeaderBuilder, vHeaderDescription) {
29
+ var HeaderAssertions = function (oHeaderBuilder, vHeaderDescription) {
30
30
  this._sObjectPageLayoutId = vHeaderDescription.id;
31
31
  this._sHeaderId = vHeaderDescription.headerId;
32
32
  this._sHeaderContentId = vHeaderDescription.headerContentId;
@@ -45,10 +45,9 @@ sap.ui.define(
45
45
  * @param {string | sap.fe.test.api.ActionIdentifier} vActionIdentifier The identifier of the action
46
46
  * @param {object} [mState] Defines the expected state of the button
47
47
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
48
- *
49
48
  * @public
50
49
  */
51
- HeaderAssertions.prototype.iCheckAction = function(vActionIdentifier, mState) {
50
+ HeaderAssertions.prototype.iCheckAction = function (vActionIdentifier, mState) {
52
51
  var oOverflowToolbarBuilder = this.createOverflowToolbarBuilder(this._sObjectPageLayoutId);
53
52
  return this.prepareResult(
54
53
  oOverflowToolbarBuilder
@@ -63,10 +62,9 @@ sap.ui.define(
63
62
  *
64
63
  * @param {object} [mState] Defines the expected state of the button
65
64
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
66
- *
67
65
  * @public
68
66
  */
69
- HeaderAssertions.prototype.iCheckEdit = function(mState) {
67
+ HeaderAssertions.prototype.iCheckEdit = function (mState) {
70
68
  return this.iCheckAction({ service: "StandardAction", action: "Edit", unbound: true }, mState);
71
69
  };
72
70
 
@@ -75,10 +73,9 @@ sap.ui.define(
75
73
  *
76
74
  * @param {object} [mState] Defines the expected state of the button
77
75
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
78
- *
79
76
  * @public
80
77
  */
81
- HeaderAssertions.prototype.iCheckDelete = function(mState) {
78
+ HeaderAssertions.prototype.iCheckDelete = function (mState) {
82
79
  return this.iCheckAction({ service: "StandardAction", action: "Delete", unbound: true }, mState);
83
80
  };
84
81
 
@@ -87,10 +84,9 @@ sap.ui.define(
87
84
  *
88
85
  * @param {object} [mState] Defines the expected state of the button
89
86
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
90
- *
91
87
  * @public
92
88
  */
93
- HeaderAssertions.prototype.iCheckRelatedApps = function(mState) {
89
+ HeaderAssertions.prototype.iCheckRelatedApps = function (mState) {
94
90
  return this.iCheckAction({ service: "fe", action: "RelatedApps", unbound: true }, mState);
95
91
  };
96
92
 
@@ -99,10 +95,9 @@ sap.ui.define(
99
95
  *
100
96
  * @param {object | string} vAction The state map or label of the action
101
97
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
102
- *
103
98
  * @public
104
99
  */
105
- HeaderAssertions.prototype.iCheckMenuAction = function(vAction) {
100
+ HeaderAssertions.prototype.iCheckMenuAction = function (vAction) {
106
101
  return this.prepareResult(APIHelper.createMenuActionCheckBuilder(vAction).execute());
107
102
  };
108
103
 
@@ -112,18 +107,17 @@ sap.ui.define(
112
107
  * @param {number} iNumberOfItems The expected number of items
113
108
  * @param {boolean} [bIncludeHidden] Defines whether non-visible items should be counted
114
109
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
115
- *
116
110
  * @ui5-restricted
117
111
  */
118
- HeaderAssertions.prototype.iCheckNumberOfHeaderContentItems = function(iNumberOfItems, bIncludeHidden) {
112
+ HeaderAssertions.prototype.iCheckNumberOfHeaderContentItems = function (iNumberOfItems, bIncludeHidden) {
119
113
  var oHeaderContentBuilder = this.getObjectPageDynamicHeaderContentBuilder(this._sHeaderContentId);
120
114
 
121
115
  return this.prepareResult(
122
116
  oHeaderContentBuilder
123
- .has(function(oOPHeaderContent) {
117
+ .has(function (oOPHeaderContent) {
124
118
  var aItems = oOPHeaderContent.getContent()[0].getItems();
125
119
  if (!bIncludeHidden) {
126
- aItems = aItems.filter(function(oControl) {
120
+ aItems = aItems.filter(function (oControl) {
127
121
  return oControl.getVisible();
128
122
  });
129
123
  }
@@ -148,10 +142,9 @@ sap.ui.define(
148
142
  * </pre></code>
149
143
  * @param {object} [mState] Defines the expected state of the field
150
144
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
151
- *
152
145
  * @public
153
146
  */
154
- HeaderAssertions.prototype.iCheckFieldInFieldGroup = function(vFieldIdentifier, vValue, mState) {
147
+ HeaderAssertions.prototype.iCheckFieldInFieldGroup = function (vFieldIdentifier, vValue, mState) {
155
148
  var aArguments = Utils.parseArguments([Object, [Array, String], Object], arguments),
156
149
  sFieldId =
157
150
  (vFieldIdentifier.targetAnnotation
@@ -181,10 +174,9 @@ sap.ui.define(
181
174
  * @param {string} sTitle The title of the data point
182
175
  * @param {string} sValue The expected value of the data point
183
176
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
184
- *
185
177
  * @ui5-restricted
186
178
  */
187
- HeaderAssertions.prototype.iCheckDataPoint = function(sTitle, sValue) {
179
+ HeaderAssertions.prototype.iCheckDataPoint = function (sTitle, sValue) {
188
180
  var oHeaderContentBuilder = this.getObjectPageDynamicHeaderContentBuilder(this._sHeaderContentId);
189
181
 
190
182
  return this.prepareResult(
@@ -194,7 +186,7 @@ sap.ui.define(
194
186
  OpaBuilder.create(this)
195
187
  .hasType("sap.m.ObjectNumber")
196
188
  .hasProperties({ number: sValue })
197
- .has(function(oObjectNumber) {
189
+ .has(function (oObjectNumber) {
198
190
  return oObjectNumber.getParent();
199
191
  })
200
192
  .hasAggregationProperties("items", { text: sTitle })
@@ -213,27 +205,20 @@ sap.ui.define(
213
205
  * @param {string} [sTitle] Title of the object page header
214
206
  * @param {string} [sDescription] Description of the object page header
215
207
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
216
- *
217
208
  * @public
218
209
  */
219
- HeaderAssertions.prototype.iCheckTitle = function(sTitle, sDescription) {
210
+ HeaderAssertions.prototype.iCheckTitle = function (sTitle, sDescription) {
220
211
  var oHeaderTitleBuilder = this.getObjectPageDynamicHeaderTitleBuilder(this._sObjectPageLayoutId);
221
212
  return this.prepareResult(
222
213
  oHeaderTitleBuilder
223
214
  .hasConditional(
224
215
  sTitle !== undefined,
225
- OpaBuilder.Matchers.childrenMatcher(
226
- OpaBuilder.create(this)
227
- .hasType("sap.m.Title")
228
- .hasProperties({ text: sTitle })
229
- )
216
+ OpaBuilder.Matchers.childrenMatcher(OpaBuilder.create(this).hasType("sap.m.Title").hasProperties({ text: sTitle }))
230
217
  )
231
218
  .hasConditional(
232
219
  sDescription !== undefined,
233
220
  OpaBuilder.Matchers.childrenMatcher(
234
- OpaBuilder.create(this)
235
- .hasType("sap.m.Label")
236
- .hasProperties({ text: sDescription })
221
+ OpaBuilder.create(this).hasType("sap.m.Label").hasProperties({ text: sDescription })
237
222
  )
238
223
  )
239
224
  .description(
@@ -250,10 +235,9 @@ sap.ui.define(
250
235
  *
251
236
  * @param {object} mState Defines the expected state of the button
252
237
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
253
- *
254
238
  * @public
255
239
  */
256
- HeaderAssertions.prototype.iCheckPaginatorDown = function(mState) {
240
+ HeaderAssertions.prototype.iCheckPaginatorDown = function (mState) {
257
241
  return this.prepareResult(
258
242
  this.createPaginatorBuilder(
259
243
  OpaBuilder.Matchers.properties({ icon: "sap-icon://navigation-down-arrow" }),
@@ -270,10 +254,9 @@ sap.ui.define(
270
254
  *
271
255
  * @param {object} mState Defines the expected state of the button
272
256
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
273
- *
274
257
  * @public
275
258
  */
276
- HeaderAssertions.prototype.iCheckPaginatorUp = function(mState) {
259
+ HeaderAssertions.prototype.iCheckPaginatorUp = function (mState) {
277
260
  return this.prepareResult(
278
261
  this.createPaginatorBuilder(
279
262
  OpaBuilder.Matchers.properties({ icon: "sap-icon://navigation-up-arrow" }),
@@ -289,12 +272,13 @@ sap.ui.define(
289
272
  * Checks a MicroChart shown in the header of an object page.
290
273
  *
291
274
  * TODO this function will not be public yet: Its signature doesn't fit the framework.
275
+ *
292
276
  * @param {object|string} vMicroChartIdentifier Id/Type or Title of MicroChart
293
- * @param sUoMLabel UoM label of the MicroChart
277
+ * @param {string} sUoMLabel UoM label of the MicroChart
294
278
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
295
279
  * @ui5-restricted
296
280
  */
297
- HeaderAssertions.prototype.iCheckMicroChart = function(vMicroChartIdentifier, sUoMLabel) {
281
+ HeaderAssertions.prototype.iCheckMicroChart = function (vMicroChartIdentifier, sUoMLabel) {
298
282
  var oOpaBuilder = OpaBuilder.create(this.getOpaInstance());
299
283
 
300
284
  if (!Utils.isOfType(vMicroChartIdentifier, String)) {
@@ -346,10 +330,9 @@ sap.ui.define(
346
330
  * @param {sap.fe.test.api.HeaderFacetIdentifier} vFacetIdentifier The Identifier of the header facet
347
331
  * @param {object} [mState] Defines the expected state
348
332
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
349
- *
350
333
  * @public
351
334
  */
352
- HeaderAssertions.prototype.iCheckHeaderFacet = function(vFacetIdentifier, mState) {
335
+ HeaderAssertions.prototype.iCheckHeaderFacet = function (vFacetIdentifier, mState) {
353
336
  var aArguments = Utils.parseArguments([[Object, String], Object], arguments),
354
337
  oHeaderContentBuilder = this.getObjectPageDynamicHeaderContentBuilder(this._sHeaderContentId),
355
338
  sId = new RegExp("fe::HeaderFacetContainer::" + vFacetIdentifier.facetId + "$");
@@ -362,13 +345,7 @@ sap.ui.define(
362
345
 
363
346
  return this.prepareResult(
364
347
  oHeaderContentBuilder
365
- .has(
366
- OpaBuilder.Matchers.childrenMatcher(
367
- FEBuilder.create(this.getOpaInstance())
368
- .hasId(sId)
369
- .hasState(mState)
370
- )
371
- )
348
+ .has(OpaBuilder.Matchers.childrenMatcher(FEBuilder.create(this.getOpaInstance()).hasId(sId).hasState(mState)))
372
349
  .description(Utils.formatMessage("Checking Header Facet '{0}' with state='{1}'", aArguments[0], aArguments[1]))
373
350
  .execute()
374
351
  );
@@ -385,12 +362,10 @@ sap.ui.define(
385
362
  * This is the case for the main object page, which does not show breadcrumb links.
386
363
  * If <code>sLink</code> is not provided, a check is executed to ensure the breadcrumb control does not exist at all. This is the case for the flexible column layout
387
364
  * showing multiple floorplans at the same time.
388
- *
389
365
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
390
- *
391
366
  * @ui5-restricted
392
367
  */
393
- HeaderAssertions.prototype.iCheckBreadCrumb = function(sLink) {
368
+ HeaderAssertions.prototype.iCheckBreadCrumb = function (sLink) {
394
369
  var oFEBuilder = FEBuilder.create(this.getOpaInstance()).hasId(this._sBreadCrumbId);
395
370
 
396
371
  if (sLink !== undefined && sLink.length > 0) {
@@ -413,10 +388,9 @@ sap.ui.define(
413
388
  *
414
389
  * @param {object} [mState] Defines the expected state of the button
415
390
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
416
- *
417
391
  * @public
418
392
  */
419
- HeaderAssertions.prototype.iCheckSaveAsTile = function(mState) {
393
+ HeaderAssertions.prototype.iCheckSaveAsTile = function (mState) {
420
394
  var oOverflowToolbarBuilder = this.createOverflowToolbarBuilder(this._sObjectPageLayoutId),
421
395
  sShareId = "fe::Share";
422
396
 
@@ -439,10 +413,9 @@ sap.ui.define(
439
413
  *
440
414
  * @param {object} [mState] Defines the expected state of the button
441
415
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
442
- *
443
416
  * @public
444
417
  */
445
- HeaderAssertions.prototype.iCheckSendEmail = function(mState) {
418
+ HeaderAssertions.prototype.iCheckSendEmail = function (mState) {
446
419
  var oOverflowToolbarBuilder = this.createOverflowToolbarBuilder(this._sObjectPageLayoutId),
447
420
  sShareId = "fe::Share";
448
421
 
@@ -468,10 +441,9 @@ sap.ui.define(
468
441
  * @param {object | string} vLinkIdentifier The identifier of the field
469
442
  * @param {object} [mState] Defines the expected state of the link
470
443
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
471
- *
472
444
  * @private
473
445
  */
474
- HeaderAssertions.prototype.iCheckLink = function(vLinkIdentifier, mState) {
446
+ HeaderAssertions.prototype.iCheckLink = function (vLinkIdentifier, mState) {
475
447
  // TODO this function needs to aligned with onForm().iCheckLink - for now vLinkIdentifier must be the link text!
476
448
  var aArguments = Utils.parseArguments([String, Object], arguments),
477
449
  oHeaderContentBuilder = this.getObjectPageDynamicHeaderContentBuilder(this._sHeaderContentId);
@@ -479,10 +451,7 @@ sap.ui.define(
479
451
  oHeaderContentBuilder
480
452
  .has(
481
453
  OpaBuilder.Matchers.childrenMatcher(
482
- FEBuilder.create()
483
- .hasType("sap.m.Link")
484
- .hasProperties({ text: vLinkIdentifier })
485
- .hasState(aArguments[1])
454
+ FEBuilder.create().hasType("sap.m.Link").hasProperties({ text: vLinkIdentifier }).hasState(aArguments[1])
486
455
  )
487
456
  )
488
457
  .description(Utils.formatMessage("Checking link '{0}' with state='{1}'", aArguments[0], aArguments[1]))
@@ -490,6 +459,54 @@ sap.ui.define(
490
459
  );
491
460
  };
492
461
 
462
+ /**
463
+ * Checks the number of users collaborating in the draft.
464
+ *
465
+ * @param {number} iExpectedNumber The expected number of users
466
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
467
+ * @ui5-restricted
468
+ */
469
+ HeaderAssertions.prototype.iCheckNumberOfCollaboratingUsers = function (iExpectedNumber) {
470
+ var objectPageBuilder = FEBuilder.create(this.getOpaInstance()).hasId(this._sObjectPageLayoutId);
471
+
472
+ return this.prepareResult(
473
+ objectPageBuilder
474
+ .hasChildren(
475
+ FEBuilder.create(this)
476
+ .hasType("sap.uxap.ObjectPageDynamicHeaderTitle")
477
+ .hasChildren(
478
+ FEBuilder.create(this)
479
+ .hasType("sap.m.Avatar")
480
+ .checkNumberOfMatches(iExpectedNumber + 1) // +1 because of avatar to add a user
481
+ )
482
+ )
483
+ .description(Utils.formatMessage("Checking number of collaborating user: {0}", iExpectedNumber))
484
+ .execute()
485
+ );
486
+ };
487
+
488
+ /**
489
+ * Checks if a collaborating user is present.
490
+ *
491
+ * @param {string} sInitials The initials of the user (displayed in the avatar)
492
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
493
+ * @ui5-restricted
494
+ */
495
+ HeaderAssertions.prototype.iCheckCollaboratingUser = function (sInitials) {
496
+ var objectPageBuilder = FEBuilder.create(this.getOpaInstance()).hasId(this._sObjectPageLayoutId);
497
+
498
+ return this.prepareResult(
499
+ objectPageBuilder
500
+ .hasChildren(
501
+ FEBuilder.create(this)
502
+ .hasType("sap.uxap.ObjectPageDynamicHeaderTitle")
503
+ .hasChildren(FEBuilder.create(this).hasType("sap.m.Avatar").hasProperties({ initials: sInitials }))
504
+ )
505
+ .description(Utils.formatMessage("Checking collaborating user with initials '{0}'", sInitials))
506
+ .execute()
507
+ );
508
+ };
509
+
493
510
  return HeaderAssertions;
494
511
  }
495
512
  );
@@ -12,7 +12,7 @@ sap.ui.define(
12
12
  "sap/fe/test/builder/MdcFieldBuilder",
13
13
  "./APIHelper"
14
14
  ],
15
- function(HeaderLR, Utils, OpaBuilder, FEBuilder, FieldBuilder, APIHelper) {
15
+ function (HeaderLR, Utils, OpaBuilder, FEBuilder, FieldBuilder, APIHelper) {
16
16
  "use strict";
17
17
 
18
18
  /**
@@ -26,7 +26,7 @@ sap.ui.define(
26
26
  * @hideconstructor
27
27
  * @public
28
28
  */
29
- var HeaderAssertionsLR = function(oHeaderBuilder, vHeaderDescription) {
29
+ var HeaderAssertionsLR = function (oHeaderBuilder, vHeaderDescription) {
30
30
  return HeaderLR.call(this, oHeaderBuilder, vHeaderDescription);
31
31
  };
32
32
  HeaderAssertionsLR.prototype = Object.create(HeaderLR.prototype);
@@ -39,10 +39,9 @@ sap.ui.define(
39
39
  * @param {string | sap.fe.test.api.ActionIdentifier} [vActionIdentifier] The identifier of the action, or its label
40
40
  * @param {object} [mState] Defines the expected state of the button
41
41
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
42
- *
43
42
  * @public
44
43
  */
45
- HeaderAssertionsLR.prototype.iCheckAction = function(vActionIdentifier, mState) {
44
+ HeaderAssertionsLR.prototype.iCheckAction = function (vActionIdentifier, mState) {
46
45
  var aArguments = Utils.parseArguments([[Object, String], Object], arguments),
47
46
  oOverflowToolbarBuilder = this.createOverflowToolbarBuilder(this._sPageId);
48
47
  return this.prepareResult(
@@ -58,10 +57,9 @@ sap.ui.define(
58
57
  *
59
58
  * @param {object} [mState] Defines the expected state of the button
60
59
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
61
- *
62
60
  * @public
63
61
  */
64
- HeaderAssertionsLR.prototype.iCheckSaveAsTile = function(mState) {
62
+ HeaderAssertionsLR.prototype.iCheckSaveAsTile = function (mState) {
65
63
  var oOverflowToolbarBuilder = this.createOverflowToolbarBuilder(this._sPageId),
66
64
  sShareId = "fe::Share";
67
65
 
@@ -84,10 +82,9 @@ sap.ui.define(
84
82
  *
85
83
  * @param {object} [mState] Defines the expected state of the button
86
84
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
87
- *
88
85
  * @public
89
86
  */
90
- HeaderAssertionsLR.prototype.iCheckSendEmail = function(mState) {
87
+ HeaderAssertionsLR.prototype.iCheckSendEmail = function (mState) {
91
88
  var oOverflowToolbarBuilder = this.createOverflowToolbarBuilder(this._sPageId),
92
89
  sShareId = "fe::Share";
93
90
 
@@ -12,7 +12,7 @@ sap.ui.define(
12
12
  "sap/fe/test/builder/OverflowToolbarBuilder",
13
13
  "sap/fe/core/helpers/StableIdHelper"
14
14
  ],
15
- function(BaseAPI, Utils, OpaBuilder, FEBuilder, OverflowToolbarBuilder, StableIdHelper) {
15
+ function (BaseAPI, Utils, OpaBuilder, FEBuilder, OverflowToolbarBuilder, StableIdHelper) {
16
16
  "use strict";
17
17
 
18
18
  /**
@@ -26,7 +26,7 @@ sap.ui.define(
26
26
  * @hideconstructor
27
27
  * @private
28
28
  */
29
- var HeaderLR = function(oHeaderBuilder, vHeaderDescription) {
29
+ var HeaderLR = function (oHeaderBuilder, vHeaderDescription) {
30
30
  if (!Utils.isOfType(oHeaderBuilder, FEBuilder)) {
31
31
  throw new Error("oHeaderBuilder parameter must be a FEBuilder instance");
32
32
  }
@@ -43,28 +43,16 @@ sap.ui.define(
43
43
  *
44
44
  * @param {string} sPageId The id of page control.
45
45
  * @returns {object} OverflowToolbarBuilder object
46
- *
47
46
  * @ui5-restricted
48
47
  */
49
- HeaderLR.prototype.createOverflowToolbarBuilder = function(sPageId) {
48
+ HeaderLR.prototype.createOverflowToolbarBuilder = function (sPageId) {
50
49
  return OverflowToolbarBuilder.create(this.getOpaInstance())
51
50
  .hasType("sap.m.OverflowToolbar")
52
- .has(function(oOverflowToolbar) {
51
+ .has(function (oOverflowToolbar) {
53
52
  return (
54
- oOverflowToolbar
55
- .getParent()
56
- .getMetadata()
57
- .getName() === "sap.f.DynamicPageTitle" &&
58
- oOverflowToolbar
59
- .getParent()
60
- .getParent()
61
- .getMetadata()
62
- .getName() === "sap.f.DynamicPage" &&
63
- oOverflowToolbar
64
- .getParent()
65
- .getParent()
66
- .getId()
67
- .endsWith(sPageId)
53
+ oOverflowToolbar.getParent().getMetadata().getName() === "sap.f.DynamicPageTitle" &&
54
+ oOverflowToolbar.getParent().getParent().getMetadata().getName() === "sap.f.DynamicPage" &&
55
+ oOverflowToolbar.getParent().getParent().getId().endsWith(sPageId)
68
56
  );
69
57
  });
70
58
  };
@@ -3,7 +3,7 @@
3
3
  (c) Copyright 2009-2021 SAP SE. All rights reserved
4
4
 
5
5
  */
6
- sap.ui.define(["./KPICardAPI", "sap/fe/test/Utils", "sap/fe/test/builder/FEBuilder"], function(KPICardAPI, Utils, FEBuilder) {
6
+ sap.ui.define(["./KPICardAPI", "sap/fe/test/Utils", "sap/fe/test/builder/FEBuilder"], function (KPICardAPI, Utils, FEBuilder) {
7
7
  "use strict";
8
8
 
9
9
  /**
@@ -16,7 +16,7 @@ sap.ui.define(["./KPICardAPI", "sap/fe/test/Utils", "sap/fe/test/builder/FEBuild
16
16
  * @hideconstructor
17
17
  * @public
18
18
  */
19
- var KPICardAssertions = function(oBuilderInstance) {
19
+ var KPICardAssertions = function (oBuilderInstance) {
20
20
  return KPICardAPI.call(this, oBuilderInstance);
21
21
  };
22
22
  KPICardAssertions.prototype = Object.create(KPICardAPI.prototype);
@@ -29,11 +29,11 @@ sap.ui.define(["./KPICardAPI", "sap/fe/test/Utils", "sap/fe/test/builder/FEBuild
29
29
  * @param {string} sTitle The expected title
30
30
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
31
31
  */
32
- KPICardAssertions.prototype.iSeeHeaderTitle = function(sTitle) {
32
+ KPICardAssertions.prototype.iSeeHeaderTitle = function (sTitle) {
33
33
  var oKPIBuilder = this.getBuilder();
34
34
  var vTitleMatcher = FEBuilder.create(this)
35
35
  .hasType("sap.m.Text")
36
- .has(function(oControl) {
36
+ .has(function (oControl) {
37
37
  return oControl.getId().endsWith("-title");
38
38
  })
39
39
  .hasProperties({ text: sTitle });
@@ -52,11 +52,11 @@ sap.ui.define(["./KPICardAPI", "sap/fe/test/Utils", "sap/fe/test/builder/FEBuild
52
52
  * @param {string} sSubtitle The expected title
53
53
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
54
54
  */
55
- KPICardAssertions.prototype.iSeeHeaderSubtitle = function(sSubtitle) {
55
+ KPICardAssertions.prototype.iSeeHeaderSubtitle = function (sSubtitle) {
56
56
  var oKPIBuilder = this.getBuilder();
57
57
  var vTitleMatcher = FEBuilder.create(this)
58
58
  .hasType("sap.m.Text")
59
- .has(function(oControl) {
59
+ .has(function (oControl) {
60
60
  return oControl.getId().endsWith("-subtitle");
61
61
  })
62
62
  .hasProperties({ text: sSubtitle });
@@ -75,11 +75,11 @@ sap.ui.define(["./KPICardAPI", "sap/fe/test/Utils", "sap/fe/test/builder/FEBuild
75
75
  * @param {string} sText The expected unit
76
76
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
77
77
  */
78
- KPICardAssertions.prototype.iSeeHeaderUnit = function(sText) {
78
+ KPICardAssertions.prototype.iSeeHeaderUnit = function (sText) {
79
79
  var oKPIBuilder = this.getBuilder();
80
80
  var vTitleMatcher = FEBuilder.create(this)
81
81
  .hasType("sap.m.Text")
82
- .has(function(oControl) {
82
+ .has(function (oControl) {
83
83
  return oControl.getId().endsWith("-unitOfMeasurement");
84
84
  })
85
85
  .hasProperties({ text: sText });
@@ -98,11 +98,11 @@ sap.ui.define(["./KPICardAPI", "sap/fe/test/Utils", "sap/fe/test/builder/FEBuild
98
98
  * @param {string} sText The expected detail value
99
99
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
100
100
  */
101
- KPICardAssertions.prototype.iSeeHeaderDetails = function(sText) {
101
+ KPICardAssertions.prototype.iSeeHeaderDetails = function (sText) {
102
102
  var oKPIBuilder = this.getBuilder();
103
103
  var vTitleMatcher = FEBuilder.create(this)
104
104
  .hasType("sap.m.Text")
105
- .has(function(oControl) {
105
+ .has(function (oControl) {
106
106
  return oControl.getId().endsWith("-details");
107
107
  })
108
108
  .hasProperties({ text: sText });
@@ -122,14 +122,12 @@ sap.ui.define(["./KPICardAPI", "sap/fe/test/Utils", "sap/fe/test/builder/FEBuild
122
122
  * @param {object} mStates Additionnal properties to check (indicator, valueColor, scale)
123
123
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
124
124
  */
125
- KPICardAssertions.prototype.iSeeHeaderValue = function(sValue, mStates) {
125
+ KPICardAssertions.prototype.iSeeHeaderValue = function (sValue, mStates) {
126
126
  var oKPIBuilder = this.getBuilder();
127
127
  var oProperties = mStates || {};
128
128
  oProperties.number = sValue;
129
129
 
130
- var vTitleMatcher = FEBuilder.create(this)
131
- .hasType("sap.f.cards.NumericIndicators")
132
- .hasProperties(oProperties);
130
+ var vTitleMatcher = FEBuilder.create(this).hasType("sap.f.cards.NumericIndicators").hasProperties(oProperties);
133
131
 
134
132
  var sDescription = mStates
135
133
  ? Utils.formatMessage("Checking card header value '{0}' in state '{1}'", sValue, mStates)
@@ -150,7 +148,7 @@ sap.ui.define(["./KPICardAPI", "sap/fe/test/Utils", "sap/fe/test/builder/FEBuild
150
148
  * @param {string} sUnit The expected unit of the side indicator
151
149
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
152
150
  */
153
- KPICardAssertions.prototype.iSeeSideIndicator = function(sTitle, sValue, sUnit) {
151
+ KPICardAssertions.prototype.iSeeSideIndicator = function (sTitle, sValue, sUnit) {
154
152
  var oKPIBuilder = this.getBuilder();
155
153
 
156
154
  var vIndicatorMatcher = FEBuilder.create(this)
@@ -158,21 +156,9 @@ sap.ui.define(["./KPICardAPI", "sap/fe/test/Utils", "sap/fe/test/builder/FEBuild
158
156
  .hasChildren(
159
157
  FEBuilder.create(this)
160
158
  .hasType("sap.f.cards.NumericSideIndicator")
161
- .hasChildren(
162
- FEBuilder.create(this)
163
- .hasType("sap.m.Text")
164
- .hasProperties({ text: sTitle })
165
- )
166
- .hasChildren(
167
- FEBuilder.create(this)
168
- .hasType("sap.m.Text")
169
- .hasProperties({ text: sTitle })
170
- )
171
- .hasChildren(
172
- FEBuilder.create(this)
173
- .hasType("sap.m.Text")
174
- .hasProperties({ text: sValue })
175
- )
159
+ .hasChildren(FEBuilder.create(this).hasType("sap.m.Text").hasProperties({ text: sTitle }))
160
+ .hasChildren(FEBuilder.create(this).hasType("sap.m.Text").hasProperties({ text: sTitle }))
161
+ .hasChildren(FEBuilder.create(this).hasType("sap.m.Text").hasProperties({ text: sValue }))
176
162
  );
177
163
 
178
164
  return this.prepareResult(
@@ -189,7 +175,7 @@ sap.ui.define(["./KPICardAPI", "sap/fe/test/Utils", "sap/fe/test/builder/FEBuild
189
175
  * @param {object} mProperties The properties to be checked on the chart (vizType). If null or empty, we just check if the chart is visible.
190
176
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
191
177
  */
192
- KPICardAssertions.prototype.iSeeChart = function(mProperties) {
178
+ KPICardAssertions.prototype.iSeeChart = function (mProperties) {
193
179
  var oKPIBuilder = this.getBuilder();
194
180
 
195
181
  var vChartMatcher = mProperties && Object.keys(mProperties).length ? FEBuilder.create(this).hasProperties(mProperties) : undefined;
@@ -198,12 +184,7 @@ sap.ui.define(["./KPICardAPI", "sap/fe/test/Utils", "sap/fe/test/builder/FEBuild
198
184
  ? Utils.formatMessage("Checking card chart with properties '{0}'", mProperties)
199
185
  : Utils.formatMessage("Checking card chart");
200
186
 
201
- return this.prepareResult(
202
- oKPIBuilder
203
- .doOnKPICardChart(vChartMatcher)
204
- .description(sDescription)
205
- .execute()
206
- );
187
+ return this.prepareResult(oKPIBuilder.doOnKPICardChart(vChartMatcher).description(sDescription).execute());
207
188
  };
208
189
  return KPICardAssertions;
209
190
  });