@sapui5/sap.fe.test 1.102.2 → 1.104.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.
Files changed (65) hide show
  1. package/package.json +3 -4
  2. package/src/sap/fe/test/.library +1 -1
  3. package/src/sap/fe/test/BaseActions.js +103 -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 +5 -5
  7. package/src/sap/fe/test/CollaborationClient.ts +5 -5
  8. package/src/sap/fe/test/FeMocks.js +1 -1
  9. package/src/sap/fe/test/FeMocks.ts +4 -3
  10. package/src/sap/fe/test/Flexibility.js +115 -162
  11. package/src/sap/fe/test/JestTemplatingHelper.js +99 -7
  12. package/src/sap/fe/test/JestTemplatingHelper.ts +91 -14
  13. package/src/sap/fe/test/JourneyRunner.js +31 -37
  14. package/src/sap/fe/test/ListReport.js +9 -13
  15. package/src/sap/fe/test/ObjectPage.js +35 -33
  16. package/src/sap/fe/test/Shell.js +0 -6
  17. package/src/sap/fe/test/TemplatePage.js +0 -2
  18. package/src/sap/fe/test/TemplatingTestUtils.js +20 -20
  19. package/src/sap/fe/test/UI5MockHelper.js +16 -10
  20. package/src/sap/fe/test/UI5MockHelper.ts +28 -18
  21. package/src/sap/fe/test/Utils.js +19 -20
  22. package/src/sap/fe/test/api/BaseAPI.js +11 -26
  23. package/src/sap/fe/test/api/ChartActions.js +116 -119
  24. package/src/sap/fe/test/api/ChartAssertions.js +18 -22
  25. package/src/sap/fe/test/api/CollaborationAPI.js +6 -6
  26. package/src/sap/fe/test/api/CollaborationAPI.ts +9 -11
  27. package/src/sap/fe/test/api/DialogAPI.js +11 -13
  28. package/src/sap/fe/test/api/DialogActions.js +8 -8
  29. package/src/sap/fe/test/api/DialogAssertions.js +9 -10
  30. package/src/sap/fe/test/api/DialogHelper.js +63 -0
  31. package/src/sap/fe/test/api/DialogMessageActions.js +2 -1
  32. package/src/sap/fe/test/api/DialogValueHelpActions.js +17 -39
  33. package/src/sap/fe/test/api/DialogValueHelpAssertions.js +47 -19
  34. package/src/sap/fe/test/api/FilterBarAPI.js +11 -12
  35. package/src/sap/fe/test/api/FilterBarActions.js +26 -40
  36. package/src/sap/fe/test/api/FilterBarAssertions.js +28 -47
  37. package/src/sap/fe/test/api/FooterActionsBase.js +3 -4
  38. package/src/sap/fe/test/api/FooterActionsOP.js +6 -10
  39. package/src/sap/fe/test/api/FooterAssertionsBase.js +5 -10
  40. package/src/sap/fe/test/api/FooterAssertionsOP.js +8 -13
  41. package/src/sap/fe/test/api/FormAPI.js +5 -6
  42. package/src/sap/fe/test/api/FormActions.js +11 -21
  43. package/src/sap/fe/test/api/FormAssertions.js +14 -20
  44. package/src/sap/fe/test/api/HeaderAPI.js +12 -27
  45. package/src/sap/fe/test/api/HeaderActions.js +10 -12
  46. package/src/sap/fe/test/api/HeaderActionsLR.js +76 -82
  47. package/src/sap/fe/test/api/HeaderAssertions.js +2 -20
  48. package/src/sap/fe/test/api/HeaderAssertionsLR.js +5 -8
  49. package/src/sap/fe/test/api/HeaderLR.js +7 -19
  50. package/src/sap/fe/test/api/KPICardAssertions.js +18 -37
  51. package/src/sap/fe/test/api/TableAPI.js +3 -13
  52. package/src/sap/fe/test/api/TableActions.js +2 -34
  53. package/src/sap/fe/test/api/TableAssertions.js +1 -24
  54. package/src/sap/fe/test/builder/FEBuilder.js +71 -75
  55. package/src/sap/fe/test/builder/MacroFieldBuilder.js +4 -3
  56. package/src/sap/fe/test/builder/MdcFieldBuilder.js +33 -29
  57. package/src/sap/fe/test/builder/MdcFilterBarBuilder.js +102 -104
  58. package/src/sap/fe/test/builder/MdcFilterFieldBuilder.js +9 -7
  59. package/src/sap/fe/test/builder/MdcTableBuilder.js +8 -4
  60. package/src/sap/fe/test/builder/VMBuilder.js +39 -55
  61. package/src/sap/fe/test/internal/ConsoleErrorChecker.js +241 -0
  62. package/src/sap/fe/test/internal/ConsoleErrorChecker.ts +206 -0
  63. package/src/sap/fe/test/internal/FEArrangements.js +28 -8
  64. package/src/sap/fe/test/library.js +3 -2
  65. package/src/sap/fe/test/library.ts +1 -0
