@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,7 +3,7 @@
3
3
  (c) Copyright 2009-2021 SAP SE. All rights reserved
4
4
 
5
5
  */
6
- sap.ui.define(["./FooterAPI", "sap/fe/test/Utils"], function(FooterAPI, Utils) {
6
+ sap.ui.define(["./FooterAPI", "sap/fe/test/Utils"], function (FooterAPI, Utils) {
7
7
  "use strict";
8
8
 
9
9
  /**
@@ -17,7 +17,7 @@ sap.ui.define(["./FooterAPI", "sap/fe/test/Utils"], function(FooterAPI, Utils) {
17
17
  * @hideconstructor
18
18
  * @public
19
19
  */
20
- var FooterAssertionsBase = function(oOverflowToolbarBuilder, vFooterDescription) {
20
+ var FooterAssertionsBase = function (oOverflowToolbarBuilder, vFooterDescription) {
21
21
  return FooterAPI.call(this, oOverflowToolbarBuilder, vFooterDescription);
22
22
  };
23
23
  FooterAssertionsBase.prototype = Object.create(FooterAPI.prototype);
@@ -30,10 +30,9 @@ sap.ui.define(["./FooterAPI", "sap/fe/test/Utils"], function(FooterAPI, Utils) {
30
30
  * @param {string | sap.fe.test.api.ActionIdentifier} vActionIdentifier The identifier of an action
31
31
  * @param {object} [mState] Defines the expected state of the button
32
32
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
33
- *
34
33
  * @public
35
34
  */
36
- FooterAssertionsBase.prototype.iCheckAction = function(vActionIdentifier, mState) {
35
+ FooterAssertionsBase.prototype.iCheckAction = function (vActionIdentifier, mState) {
37
36
  var oOverflowToolbarBuilder = this.getBuilder();
38
37
 
39
38
  return this.prepareResult(
@@ -49,16 +48,12 @@ sap.ui.define(["./FooterAPI", "sap/fe/test/Utils"], function(FooterAPI, Utils) {
49
48
  *
50
49
  * @param {object} [mState] Defines the expected state of the footer bar
51
50
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
52
- *
53
51
  * @public
54
52
  */
55
- FooterAssertionsBase.prototype.iCheckState = function(mState) {
53
+ FooterAssertionsBase.prototype.iCheckState = function (mState) {
56
54
  var oOverflowToolbarBuilder = this.getBuilder();
57
55
  return this.prepareResult(
58
- oOverflowToolbarBuilder
59
- .hasState(mState)
60
- .description(Utils.formatMessage("Checking footer with state='{0}'", mState))
61
- .execute()
56
+ oOverflowToolbarBuilder.hasState(mState).description(Utils.formatMessage("Checking footer with state='{0}'", mState)).execute()
62
57
  );
63
58
  };
64
59
 
@@ -3,7 +3,7 @@
3
3
  (c) Copyright 2009-2021 SAP SE. All rights reserved
4
4
 
5
5
  */
6
- sap.ui.define(["./FooterAssertionsBase", "sap/fe/test/Utils", "sap/m/library"], function(FooterAssertionsBase, Utils, mLibrary) {
6
+ sap.ui.define(["./FooterAssertionsBase", "sap/fe/test/Utils", "sap/m/library"], function (FooterAssertionsBase, Utils, mLibrary) {
7
7
  "use strict";
8
8
 
9
9
  /**
@@ -18,7 +18,7 @@ sap.ui.define(["./FooterAssertionsBase", "sap/fe/test/Utils", "sap/m/library"],
18
18
  * @hideconstructor
19
19
  * @public
20
20
  */
21
- var FooterAssertionsOP = function(oOverflowToolbarBuilder, vFooterDescription) {
21
+ var FooterAssertionsOP = function (oOverflowToolbarBuilder, vFooterDescription) {
22
22
  return FooterAssertionsBase.call(this, oOverflowToolbarBuilder, vFooterDescription);
23
23
  };
24
24
  FooterAssertionsOP.prototype = Object.create(FooterAssertionsBase.prototype);
@@ -29,7 +29,7 @@ sap.ui.define(["./FooterAssertionsBase", "sap/fe/test/Utils", "sap/m/library"],
29
29
 
30
30
  function _checkDraftState(oOverflowToolbarBuilder, sState) {
31
31
  return oOverflowToolbarBuilder
32
- .hasContent(function(oObject) {
32
+ .hasContent(function (oObject) {
33
33
  return oObject.getMetadata().getName() === "sap.m.DraftIndicator" && oObject.getState() === sState;
34
34
  })
35
35
  .description("Draft Indicator on footer bar is in " + sState + " state")
@@ -41,10 +41,9 @@ sap.ui.define(["./FooterAssertionsBase", "sap/fe/test/Utils", "sap/m/library"],
41
41
  *
42
42
  * @param {object} [mState] Defines the expected state of the button
43
43
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
44
- *
45
44
  * @public
46
45
  */
47
- FooterAssertionsOP.prototype.iCheckSave = function(mState) {
46
+ FooterAssertionsOP.prototype.iCheckSave = function (mState) {
48
47
  return this.iCheckAction({ service: "StandardAction", action: "Save", unbound: true }, mState);
49
48
  };
50
49
 
@@ -53,10 +52,9 @@ sap.ui.define(["./FooterAssertionsBase", "sap/fe/test/Utils", "sap/m/library"],
53
52
  *
54
53
  * @param {object} [mState] Defines the expected state of the button
55
54
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
56
- *
57
55
  * @public
58
56
  */
59
- FooterAssertionsOP.prototype.iCheckApply = function(mState) {
57
+ FooterAssertionsOP.prototype.iCheckApply = function (mState) {
60
58
  return this.iCheckAction({ service: "StandardAction", action: "Apply", unbound: true }, mState);
61
59
  };
62
60
 
@@ -65,10 +63,9 @@ sap.ui.define(["./FooterAssertionsBase", "sap/fe/test/Utils", "sap/m/library"],
65
63
  *
66
64
  * @param {object} [mState] Defines the expected state of the button
67
65
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
68
- *
69
66
  * @public
70
67
  */
71
- FooterAssertionsOP.prototype.iCheckCancel = function(mState) {
68
+ FooterAssertionsOP.prototype.iCheckCancel = function (mState) {
72
69
  return this.iCheckAction({ service: "StandardAction", action: "Cancel", unbound: true }, mState);
73
70
  };
74
71
 
@@ -76,10 +73,9 @@ sap.ui.define(["./FooterAssertionsBase", "sap/fe/test/Utils", "sap/m/library"],
76
73
  * Checks for draft state 'Clear' in the footer bar.
77
74
  *
78
75
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
79
- *
80
76
  * @public
81
77
  */
82
- FooterAssertionsOP.prototype.iCheckDraftStateClear = function() {
78
+ FooterAssertionsOP.prototype.iCheckDraftStateClear = function () {
83
79
  return this.prepareResult(_checkDraftState(this.getBuilder(), DraftIndicatorState.Clear));
84
80
  };
85
81
 
@@ -87,10 +83,9 @@ sap.ui.define(["./FooterAssertionsBase", "sap/fe/test/Utils", "sap/m/library"],
87
83
  * Checks for draft state 'Saved' in the footer bar.
88
84
  *
89
85
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
90
- *
91
86
  * @public
92
87
  */
93
- FooterAssertionsOP.prototype.iCheckDraftStateSaved = function() {
88
+ FooterAssertionsOP.prototype.iCheckDraftStateSaved = function () {
94
89
  return this.prepareResult(_checkDraftState(this.getBuilder(), DraftIndicatorState.Saved));
95
90
  };
96
91
 
@@ -12,7 +12,7 @@ sap.ui.define(
12
12
  "sap/fe/test/builder/MacroFieldBuilder",
13
13
  "sap/base/Log"
14
14
  ],
15
- function(BaseAPI, Utils, OpaBuilder, FEBuilder, MacroFieldBuilder, Log) {
15
+ function (BaseAPI, Utils, OpaBuilder, FEBuilder, MacroFieldBuilder, Log) {
16
16
  "use strict";
17
17
 
18
18
  /**
@@ -21,7 +21,6 @@ sap.ui.define(
21
21
  * @typedef {object} FormIdentifier
22
22
  * @property {string} section The facet ID
23
23
  * @property {string} fieldGroup The fieldgroup ID
24
- *
25
24
  * @name sap.fe.test.api.FormIdentifier
26
25
  * @public
27
26
  */
@@ -37,7 +36,7 @@ sap.ui.define(
37
36
  * @hideconstructor
38
37
  * @public
39
38
  */
40
- var FormAPI = function(oFormBuilder, vFormDescription) {
39
+ var FormAPI = function (oFormBuilder, vFormDescription) {
41
40
  if (!Utils.isOfType(oFormBuilder, FEBuilder)) {
42
41
  throw new Error("oFormBuilder parameter must be a FEBuilder instance");
43
42
  }
@@ -46,7 +45,7 @@ sap.ui.define(
46
45
  FormAPI.prototype = Object.create(BaseAPI.prototype);
47
46
  FormAPI.prototype.constructor = FormAPI;
48
47
 
49
- FormAPI.prototype.createFieldBuilder = function(vFieldIdentifier) {
48
+ FormAPI.prototype.createFieldBuilder = function (vFieldIdentifier) {
50
49
  var oBuilder = new MacroFieldBuilder(this.getOpaInstance(), this.getBuilder().build());
51
50
 
52
51
  if (vFieldIdentifier.fieldGroup) {
@@ -60,7 +59,7 @@ sap.ui.define(
60
59
  .has(FEBuilder.Matchers.singleElement());
61
60
  };
62
61
 
63
- FormAPI.prototype._getBuilderForFormElement = function(vFieldIdentifier) {
62
+ FormAPI.prototype._getBuilderForFormElement = function (vFieldIdentifier) {
64
63
  return FEBuilder.create(this.getOpaInstance()) // identifying the FormElement
65
64
  .hasType("sap.ui.layout.form.FormElement")
66
65
  .hasSome(
@@ -71,7 +70,7 @@ sap.ui.define(
71
70
  );
72
71
  };
73
72
 
74
- FormAPI.prototype._getBuilderForFieldGroup = function(vFieldIdentifier) {
73
+ FormAPI.prototype._getBuilderForFieldGroup = function (vFieldIdentifier) {
75
74
  return FEBuilder.create(this.getOpaInstance()) // identifying the FieldGroup
76
75
  .hasType("sap.ui.layout.form.FormContainer")
77
76
  .has(this.createFieldGroupMatcher(vFieldIdentifier));
@@ -12,7 +12,7 @@ sap.ui.define(
12
12
  "sap/fe/test/builder/MacroFieldBuilder",
13
13
  "sap/fe/test/builder/OverflowToolbarBuilder"
14
14
  ],
15
- function(FormAPI, Utils, OpaBuilder, FEBuilder, MacroFieldBuilder, OverflowToolbarBuilder) {
15
+ function (FormAPI, Utils, OpaBuilder, FEBuilder, MacroFieldBuilder, OverflowToolbarBuilder) {
16
16
  "use strict";
17
17
 
18
18
  /**
@@ -27,7 +27,7 @@ sap.ui.define(
27
27
  * @hideconstructor
28
28
  * @public
29
29
  */
30
- var FormActions = function(oFormBuilder, vFormDescription) {
30
+ var FormActions = function (oFormBuilder, vFormDescription) {
31
31
  return FormAPI.call(this, oFormBuilder, vFormDescription);
32
32
  };
33
33
  FormActions.prototype = Object.create(FormAPI.prototype);
@@ -40,7 +40,7 @@ sap.ui.define(
40
40
  sButtonSuffix = bShowMore ? "--seeMore" : "--seeLess";
41
41
 
42
42
  oFormBuilder
43
- .has(function(oElement) {
43
+ .has(function (oElement) {
44
44
  sSubSectionId = oElement.getId().substring(oElement.getId().lastIndexOf("::") + 2);
45
45
  return true;
46
46
  })
@@ -49,7 +49,7 @@ sap.ui.define(
49
49
  return vOpaInstance.prepareResult(
50
50
  OpaBuilder.create(vOpaInstance)
51
51
  .hasId(new RegExp(Utils.formatMessage("{0}$", sButtonSuffix)))
52
- .has(function(oElement) {
52
+ .has(function (oElement) {
53
53
  return oElement.getId().substring(oElement.getId().lastIndexOf("::") + 2) === sSubSectionId + sButtonSuffix;
54
54
  })
55
55
  .doPress()
@@ -63,10 +63,9 @@ sap.ui.define(
63
63
  *
64
64
  * @param {string | sap.fe.test.api.ActionIdentifier} vActionIdentifier The identifier of the action or its label
65
65
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
66
- *
67
66
  * @public
68
67
  */
69
- FormActions.prototype.iExecuteAction = function(vActionIdentifier) {
68
+ FormActions.prototype.iExecuteAction = function (vActionIdentifier) {
70
69
  var oFormBuilder = this.getBuilder(),
71
70
  vFormDescription = this.getIdentifier(),
72
71
  sFormContainerId;
@@ -97,10 +96,9 @@ sap.ui.define(
97
96
  * Executes the Show More action of a form in a subsection.
98
97
  *
99
98
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
100
- *
101
99
  * @public
102
100
  */
103
- FormActions.prototype.iExecuteShowMore = function() {
101
+ FormActions.prototype.iExecuteShowMore = function () {
104
102
  return _executeShowMoreShowLess(this, true);
105
103
  };
106
104
 
@@ -108,10 +106,9 @@ sap.ui.define(
108
106
  * Executes the Show Less action of a form in a subsection.
109
107
  *
110
108
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
111
- *
112
109
  * @public
113
110
  */
114
- FormActions.prototype.iExecuteShowLess = function() {
111
+ FormActions.prototype.iExecuteShowLess = function () {
115
112
  return _executeShowMoreShowLess(this, false);
116
113
  };
117
114
 
@@ -119,12 +116,10 @@ sap.ui.define(
119
116
  * Clicks a link within a form.
120
117
  *
121
118
  * @param {sap.fe.test.api.FieldIdentifier | string} vFieldIdentifier The identifier of the field
122
- *
123
119
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
124
- *
125
120
  * @public
126
121
  */
127
- FormActions.prototype.iClickLink = function(vFieldIdentifier) {
122
+ FormActions.prototype.iClickLink = function (vFieldIdentifier) {
128
123
  return this.prepareResult(
129
124
  this.createFieldBuilder(vFieldIdentifier)
130
125
  .hasState({ controlType: "sap.m.Link" })
@@ -138,12 +133,10 @@ sap.ui.define(
138
133
  * Toggles the value of a checkbox within a form.
139
134
  *
140
135
  * @param {sap.fe.test.api.FieldIdentifier} vFieldIdentifier The identifier of the field
141
- *
142
136
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
143
- *
144
137
  * @public
145
138
  */
146
- FormActions.prototype.iClickCheckBox = function(vFieldIdentifier) {
139
+ FormActions.prototype.iClickCheckBox = function (vFieldIdentifier) {
147
140
  return this.prepareResult(
148
141
  this.createFieldBuilder(vFieldIdentifier)
149
142
  .hasState({ controlType: "sap.m.CheckBox" })
@@ -158,12 +151,10 @@ sap.ui.define(
158
151
  *
159
152
  * @param {sap.fe.test.api.FieldIdentifier | string} vFieldIdentifier The identifier of the field
160
153
  * @param {string} [sValue] The value to be set for the field
161
- *
162
154
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
163
- *
164
155
  * @public
165
156
  */
166
- FormActions.prototype.iChangeField = function(vFieldIdentifier, sValue) {
157
+ FormActions.prototype.iChangeField = function (vFieldIdentifier, sValue) {
167
158
  return this.prepareResult(
168
159
  this.createFieldBuilder(vFieldIdentifier)
169
160
  .doEnterText(sValue, true, false, true)
@@ -184,10 +175,9 @@ sap.ui.define(
184
175
  *
185
176
  * @param {string | sap.fe.test.api.FieldIdentifier} vFieldIdentifier The identifier of the field
186
177
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function that can be used for chaining statements
187
- *
188
178
  * @public
189
179
  */
190
- FormActions.prototype.iOpenValueHelp = function(vFieldIdentifier) {
180
+ FormActions.prototype.iOpenValueHelp = function (vFieldIdentifier) {
191
181
  return this.prepareResult(
192
182
  this.createFieldBuilder(vFieldIdentifier)
193
183
  .hasState({ visible: true })
@@ -5,7 +5,7 @@
5
5
  */
6
6
  sap.ui.define(
7
7
  ["./FormAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/builder/FEBuilder", "sap/fe/test/builder/MacroFieldBuilder"],
8
- function(FormAPI, Utils, OpaBuilder, FEBuilder, MacroFieldBuilder) {
8
+ function (FormAPI, Utils, OpaBuilder, FEBuilder, MacroFieldBuilder) {
9
9
  "use strict";
10
10
 
11
11
  /**
@@ -20,7 +20,7 @@ sap.ui.define(
20
20
  * @hideconstructor
21
21
  * @public
22
22
  */
23
- var FormAssertions = function(oFormBuilder, vFormDescription) {
23
+ var FormAssertions = function (oFormBuilder, vFormDescription) {
24
24
  return FormAPI.call(this, oFormBuilder, vFormDescription);
25
25
  };
26
26
  FormAssertions.prototype = Object.create(FormAPI.prototype);
@@ -33,7 +33,7 @@ sap.ui.define(
33
33
  sButtonSuffix = bShowMore ? "--seeMore" : "--seeLess";
34
34
 
35
35
  oFormBuilder
36
- .has(function(oElement) {
36
+ .has(function (oElement) {
37
37
  sSubSectionId = oElement.getId().substring(oElement.getId().lastIndexOf("::") + 2);
38
38
  return true;
39
39
  })
@@ -42,7 +42,7 @@ sap.ui.define(
42
42
  return vOpaInstance.prepareResult(
43
43
  FEBuilder.create(vOpaInstance)
44
44
  .hasId(new RegExp(Utils.formatMessage("{0}$", sButtonSuffix)))
45
- .has(function(oElement) {
45
+ .has(function (oElement) {
46
46
  // check whether the control is in the correct SubSection
47
47
  return oElement.getId().substring(oElement.getId().lastIndexOf("::") + 2) === sSubSectionId + sButtonSuffix;
48
48
  })
@@ -57,10 +57,9 @@ sap.ui.define(
57
57
  *
58
58
  * @param {object} mState Defines the expected state of the form
59
59
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
60
- *
61
60
  * @public
62
61
  */
63
- FormAssertions.prototype.iCheckState = function(mState) {
62
+ FormAssertions.prototype.iCheckState = function (mState) {
64
63
  var oFormBuilder = this.getBuilder();
65
64
  return this.prepareResult(
66
65
  oFormBuilder
@@ -82,10 +81,9 @@ sap.ui.define(
82
81
  * @param {string | sap.fe.test.api.ActionIdentifier} vActionIdentifier The identifier of an action
83
82
  * @param {object} [mState] Defines the expected state of the button
84
83
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
85
- *
86
84
  * @public
87
85
  */
88
- FormAssertions.prototype.iCheckAction = function(vActionIdentifier, mState) {
86
+ FormAssertions.prototype.iCheckAction = function (vActionIdentifier, mState) {
89
87
  var aArguments = Utils.parseArguments([[Object, String], Object], arguments),
90
88
  oFormBuilder = this.getBuilder();
91
89
 
@@ -102,10 +100,9 @@ sap.ui.define(
102
100
  *
103
101
  * @param {object} [mState] Defines the expected state of the button
104
102
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
105
- *
106
103
  * @public
107
104
  */
108
- FormAssertions.prototype.iCheckShowMore = function(mState) {
105
+ FormAssertions.prototype.iCheckShowMore = function (mState) {
109
106
  return _checkShowMoreShowLess(this, true, mState);
110
107
  };
111
108
 
@@ -114,10 +111,9 @@ sap.ui.define(
114
111
  *
115
112
  * @param {object} [mState] Defines the expected state of the button
116
113
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
117
- *
118
114
  * @public
119
115
  */
120
- FormAssertions.prototype.iCheckShowLess = function(mState) {
116
+ FormAssertions.prototype.iCheckShowLess = function (mState) {
121
117
  return _checkShowMoreShowLess(this, false, mState);
122
118
  };
123
119
 
@@ -135,10 +131,9 @@ sap.ui.define(
135
131
  * </pre></code>
136
132
  * @param {object} [mState] Defines the expected state of the field
137
133
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
138
- *
139
134
  * @public
140
135
  */
141
- FormAssertions.prototype.iCheckField = function(vFieldIdentifier, vValue, mState) {
136
+ FormAssertions.prototype.iCheckField = function (vFieldIdentifier, vValue, mState) {
142
137
  var aArguments = Utils.parseArguments([[Object, String], [String, Array, Object], Object], arguments);
143
138
  return this.prepareResult(
144
139
  this.createFieldBuilder(vFieldIdentifier)
@@ -164,15 +159,14 @@ sap.ui.define(
164
159
  * @param {string} [sText] The link text
165
160
  * @param {object} [mState] Defines the expected state of the field
166
161
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
167
- *
168
162
  * @public
169
163
  */
170
- FormAssertions.prototype.iCheckLink = function(vFieldIdentifier, sText, mState) {
164
+ FormAssertions.prototype.iCheckLink = function (vFieldIdentifier, sText, mState) {
171
165
  var aArguments = Utils.parseArguments([[Object, String], String, Object], arguments);
172
166
  return this.iCheckField(aArguments[0], aArguments[1], Utils.mergeObjects({ controlType: "sap.m.Link" }, aArguments[2]));
173
167
  };
174
168
 
175
- FormAssertions.prototype.iCheckFormContainersElementCount = function(sFormContainer, iCount, mState) {
169
+ FormAssertions.prototype.iCheckFormContainersElementCount = function (sFormContainer, iCount, mState) {
176
170
  var aArguments = Utils.parseArguments([String, Number, Object], arguments),
177
171
  fullSubSectionId = this.getIdentifier().fullSubSectionId,
178
172
  mFormState = aArguments[2],
@@ -182,11 +176,11 @@ sap.ui.define(
182
176
  return this.prepareResult(
183
177
  this.getBuilder()
184
178
  .hasId(sFormContainerId)
185
- .has(function(oFormContainer) {
179
+ .has(function (oFormContainer) {
186
180
  var oMatchingFormContainers;
187
181
  if (Object.keys(mFormState).length) {
188
- oMatchingFormContainers = oFormContainer.getFormElements().filter(function(oFormElement) {
189
- return Object.keys(mFormState).every(function(sFormElementKey) {
182
+ oMatchingFormContainers = oFormContainer.getFormElements().filter(function (oFormElement) {
183
+ return Object.keys(mFormState).every(function (sFormElementKey) {
190
184
  return mFormState[sFormElementKey] === oFormElement.getProperty(sFormElementKey);
191
185
  });
192
186
  });
@@ -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
  /**
@@ -22,7 +22,6 @@ sap.ui.define(
22
22
  * @property {string} facetId The identifier of the facet
23
23
  * @property {boolean} [collection] Defines whether the facet is a collection facet (default: <code>false</code>)
24
24
  * @property {boolean} [custom] Defines whether the facet is a custom header facet (default: <code>false</code>)
25
- *
26
25
  * @name sap.fe.test.api.HeaderFacetIdentifier
27
26
  * @public
28
27
  */
@@ -37,7 +36,7 @@ sap.ui.define(
37
36
  * @class
38
37
  * @private
39
38
  */
40
- var HeaderAPI = function(oHeaderBuilder, vHeaderDescription) {
39
+ var HeaderAPI = function (oHeaderBuilder, vHeaderDescription) {
41
40
  if (!Utils.isOfType(oHeaderBuilder, FEBuilder)) {
42
41
  throw new Error("oHeaderBuilder parameter must be a FEBuilder instance");
43
42
  }
@@ -51,27 +50,16 @@ sap.ui.define(
51
50
  *
52
51
  * @param {string} sObjectPageLayoutId The identifier of <code>sap.uxap.ObjectPageLayout</code> control
53
52
  * @returns {object} OverflowToolbarBuilder object
54
- *
55
53
  * @ui5-restricted
56
54
  */
57
- HeaderAPI.prototype.createOverflowToolbarBuilder = function(sObjectPageLayoutId) {
55
+ HeaderAPI.prototype.createOverflowToolbarBuilder = function (sObjectPageLayoutId) {
58
56
  return OverflowToolbarBuilder.create(this.getOpaInstance())
59
57
  .hasType("sap.m.OverflowToolbar")
60
- .has(function(oOverflowToolbar) {
58
+ .has(function (oOverflowToolbar) {
61
59
  return (
62
- oOverflowToolbar
63
- .getParent()
64
- .getMetadata()
65
- .getName() === "sap.uxap.ObjectPageDynamicHeaderTitle" &&
66
- oOverflowToolbar
67
- .getParent()
68
- .getParent()
69
- .getMetadata()
70
- .getName() === "sap.uxap.ObjectPageLayout" &&
71
- oOverflowToolbar
72
- .getParent()
73
- .getParent()
74
- .getId() === sObjectPageLayoutId
60
+ oOverflowToolbar.getParent().getMetadata().getName() === "sap.uxap.ObjectPageDynamicHeaderTitle" &&
61
+ oOverflowToolbar.getParent().getParent().getMetadata().getName() === "sap.uxap.ObjectPageLayout" &&
62
+ oOverflowToolbar.getParent().getParent().getId() === sObjectPageLayoutId
75
63
  );
76
64
  });
77
65
  };
@@ -81,10 +69,9 @@ sap.ui.define(
81
69
  *
82
70
  * @param {string} sObjectPageLayoutId The identifier of <code>sap.uxap.ObjectPageLayout</code> control
83
71
  * @returns {object} OpaBuilder object
84
- *
85
72
  * @ui5-restricted
86
73
  */
87
- HeaderAPI.prototype.getObjectPageDynamicHeaderTitleBuilder = function(sObjectPageLayoutId) {
74
+ HeaderAPI.prototype.getObjectPageDynamicHeaderTitleBuilder = function (sObjectPageLayoutId) {
88
75
  return OpaBuilder.create(this.getOpaInstance())
89
76
  .hasType("sap.uxap.ObjectPageDynamicHeaderTitle")
90
77
  .has(OpaBuilder.Matchers.ancestor(sObjectPageLayoutId, true));
@@ -95,14 +82,13 @@ sap.ui.define(
95
82
  *
96
83
  * @param {string} sHeaderContentId The id of sap.uxap.ObjectPageDynamicHeaderContent control
97
84
  * @returns {object} OpaBuilder object
98
- *
99
85
  * @ui5-restricted
100
86
  */
101
- HeaderAPI.prototype.getObjectPageDynamicHeaderContentBuilder = function(sHeaderContentId) {
87
+ HeaderAPI.prototype.getObjectPageDynamicHeaderContentBuilder = function (sHeaderContentId) {
102
88
  return OpaBuilder.create(this.getOpaInstance()).hasId(sHeaderContentId);
103
89
  };
104
90
 
105
- HeaderAPI.prototype.getFieldGroupFieldId = function(vFieldIdentifier, sViewId) {
91
+ HeaderAPI.prototype.getFieldGroupFieldId = function (vFieldIdentifier, sViewId) {
106
92
  var sId = "fe::HeaderFacet";
107
93
 
108
94
  sId += "::Form";
@@ -115,7 +101,7 @@ sap.ui.define(
115
101
  return sViewId ? sViewId + "--" + sId : sId;
116
102
  };
117
103
 
118
- HeaderAPI.prototype.getDataFieldForAnnotationId = function(vFieldIdentifier, sViewId) {
104
+ HeaderAPI.prototype.getDataFieldForAnnotationId = function (vFieldIdentifier, sViewId) {
119
105
  var sId = "fe::HeaderFacet";
120
106
 
121
107
  sId += "::Form";
@@ -136,10 +122,9 @@ sap.ui.define(
136
122
  * @param {string} sAncestor The id of ancestor control
137
123
  * @param {object} [mState] The matcher-object like visibility and enablement
138
124
  * @returns {object} FEBuilder object
139
- *
140
125
  * @ui5-restricted
141
126
  */
142
- HeaderAPI.prototype.createPaginatorBuilder = function(oMatcher, sAncestor, mState) {
127
+ HeaderAPI.prototype.createPaginatorBuilder = function (oMatcher, sAncestor, mState) {
143
128
  return FEBuilder.create(this.getOpaInstance())
144
129
  .hasType("sap.uxap.ObjectPageHeaderActionButton")
145
130
  .has(oMatcher)
@@ -36,7 +36,6 @@ sap.ui.define(
36
36
  *
37
37
  * @param {string | sap.fe.test.api.ActionIdentifier} vActionIdentifier The identifier of the action
38
38
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
39
- *
40
39
  * @public
41
40
  */
42
41
  HeaderActions.prototype.iExecuteAction = function (vActionIdentifier) {
@@ -53,7 +52,6 @@ sap.ui.define(
53
52
  * Executes the Edit action in the header toolbar of an object page.
54
53
  *
55
54
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
56
- *
57
55
  * @public
58
56
  */
59
57
  HeaderActions.prototype.iExecuteEdit = function () {
@@ -61,10 +59,19 @@ sap.ui.define(
61
59
  };
62
60
 
63
61
  /**
64
- * Executes the Delete action in the header toolbar of an object page.
62
+ * Executes the Draft/Saved Version action in the header toolbar of an object page.
65
63
  *
66
64
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
65
+ * @public
66
+ */
67
+ HeaderActions.prototype.iExecuteDraftAndSavedVersionSwitch = function () {
68
+ return this.iExecuteAction({ service: "StandardAction", action: "SwitchDraftAndActiveObject", unbound: true });
69
+ };
70
+
71
+ /**
72
+ * Executes the Delete action in the header toolbar of an object page.
67
73
  *
74
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
68
75
  * @public
69
76
  */
70
77
  HeaderActions.prototype.iExecuteDelete = function () {
@@ -75,7 +82,6 @@ sap.ui.define(
75
82
  * Executes the Related Apps action in the header toolbar of an object page.
76
83
  *
77
84
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
78
- *
79
85
  * @public
80
86
  */
81
87
  HeaderActions.prototype.iExecuteRelatedApps = function () {
@@ -87,7 +93,6 @@ sap.ui.define(
87
93
  *
88
94
  * @param {string | object} vAction The label of the action or its state
89
95
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
90
- *
91
96
  * @public
92
97
  */
93
98
  HeaderActions.prototype.iExecuteMenuAction = function (vAction) {
@@ -99,7 +104,6 @@ sap.ui.define(
99
104
  *
100
105
  * @param {string | object} vAction The label of the action or its state
101
106
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
102
- *
103
107
  * @public
104
108
  */
105
109
  HeaderActions.prototype.iExecuteSelectListAction = function (vAction) {
@@ -110,7 +114,6 @@ sap.ui.define(
110
114
  * Navigates to the next sub-object page.
111
115
  *
112
116
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
113
- *
114
117
  * @public
115
118
  */
116
119
  HeaderActions.prototype.iExecutePaginatorDown = function () {
@@ -130,7 +133,6 @@ sap.ui.define(
130
133
  * Navigates to the previous sub-object page.
131
134
  *
132
135
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
133
- *
134
136
  * @public
135
137
  */
136
138
  HeaderActions.prototype.iExecutePaginatorUp = function () {
@@ -151,7 +153,6 @@ sap.ui.define(
151
153
  *
152
154
  * @param {string} sLink The label of the link to be navigated to
153
155
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
154
- *
155
156
  * @public
156
157
  * @ui5-restricted
157
158
  */
@@ -170,7 +171,6 @@ sap.ui.define(
170
171
  *
171
172
  * @param {string} sBookmarkTitle The title of the new tile
172
173
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
173
- *
174
174
  * @public
175
175
  * @ui5-restricted
176
176
  */
@@ -191,7 +191,6 @@ sap.ui.define(
191
191
  * Executes the <code>Send E-Mail</code> action.
192
192
  *
193
193
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
194
- *
195
194
  * @public
196
195
  * @ui5-restricted
197
196
  */
@@ -215,7 +214,6 @@ sap.ui.define(
215
214
  *
216
215
  * @param {string} vLinkIdentifier The label of the link to be clicked (TODO it actually must be the link text with the current implementation)
217
216
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
218
- *
219
217
  * @ui5-restricted
220
218
  */
221
219
  HeaderActions.prototype.iClickLink = function (vLinkIdentifier) {