@@ -3,92 +3,86 @@
3
3
  (c) Copyright 2009-2021 SAP SE. All rights reserved
4
4
 
5
5
  */
6
- sap.ui.define(["./HeaderLR", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/builder/FEBuilder", "./APIHelper"], function(
7
- HeaderLR,
8
- Utils,
9
- OpaBuilder,
10
- FEBuilder,
11
- APIHelper
12
- ) {
13
- "use strict";
6
+ sap.ui.define(
7
+ ["./HeaderLR", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/builder/FEBuilder", "./APIHelper"],
8
+ function (HeaderLR, Utils, OpaBuilder, FEBuilder, APIHelper) {
9
+ "use strict";
14
10
 
15
- /**
16
- * Constructs a new HeaderActionsLR instance.
17
- *
18
- * @param {sap.fe.test.builder.FEBuilder} oHeaderBuilder The {@link sap.fe.test.builder.FEBuilder} instance used to interact with the UI
19
- * @param {string} [vHeaderDescription] Description (optional) of the header to be used for logging messages
20
- * @returns {sap.fe.test.api.HeaderActionsLR} The new instance
21
- * @alias sap.fe.test.api.HeaderActionsLR
22
- * @class
23
- * @hideconstructor
24
- * @public
25
- */
26
- var HeaderActionsLR = function(oHeaderBuilder, vHeaderDescription) {
27
- return HeaderLR.call(this, oHeaderBuilder, vHeaderDescription);
28
- };
29
- HeaderActionsLR.prototype = Object.create(HeaderLR.prototype);
30
- HeaderActionsLR.prototype.constructor = HeaderActionsLR;
31
- HeaderActionsLR.prototype.isAction = true;
11
+ /**
12
+ * Constructs a new HeaderActionsLR instance.
13
+ *
14
+ * @param {sap.fe.test.builder.FEBuilder} oHeaderBuilder The {@link sap.fe.test.builder.FEBuilder} instance used to interact with the UI
15
+ * @param {string} [vHeaderDescription] Description (optional) of the header to be used for logging messages
16
+ * @returns {sap.fe.test.api.HeaderActionsLR} The new instance
17
+ * @alias sap.fe.test.api.HeaderActionsLR
18
+ * @class
19
+ * @hideconstructor
20
+ * @public
21
+ */
22
+ var HeaderActionsLR = function (oHeaderBuilder, vHeaderDescription) {
23
+ return HeaderLR.call(this, oHeaderBuilder, vHeaderDescription);
24
+ };
25
+ HeaderActionsLR.prototype = Object.create(HeaderLR.prototype);
26
+ HeaderActionsLR.prototype.constructor = HeaderActionsLR;
27
+ HeaderActionsLR.prototype.isAction = true;
32
28
 
33
- /**
34
- * Executes an action in the header toolbar of a list report.
35
- *
36
- * @param {string | sap.fe.test.api.ActionIdentifier} [vActionIdentifier] The identifier of the action
37
- * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
38
- *
39
- * @public
40
- */
41
- HeaderActionsLR.prototype.iExecuteAction = function(vActionIdentifier) {
42
- var aArguments = Utils.parseArguments([[Object, String]], arguments),
43
- oOverflowToolbarBuilder = this.createOverflowToolbarBuilder(this._sPageId);
44
- return this.prepareResult(
45
- oOverflowToolbarBuilder
46
- .doOnContent(this.createActionMatcher(vActionIdentifier), OpaBuilder.Actions.press())
47
- .description(Utils.formatMessage("Executing custom header action '{0}'", aArguments[0]))
48
- .execute()
49
- );
50
- };
29
+ /**
30
+ * Executes an action in the header toolbar of a list report.
31
+ *
32
+ * @param {string | sap.fe.test.api.ActionIdentifier} [vActionIdentifier] The identifier of the action
33
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
34
+ * @public
35
+ */
36
+ HeaderActionsLR.prototype.iExecuteAction = function (vActionIdentifier) {
37
+ var aArguments = Utils.parseArguments([[Object, String]], arguments),
38
+ oOverflowToolbarBuilder = this.createOverflowToolbarBuilder(this._sPageId);
39
+ return this.prepareResult(
40
+ oOverflowToolbarBuilder
41
+ .doOnContent(this.createActionMatcher(vActionIdentifier), OpaBuilder.Actions.press())
42
+ .description(Utils.formatMessage("Executing custom header action '{0}'", aArguments[0]))
43
+ .execute()
44
+ );
45
+ };
51
46
 
52
- /**
53
- * Executes the <code>Save as Tile</code> action.
54
- *
55
- * @param {string} sBookmarkTitle The title of the new tile
56
- * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
57
- *
58
- * @ui5-restricted
59
- */
60
- HeaderActionsLR.prototype.iExecuteSaveAsTile = function(sBookmarkTitle) {
61
- var sShareId = "fe::Share",
62
- oOverflowToolbarBuilder = this.createOverflowToolbarBuilder(this._sPageId);
47
+ /**
48
+ * Executes the <code>Save as Tile</code> action.
49
+ *
50
+ * @param {string} sBookmarkTitle The title of the new tile
51
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
52
+ * @ui5-restricted
53
+ */
54
+ HeaderActionsLR.prototype.iExecuteSaveAsTile = function (sBookmarkTitle) {
55
+ var sShareId = "fe::Share",
56
+ oOverflowToolbarBuilder = this.createOverflowToolbarBuilder(this._sPageId);
63
57
 
64
- return this.prepareResult(
65
- oOverflowToolbarBuilder
66
- .doOnContent(FEBuilder.Matchers.id(new RegExp(Utils.formatMessage("{0}$", sShareId))), OpaBuilder.Actions.press())
67
- .description(Utils.formatMessage("Pressing header '{0}' Share button", this.getIdentifier()))
68
- .success(APIHelper.createSaveAsTileExecutorBuilder(sBookmarkTitle))
69
- .execute()
70
- );
71
- };
58
+ return this.prepareResult(
59
+ oOverflowToolbarBuilder
60
+ .doOnContent(FEBuilder.Matchers.id(new RegExp(Utils.formatMessage("{0}$", sShareId))), OpaBuilder.Actions.press())
61
+ .description(Utils.formatMessage("Pressing header '{0}' Share button", this.getIdentifier()))
62
+ .success(APIHelper.createSaveAsTileExecutorBuilder(sBookmarkTitle))
63
+ .execute()
64
+ );
65
+ };
72
66
 
73
- /**
74
- * Executes the <code>Send E-Mail</code> action.
75
- *
76
- * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
77
- *
78
- * @ui5-restricted
79
- */
80
- HeaderActionsLR.prototype.iExecuteSendEmail = function() {
81
- var sShareId = "fe::Share",
82
- oOverflowToolbarBuilder = this.createOverflowToolbarBuilder(this._sPageId);
67
+ /**
68
+ * Executes the <code>Send E-Mail</code> action.
69
+ *
70
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
71
+ * @ui5-restricted
72
+ */
73
+ HeaderActionsLR.prototype.iExecuteSendEmail = function () {
74
+ var sShareId = "fe::Share",
75
+ oOverflowToolbarBuilder = this.createOverflowToolbarBuilder(this._sPageId);
83
76
 
84
- return this.prepareResult(
85
- oOverflowToolbarBuilder
86
- .doOnContent(FEBuilder.Matchers.id(new RegExp(Utils.formatMessage("{0}$", sShareId))), OpaBuilder.Actions.press())
87
- .description(Utils.formatMessage("Pressing header '{0}' Share button", this.getIdentifier()))
88
- .success(APIHelper.createSendEmailExecutorBuilder())
89
- .execute()
90
- );
91
- };
77
+ return this.prepareResult(
78
+ oOverflowToolbarBuilder
79
+ .doOnContent(FEBuilder.Matchers.id(new RegExp(Utils.formatMessage("{0}$", sShareId))), OpaBuilder.Actions.press())
80
+ .description(Utils.formatMessage("Pressing header '{0}' Share button", this.getIdentifier()))
81
+ .success(APIHelper.createSendEmailExecutorBuilder())
82
+ .execute()
83
+ );
84
+ };
92
85
 
93
- return HeaderActionsLR;
94
- });
86
+ return HeaderActionsLR;
87
+ }
88
+ );
@@ -45,7 +45,6 @@ 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
50
  HeaderAssertions.prototype.iCheckAction = function (vActionIdentifier, mState) {
@@ -63,7 +62,6 @@ 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
67
  HeaderAssertions.prototype.iCheckEdit = function (mState) {
@@ -75,7 +73,6 @@ 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
78
  HeaderAssertions.prototype.iCheckDelete = function (mState) {
@@ -87,7 +84,6 @@ 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
89
  HeaderAssertions.prototype.iCheckRelatedApps = function (mState) {
@@ -99,7 +95,6 @@ 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
100
  HeaderAssertions.prototype.iCheckMenuAction = function (vAction) {
@@ -112,7 +107,6 @@ 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
112
  HeaderAssertions.prototype.iCheckNumberOfHeaderContentItems = function (iNumberOfItems, bIncludeHidden) {
@@ -148,7 +142,6 @@ 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
147
  HeaderAssertions.prototype.iCheckFieldInFieldGroup = function (vFieldIdentifier, vValue, mState) {
@@ -181,7 +174,6 @@ 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
179
  HeaderAssertions.prototype.iCheckDataPoint = function (sTitle, sValue) {
@@ -213,7 +205,6 @@ 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
210
  HeaderAssertions.prototype.iCheckTitle = function (sTitle, sDescription) {
@@ -244,7 +235,6 @@ sap.ui.define(
244
235
  *
245
236
  * @param {object} mState Defines the expected state of the button
246
237
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
247
- *
248
238
  * @public
249
239
  */
250
240
  HeaderAssertions.prototype.iCheckPaginatorDown = function (mState) {
@@ -264,7 +254,6 @@ sap.ui.define(
264
254
  *
265
255
  * @param {object} mState Defines the expected state of the button
266
256
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
267
- *
268
257
  * @public
269
258
  */
270
259
  HeaderAssertions.prototype.iCheckPaginatorUp = function (mState) {
@@ -283,8 +272,9 @@ sap.ui.define(
283
272
  * Checks a MicroChart shown in the header of an object page.
284
273
  *
285
274
  * TODO this function will not be public yet: Its signature doesn't fit the framework.
275
+ *
286
276
  * @param {object|string} vMicroChartIdentifier Id/Type or Title of MicroChart
287
- * @param sUoMLabel UoM label of the MicroChart
277
+ * @param {string} sUoMLabel UoM label of the MicroChart
288
278
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
289
279
  * @ui5-restricted
290
280
  */
@@ -340,7 +330,6 @@ sap.ui.define(
340
330
  * @param {sap.fe.test.api.HeaderFacetIdentifier} vFacetIdentifier The Identifier of the header facet
341
331
  * @param {object} [mState] Defines the expected state
342
332
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
343
- *
344
333
  * @public
345
334
  */
346
335
  HeaderAssertions.prototype.iCheckHeaderFacet = function (vFacetIdentifier, mState) {
@@ -373,9 +362,7 @@ sap.ui.define(
373
362
  * This is the case for the main object page, which does not show breadcrumb links.
374
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
375
364
  * showing multiple floorplans at the same time.
376
- *
377
365
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
378
- *
379
366
  * @ui5-restricted
380
367
  */
381
368
  HeaderAssertions.prototype.iCheckBreadCrumb = function (sLink) {
@@ -401,7 +388,6 @@ sap.ui.define(
401
388
  *
402
389
  * @param {object} [mState] Defines the expected state of the button
403
390
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
404
- *
405
391
  * @public
406
392
  */
407
393
  HeaderAssertions.prototype.iCheckSaveAsTile = function (mState) {
@@ -427,7 +413,6 @@ sap.ui.define(
427
413
  *
428
414
  * @param {object} [mState] Defines the expected state of the button
429
415
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
430
- *
431
416
  * @public
432
417
  */
433
418
  HeaderAssertions.prototype.iCheckSendEmail = function (mState) {
@@ -456,7 +441,6 @@ sap.ui.define(
456
441
  * @param {object | string} vLinkIdentifier The identifier of the field
457
442
  * @param {object} [mState] Defines the expected state of the link
458
443
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
459
- *
460
444
  * @private
461
445
  */
462
446
  HeaderAssertions.prototype.iCheckLink = function (vLinkIdentifier, mState) {
@@ -480,7 +464,6 @@ sap.ui.define(
480
464
  *
481
465
  * @param {number} iExpectedNumber The expected number of users
482
466
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
483
- *
484
467
  * @ui5-restricted
485
468
  */
486
469
  HeaderAssertions.prototype.iCheckNumberOfCollaboratingUsers = function (iExpectedNumber) {
@@ -507,7 +490,6 @@ sap.ui.define(
507
490
  *
508
491
  * @param {string} sInitials The initials of the user (displayed in the avatar)
509
492
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
510
- *
511
493
  * @ui5-restricted
512
494
  */
513
495
  HeaderAssertions.prototype.iCheckCollaboratingUser = function (sInitials) {
@@ -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
  });