@sapui5/sap.fe.test 1.93.3 → 1.97.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 (36) hide show
  1. package/package.json +5 -4
  2. package/src/sap/fe/test/.library +1 -1
  3. package/src/sap/fe/test/FCLView.js +0 -6
  4. package/src/sap/fe/test/Flexibility.js +47 -11
  5. package/src/sap/fe/test/JestTemplatingHelper.js +109 -7
  6. package/src/sap/fe/test/JestTemplatingHelper.ts +75 -6
  7. package/src/sap/fe/test/ListReport.js +20 -14
  8. package/src/sap/fe/test/ObjectPage.js +40 -26
  9. package/src/sap/fe/test/Shell.js +16 -11
  10. package/src/sap/fe/test/TemplatePage.js +48 -12
  11. package/src/sap/fe/test/UI5MockHelper.js +239 -0
  12. package/src/sap/fe/test/UI5MockHelper.ts +151 -0
  13. package/src/sap/fe/test/Utils.js +5 -1
  14. package/src/sap/fe/test/api/BaseAPI.js +31 -0
  15. package/src/sap/fe/test/api/ChartActions.js +11 -0
  16. package/src/sap/fe/test/api/ChartAssertions.js +35 -7
  17. package/src/sap/fe/test/api/DialogAPI.js +86 -37
  18. package/src/sap/fe/test/api/DialogActions.js +40 -0
  19. package/src/sap/fe/test/api/DialogAssertions.js +53 -0
  20. package/src/sap/fe/test/api/DialogCreateActions.js +3 -1
  21. package/src/sap/fe/test/api/DialogCreateAssertions.js +1 -1
  22. package/src/sap/fe/test/api/EditState.js +9 -0
  23. package/src/sap/fe/test/api/FilterBarActions.js +59 -19
  24. package/src/sap/fe/test/api/FilterBarAssertions.js +38 -6
  25. package/src/sap/fe/test/api/FormActions.js +33 -9
  26. package/src/sap/fe/test/api/FormAssertions.js +33 -4
  27. package/src/sap/fe/test/api/HeaderAssertions.js +29 -12
  28. package/src/sap/fe/test/api/KPICardAPI.js +28 -0
  29. package/src/sap/fe/test/api/KPICardAssertions.js +204 -0
  30. package/src/sap/fe/test/api/TableActions.js +50 -1
  31. package/src/sap/fe/test/api/TableAssertions.js +27 -0
  32. package/src/sap/fe/test/builder/KPIBuilder.js +60 -4
  33. package/src/sap/fe/test/builder/MacroFieldBuilder.js +2 -0
  34. package/src/sap/fe/test/builder/MdcTableBuilder.js +49 -0
  35. package/src/sap/fe/test/library.js +1 -1
  36. package/src/sap/fe/test/massEdit.js +33 -16
@@ -42,7 +42,11 @@ sap.ui.define(
42
42
  if (sSingleDeltaManifest.indexOf("/") !== 0) {
43
43
  sSingleDeltaManifest = sComponentName + "/" + sSingleDeltaManifest;
44
44
  }
45
- oTargetManifest = mergeObjects({}, oTargetManifest, LoaderExtensions.loadResource(sSingleDeltaManifest));
45
+ try {
46
+ oTargetManifest = mergeObjects({}, oTargetManifest, LoaderExtensions.loadResource(sSingleDeltaManifest));
47
+ } catch (ignore) {
48
+ // not always an error, e.g. when navigating to a different app that does not have the delta manifest
49
+ }
46
50
  });
47
51
  }
48
52
 
@@ -68,6 +68,37 @@ sap.ui.define(
68
68
  * @public
69
69
  */
70
70
 
71
+ /**
72
+ * An action parameter dialog field identifier
73
+ *
74
+ * @typedef {object} ActionDialogFieldIdentifier
75
+ * @property {string} property The name of the field
76
+ *
77
+ * @name sap.fe.test.api.ActionDialogFieldIdentifier
78
+ * @public
79
+ */
80
+
81
+ /**
82
+ * An dialog field identifier
83
+ *
84
+ * @typedef {object} DialogFieldIdentifier
85
+ * @property {string} property The name of the field
86
+ * In case of an action parameter dialog, this is the fieldname only
87
+ * <code><pre>
88
+ * {
89
+ * property: <fieldname>
90
+ * }
91
+ * </pre></code>
92
+ * In case of a create dialog, the concatenation of the entity and fieldname has to be provided
93
+ * <code><pre>
94
+ * {
95
+ * property: <entity>::<fieldname>
96
+ * }
97
+ * </pre></code>
98
+ * @name sap.fe.test.api.DialogFieldIdentifier
99
+ * @public
100
+ */
101
+
71
102
  function _findParentChainFunction(oResult, sChainKeyword) {
72
103
  var oAnd = oResult.and;
73
104
  if (sChainKeyword in oAnd) {
@@ -115,5 +115,16 @@ sap.ui.define(["./BaseAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/
115
115
  .execute();
116
116
  };
117
117
 
118
+ Actions.prototype.iExecuteActionWithText = function(sText) {
119
+ return OpaBuilder.create(this)
120
+ .hasType("sap.m.Button")
121
+ .hasProperties({
122
+ text: sText
123
+ })
124
+ .doPress()
125
+ .description("Clicked on button" + sText)
126
+ .execute();
127
+ };
128
+
118
129
  return Actions;
119
130
  });
@@ -25,11 +25,26 @@ sap.ui.define(
25
25
  ChartAssertions.prototype.constructor = ChartAssertions;
26
26
  ChartAssertions.prototype.isAction = false;
27
27
 
28
- ChartAssertions.prototype.iCheckItems = function(iNumberOfItems) {
28
+ ChartAssertions.prototype.iCheckItems = function(iNumberOfItems, sTab) {
29
29
  return OpaBuilder.create(this)
30
- .hasType("sap.ui.mdc.Chart")
31
- .check(function(oChart) {
32
- var aContexts = oChart[0].getBinding("data").getContexts();
30
+ .hasType("sap.ui.mdc.ChartNew")
31
+ .check(function(aCharts) {
32
+ var oChart;
33
+ if (sTab && aCharts && aCharts.length > 1) {
34
+ for (var i = 0; i < aCharts.length; i++) {
35
+ if (aCharts[i].getId().indexOf("fe::Chart::" + sTab) > -1) {
36
+ oChart = aCharts[i];
37
+ break;
38
+ }
39
+ }
40
+ } else {
41
+ oChart = aCharts[0];
42
+ }
43
+ var aContexts = oChart
44
+ .getControlDelegate()
45
+ ._getChart(oChart)
46
+ .getBinding("data")
47
+ .getContexts();
33
48
  return (
34
49
  (aContexts && (iNumberOfItems === undefined ? aContexts.length !== 0 : aContexts.length === iNumberOfItems)) ||
35
50
  (!aContexts && iNumberOfItems === 0)
@@ -41,7 +56,7 @@ sap.ui.define(
41
56
 
42
57
  ChartAssertions.prototype.iSeeChartType = function(sChartType) {
43
58
  return OpaBuilder.create(this)
44
- .hasType("sap.ui.mdc.Chart")
59
+ .hasType("sap.ui.mdc.ChartNew")
45
60
  .check(function(oChart) {
46
61
  return sChartType === oChart[0].getChartType();
47
62
  }, true)
@@ -51,7 +66,7 @@ sap.ui.define(
51
66
 
52
67
  ChartAssertions.prototype.iSeeChartVisible = function() {
53
68
  return OpaBuilder.create(this)
54
- .hasType("sap.ui.mdc.Chart")
69
+ .hasType("sap.ui.mdc.ChartNew")
55
70
  .check(function(oChart) {
56
71
  return oChart[0].getVisible() === true;
57
72
  }, true)
@@ -88,13 +103,26 @@ sap.ui.define(
88
103
 
89
104
  ChartAssertions.prototype.iCheckChartNoDataText = function(sNoDataText) {
90
105
  return OpaBuilder.create(this)
91
- .hasType("sap.ui.mdc.Chart")
106
+ .hasType("sap.ui.mdc.ChartNew")
92
107
  .check(function(oChart) {
93
108
  return sNoDataText === oChart[0].getNoDataText();
94
109
  })
95
110
  .description("No Data text is " + sNoDataText)
96
111
  .execute();
97
112
  };
113
+
114
+ ChartAssertions.prototype.iCheckButtonWithText = function(sText) {
115
+ return OpaBuilder.create(this)
116
+ .hasType("sap.m.Button")
117
+ .hasProperties({ text: sText })
118
+ .description("Seeing Button with text '" + sText + "'")
119
+ .execute();
120
+ };
121
+
122
+ ChartAssertions.prototype.iCheckMessageToastWithText = function(sText) {
123
+ return FEBuilder.createMessageToastBuilder(sText).execute(this);
124
+ };
125
+
98
126
  return ChartAssertions;
99
127
  }
100
128
  );
@@ -2,46 +2,95 @@
2
2
  * ! SAPUI5
3
3
  * (c) Copyright 2009-2021 SAP SE. All rights reserved.
4
4
  */
5
- sap.ui.define(["./BaseAPI", "sap/fe/test/Utils", "sap/fe/test/builder/DialogBuilder"], function(BaseAPI, Utils, DialogBuilder) {
6
- "use strict";
5
+ sap.ui.define(
6
+ [
7
+ "./BaseAPI",
8
+ "sap/fe/test/Utils",
9
+ "sap/fe/test/builder/FEBuilder",
10
+ "sap/fe/test/builder/MdcFieldBuilder",
11
+ "sap/fe/test/builder/DialogBuilder"
12
+ ],
13
+ function(BaseAPI, Utils, FEBuilder, MdcFieldBuilder, DialogBuilder) {
14
+ "use strict";
7
15
 
8
- /**
9
- * Constructs a new DialogAPI instance.
10
- *
11
- * @param {sap.fe.test.builder.DialogBuilder} oDialogBuilder The {@link sap.fe.test.builder.DialogBuilder} instance used to interact with the UI
12
- * @param {string} [vDialogDescription] Description (optional) of the dialog to be used for logging messages
13
- * @param {int} [iConfirmButtonIndex] Index of the 'confirm' button in the button aggregation; the default setting is 0 (first button from the left)
14
- * @returns {sap.fe.test.api.DialogAPI} The new instance
15
- * @class
16
- * @private
17
- */
18
- var DialogAPI = function(oDialogBuilder, vDialogDescription, iConfirmButtonIndex) {
19
- if (!Utils.isOfType(oDialogBuilder, DialogBuilder)) {
20
- throw new Error("oDialogBuilder parameter must be a DialogBuilder instance");
21
- }
22
- this._iConfirmButtonIndex = iConfirmButtonIndex || 0;
23
- return BaseAPI.call(this, oDialogBuilder, vDialogDescription);
24
- };
25
- DialogAPI.prototype = Object.create(BaseAPI.prototype);
26
- DialogAPI.prototype.constructor = DialogAPI;
16
+ /**
17
+ * Constructs a new DialogAPI instance.
18
+ *
19
+ * @param {sap.fe.test.builder.DialogBuilder} oDialogBuilder The {@link sap.fe.test.builder.DialogBuilder} instance used to interact with the UI
20
+ * @param {string} [vDialogDescription] Description (optional) of the dialog to be used for logging messages
21
+ * @param {int} [iConfirmButtonIndex] Index of the 'confirm' button in the button aggregation; the default setting is 0 (first button from the left)
22
+ * @returns {sap.fe.test.api.DialogAPI} The new instance
23
+ * @class
24
+ * @private
25
+ */
26
+ var DialogAPI = function(oDialogBuilder, vDialogDescription, iConfirmButtonIndex) {
27
+ if (!Utils.isOfType(oDialogBuilder, DialogBuilder)) {
28
+ throw new Error("oDialogBuilder parameter must be a DialogBuilder instance");
29
+ }
30
+ this._iConfirmButtonIndex = iConfirmButtonIndex || 0;
31
+ return BaseAPI.call(this, oDialogBuilder, vDialogDescription);
32
+ };
33
+ DialogAPI.prototype = Object.create(BaseAPI.prototype);
34
+ DialogAPI.prototype.constructor = DialogAPI;
35
+
36
+ /**
37
+ * Creates a matcher for fields within create and action dialogs.
38
+ *
39
+ * @param {sap.fe.test.api.FieldIdentifier | string} vFieldIdentifier Identifier to be used for the matcher
40
+ * @param {object} oDialogIdentifier Identifier for the dialog (create/action)
41
+ *
42
+ * @returns {object} A matcher
43
+ *
44
+ * @private
45
+ */
46
+ DialogAPI.prototype._createFieldMatcher = function(vFieldIdentifier, oDialogIdentifier) {
47
+ var vMatcher, sFieldId;
48
+ if (!Utils.isOfType(vFieldIdentifier, String)) {
49
+ if (typeof vFieldIdentifier.property === "string") {
50
+ sFieldId =
51
+ oDialogIdentifier && oDialogIdentifier.type === "Create"
52
+ ? "CreateDialog::" + vFieldIdentifier.property.replaceAll("/", "::")
53
+ : "APD_::" + vFieldIdentifier.property.replaceAll("/", "::");
54
+ } else {
55
+ throw new Error(
56
+ "The 'property' parameter for creating a control ID for a field in an action dialog is not supported: " +
57
+ vFieldIdentifier.property
58
+ );
59
+ }
60
+ vMatcher = FEBuilder.Matchers.id(new RegExp(Utils.formatMessage("{0}", sFieldId)));
61
+ } else {
62
+ // identify a field by its label
63
+ //vMatcher = FEBuilder.Matchers.label(vFieldIdentifier);
64
+ }
65
+ return vMatcher;
66
+ };
67
+
68
+ DialogAPI.prototype._createFieldBuilder = function(vFieldIdentifier, oDialogIdentifier) {
69
+ var oMdcFieldBuilder = new MdcFieldBuilder(this.getOpaInstance());
70
+ return oMdcFieldBuilder
71
+ .isDialogElement()
72
+ .hasType("sap.ui.mdc.Field")
73
+ .has(this._createFieldMatcher(vFieldIdentifier, oDialogIdentifier));
74
+ };
27
75
 
28
- DialogAPI.prototype._getConfirmButtonMatcher = function() {
29
- var iConfirmButtonIndex = this._iConfirmButtonIndex;
30
- return function(oButton) {
31
- var aButtons = oButton.getParent().getButtons();
32
- // Confirm is (usually) the first button
33
- return aButtons.indexOf(oButton) === Math.min(aButtons.length - 1, iConfirmButtonIndex);
76
+ DialogAPI.prototype._getConfirmButtonMatcher = function() {
77
+ var iConfirmButtonIndex = this._iConfirmButtonIndex;
78
+ return function(oButton) {
79
+ var aButtons = oButton.getParent().getButtons();
80
+ // Confirm is (usually) the first button
81
+ return aButtons.indexOf(oButton) === Math.min(aButtons.length - 1, iConfirmButtonIndex);
82
+ };
34
83
  };
35
- };
36
84
 
37
- DialogAPI.prototype._getCancelButtonMatcher = function() {
38
- var iConfirmButtonIndex = this._iConfirmButtonIndex;
39
- return function(oButton) {
40
- var aButtons = oButton.getParent().getButtons();
41
- // Cancel is (usually) right next to the first (confirm) button
42
- return aButtons.indexOf(oButton) === Math.min(aButtons.length - 1, iConfirmButtonIndex + 1);
85
+ DialogAPI.prototype._getCancelButtonMatcher = function() {
86
+ var iConfirmButtonIndex = this._iConfirmButtonIndex;
87
+ return function(oButton) {
88
+ var aButtons = oButton.getParent().getButtons();
89
+ // Cancel is (usually) right next to the first (confirm) button
90
+ return aButtons.indexOf(oButton) === Math.min(aButtons.length - 1, iConfirmButtonIndex + 1);
91
+ };
43
92
  };
44
- };
45
93
 
46
- return DialogAPI;
47
- });
94
+ return DialogAPI;
95
+ }
96
+ );
@@ -69,5 +69,45 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"], fu
69
69
  );
70
70
  };
71
71
 
72
+ /**
73
+ * Changes the content of a field in a dialog.
74
+ *
75
+ * @param {sap.fe.test.api.DialogFieldIdentifier} vFieldIdentifier The identifier of the field
76
+ * @param {string} [vValue] The new target value.
77
+ * @param {boolean} [bClearFirst] Set to <code>true</code> to clear previously set filters, otherwise all previously set values will be kept
78
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
79
+ * @public
80
+ */
81
+ DialogActions.prototype.iChangeDialogField = function(vFieldIdentifier, vValue, bClearFirst) {
82
+ var aArguments = Utils.parseArguments([Object, String, Boolean], arguments);
83
+ return this.prepareResult(
84
+ this._createFieldBuilder(vFieldIdentifier, this.getIdentifier())
85
+ .doChangeValue(aArguments[1], aArguments[2])
86
+ .description(
87
+ Utils.formatMessage(
88
+ "Changing the field '{1}' of dialog '{0}' by adding '{2}' (was cleared first: {3})",
89
+ this.getIdentifier(),
90
+ aArguments[0],
91
+ aArguments[1],
92
+ !!aArguments[2]
93
+ )
94
+ )
95
+ .execute()
96
+ );
97
+ };
98
+
99
+ /**
100
+ * Changes the content of a field in an action parameter dialog.
101
+ *
102
+ * @param {sap.fe.test.api.ActionDialogFieldIdentifier} vFieldIdentifier The identifier of the field
103
+ * @param {string} [vValue] The new target value.
104
+ * @param {boolean} [bClearFirst] Set to <code>true</code> to clear previously set filters, otherwise all previously set values will be kept
105
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
106
+ * @public
107
+ */
108
+ DialogActions.prototype.iChangeActionParameterDialogField = function(vFieldIdentifier, vValue, bClearFirst) {
109
+ return this.iChangeDialogField(vFieldIdentifier, vValue, bClearFirst);
110
+ };
111
+
72
112
  return DialogActions;
73
113
  });
@@ -85,5 +85,58 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils"], function(DialogAPI, Utils) {
85
85
  );
86
86
  };
87
87
 
88
+ /**
89
+ * Checks the content and state of a field in a dialog.
90
+ *
91
+ * @param {sap.fe.test.api.DialogFieldIdentifier} vFieldIdentifier The identifier of the field
92
+ * @param {string | Array | object} [vValue] Expected value(s) of the field.
93
+ * if passed as an object, the following pattern will be considered:
94
+ * <code><pre>
95
+ * {
96
+ * value: <string>, // optional
97
+ * }
98
+ * </pre></code>
99
+ * @param {object} [mState] Defines the expected state of the field
100
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
101
+ * @public
102
+ */
103
+ DialogAssertions.prototype.iCheckDialogField = function(vFieldIdentifier, vValue, mState) {
104
+ var aArguments = Utils.parseArguments([Object, [String, Array, Object], Object], arguments);
105
+ return this.prepareResult(
106
+ this._createFieldBuilder(vFieldIdentifier, this.getIdentifier())
107
+ .hasValue(aArguments[1])
108
+ .hasState(aArguments[2])
109
+ .description(
110
+ Utils.formatMessage(
111
+ "Checking field '{1}' of dialog '{0}' with content '{2}' and state '{3}'",
112
+ this.getIdentifier(),
113
+ aArguments[0],
114
+ aArguments[1],
115
+ aArguments[2]
116
+ )
117
+ )
118
+ .execute()
119
+ );
120
+ };
121
+
122
+ /**
123
+ * Checks the content and state of a field in an action parameter dialog.
124
+ *
125
+ * @param {sap.fe.test.api.ActionDialogFieldIdentifier} vFieldIdentifier The identifier of the field
126
+ * @param {string | Array | object} [vValue] Expected value(s) of the field.
127
+ * if passed as an object, the following pattern will be considered:
128
+ * <code><pre>
129
+ * {
130
+ * value: <string>, // optional
131
+ * }
132
+ * </pre></code>
133
+ * @param {object} [mState] Defines the expected state of the field
134
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
135
+ * @public
136
+ */
137
+ DialogAssertions.prototype.iCheckActionParameterDialogField = function(vFieldIdentifier, vValue, mState) {
138
+ return this.iCheckDialogField(vFieldIdentifier, vValue, mState);
139
+ };
140
+
88
141
  return DialogAssertions;
89
142
  });
@@ -33,7 +33,9 @@ sap.ui.define(["./DialogActions", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"]
33
33
  DialogCreateActions.prototype.iExecuteCreate = function() {
34
34
  return this.prepareResult(
35
35
  this.getBuilder()
36
- .doPressFooterButton(OpaBuilder.Matchers.resourceBundle("text", "sap.fe.core", "C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE"))
36
+ .doPressFooterButton(
37
+ OpaBuilder.Matchers.resourceBundle("text", "sap.fe.core", "C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON")
38
+ )
37
39
  .description(Utils.formatMessage("Pressing create button on dialog '{0}'", this.getIdentifier()))
38
40
  .execute()
39
41
  );
@@ -40,7 +40,7 @@ sap.ui.define(["./DialogAssertions", "sap/ui/test/OpaBuilder", "sap/fe/test/buil
40
40
  return this.prepareResult(
41
41
  this.getBuilder()
42
42
  .hasFooterButton(
43
- OpaBuilder.Matchers.resourceBundle("text", "sap.fe.core", "C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE"),
43
+ OpaBuilder.Matchers.resourceBundle("text", "sap.fe.core", "C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON"),
44
44
  mState
45
45
  )
46
46
  .description(
@@ -32,6 +32,15 @@ sap.ui.define(
32
32
  * @type {string}
33
33
  * @public
34
34
  */
35
+ AllHidingDrafts: EditState.ALL_HIDING_DRAFTS.id,
36
+ /**
37
+ * All (Hiding Drafts)
38
+ *
39
+ * @name sap.fe.test.api.EditState.AllHidingDrafts
40
+ * @constant
41
+ * @type {string}
42
+ * @public
43
+ */
35
44
  Unchanged: EditState.UNCHANGED.id,
36
45
  /**
37
46
  * Own Draft
@@ -234,18 +234,28 @@ sap.ui.define(
234
234
  /**
235
235
  * Saves a variant under the given name, or overwrites the current variant.
236
236
  *
237
- * @param {string} [sVariantName] The name of the new variant. If omitted, the current variant will be overwritten.
237
+ * @param {string} [sVariantName] The name of the new variant. If no new variant name is defined, the current variant will be overwritten.
238
+ * @param {string} [bSetAsDefault] Saves the new variant with option "Set as Default".
239
+ * @param {string} [bApplyAutomatically] Saves the new variant with option "Apply Automatically".
238
240
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
239
241
  *
240
242
  * @public
241
243
  */
242
- FilterBarActions.prototype.iSaveVariant = function(sVariantName) {
244
+ FilterBarActions.prototype.iSaveVariant = function(sVariantName, bSetAsDefault, bApplyAutomatically) {
243
245
  var fnSuccessFunction = Utils.isOfType(sVariantName, String)
244
246
  ? function(oFilterBar) {
245
247
  return VMBuilder.create(this)
246
248
  .hasId(oFilterBar.getId() + "::VariantManagement")
247
- .doSaveAs(sVariantName)
248
- .description(Utils.formatMessage("Saving variant for '{0}' as '{1}'", this.getIdentifier(), sVariantName))
249
+ .doSaveAs(sVariantName, bSetAsDefault, bApplyAutomatically)
250
+ .description(
251
+ Utils.formatMessage(
252
+ "Saving variant for '{0}' as '{1}' with default='{2}' and applyAutomatically='{3}'",
253
+ this.getIdentifier(),
254
+ sVariantName,
255
+ !!bSetAsDefault,
256
+ !!bApplyAutomatically
257
+ )
258
+ )
249
259
  .execute();
250
260
  }
251
261
  : function(oFilterBar) {
@@ -263,24 +273,38 @@ sap.ui.define(
263
273
  );
264
274
  };
265
275
 
276
+ /**
277
+ * Selects the chosen variant.
278
+ *
279
+ * @param {string} sVariantName The name of the variant to be selected
280
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
281
+ *
282
+ * @public
283
+ */
284
+ FilterBarActions.prototype.iSelectVariant = function(sVariantName) {
285
+ return this.prepareResult(
286
+ this.getBuilder()
287
+ .success(
288
+ function(oFilterBar) {
289
+ return VMBuilder.create(this)
290
+ .hasId(oFilterBar.getId() + "::VariantManagement")
291
+ .doSelectVariant(sVariantName)
292
+ .description(Utils.formatMessage("Selecting variant '{1}' from '{0}'", this.getIdentifier(), sVariantName))
293
+ .execute();
294
+ }.bind(this)
295
+ )
296
+ .execute()
297
+ );
298
+ };
299
+
266
300
  FilterBarActions.prototype.iSelectVisualFilter = function(sVisualFilterIdentifier, sLabelValue, bIsSelected) {
267
301
  // var that = this;
268
302
  return this.prepareResult(
269
303
  OpaBuilder.create(this)
270
304
  .hasType("sap.fe.core.controls.filterbar.VisualFilter")
271
- .check(function(aVisualFilters) {
272
- var oVisualFilter;
273
- for (var i = 0; i < aVisualFilters.length; i++) {
274
- if (
275
- aVisualFilters[i]
276
- .getParent()
277
- .getId()
278
- .indexOf("FilterField::" + sVisualFilterIdentifier) > -1
279
- ) {
280
- oVisualFilter = aVisualFilters[i];
281
- break;
282
- }
283
- }
305
+ .hasId(new RegExp(sVisualFilterIdentifier, "i"))
306
+ .success(function(aVisualFilter) {
307
+ var oVisualFilter = aVisualFilter[0];
284
308
  var selectItem;
285
309
  var oInteractiveChart = oVisualFilter.getItems()[1].getItems()[0];
286
310
  var aItems =
@@ -309,12 +333,28 @@ sap.ui.define(
309
333
  selected: bIsSelected
310
334
  });
311
335
  }
312
- }, true)
336
+ })
313
337
  .description("Selecting an item in " + sVisualFilterIdentifier + " VisualFilter")
314
338
  .execute()
315
339
  );
316
340
  };
317
-
341
+ FilterBarActions.prototype.iOpenVisualFilterValueHelp = function(sVisualFilterIdentifier) {
342
+ return this.prepareResult(
343
+ OpaBuilder.create(this)
344
+ .hasType("sap.fe.core.controls.filterbar.VisualFilter")
345
+ .hasId(new RegExp(sVisualFilterIdentifier, "i"))
346
+ .success(function(aVisualFilter) {
347
+ var sVFId = aVisualFilter[0].getId();
348
+ OpaBuilder.create(this)
349
+ .hasType("sap.m.Button")
350
+ .hasId(sVFId + "::VisualFilterValueHelpButton")
351
+ .doPress()
352
+ .execute();
353
+ })
354
+ .description("Open ValueHelp Dialog " + sVisualFilterIdentifier + " VisualFilter")
355
+ .execute()
356
+ );
357
+ };
318
358
  return FilterBarActions;
319
359
  }
320
360
  );
@@ -270,9 +270,11 @@ sap.ui.define(
270
270
  .getItems()[0]
271
271
  .getItems()[0]
272
272
  .getContent()[1];
273
+ var sScaleUOMTitleText = sScaleUOMTitle ? sScaleUOMTitle.getText() : " | ";
273
274
  return (
274
275
  sTitle ===
275
- sMeasureDimensionTitle.getText() + (sScaleUOMTitle.getText() === " | " ? "" : sScaleUOMTitle.getText()) &&
276
+ sMeasureDimensionTitle.getText() +
277
+ (sScaleUOMTitleText === " " || sScaleUOMTitleText === " | " ? "" : sScaleUOMTitle.getText()) &&
276
278
  sToolTip === sMeasureDimensionTitle.getTooltip()
277
279
  );
278
280
  })
@@ -281,6 +283,35 @@ sap.ui.define(
281
283
  );
282
284
  };
283
285
 
286
+ FilterBarAssertions.prototype.iCheckVisualFilterValueHelp = function(sVisualFilterIdentifier, iCount) {
287
+ return this.prepareResult(
288
+ OpaBuilder.create(this)
289
+ .hasType("sap.fe.core.controls.filterbar.VisualFilter")
290
+ .check(function(aVisualFilters) {
291
+ var oVisualFilter;
292
+ for (var i = 0; i < aVisualFilters.length; i++) {
293
+ if (
294
+ aVisualFilters[i]
295
+ .getParent()
296
+ .getId()
297
+ .indexOf("FilterField::" + sVisualFilterIdentifier) > -1
298
+ ) {
299
+ oVisualFilter = aVisualFilters[i];
300
+ break;
301
+ }
302
+ }
303
+ var sValueHelp = oVisualFilter
304
+ .getItems()[0]
305
+ .getItems()[0]
306
+ .getContent()[3];
307
+ var sValueHelpCount = sValueHelp ? sValueHelp.getText() : undefined;
308
+ return sValueHelp && sValueHelpCount === iCount;
309
+ })
310
+ .description("Checking Value Help and its count of " + sVisualFilterIdentifier + " VisualFilter")
311
+ .execute()
312
+ );
313
+ };
314
+
284
315
  FilterBarAssertions.prototype.iCheckVisualFilterCriticality = function(sVisualFilterIdentifier, sLabelValue, sCriticality) {
285
316
  return this.prepareResult(
286
317
  OpaBuilder.create(this)
@@ -350,7 +381,7 @@ sap.ui.define(
350
381
  );
351
382
  };
352
383
 
353
- FilterBarAssertions.prototype.iCheckVisualFilterOverlayText = function(sVisualFilterIdentifier, sOverlayText) {
384
+ FilterBarAssertions.prototype.iCheckErrorMessageAndTitle = function(sVisualFilterIdentifier, sErrorMessage, sErrorMessageTitle) {
354
385
  return this.prepareResult(
355
386
  OpaBuilder.create(this)
356
387
  .hasType("sap.fe.core.controls.filterbar.VisualFilter")
@@ -367,11 +398,12 @@ sap.ui.define(
367
398
  break;
368
399
  }
369
400
  }
370
- var oVBox = oVisualFilter.getItems()[1].getItems()[1];
371
- var sText = oVBox.getItems()[0].getText();
372
- return sText === sOverlayText;
401
+ var oInteractiveChart = oVisualFilter.getItems()[1].getItems()[0];
402
+ var sText = oInteractiveChart.getErrorMessage();
403
+ var sTitle = oInteractiveChart.getErrorMessageTitle();
404
+ return sText === sErrorMessage && sTitle === sErrorMessageTitle;
373
405
  })
374
- .description("Checking NoData Text of " + sVisualFilterIdentifier + " VisualFilter")
406
+ .description("Checking error message and title of " + sVisualFilterIdentifier + " VisualFilter")
375
407
  .execute()
376
408
  );
377
409
  };
@@ -3,8 +3,15 @@
3
3
  * (c) Copyright 2009-2021 SAP SE. All rights reserved.
4
4
  */
5
5
  sap.ui.define(
6
- ["./FormAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/builder/FEBuilder", "sap/fe/test/builder/MacroFieldBuilder"],
7
- function(FormAPI, Utils, OpaBuilder, FEBuilder, MacroFieldBuilder) {
6
+ [
7
+ "./FormAPI",
8
+ "sap/fe/test/Utils",
9
+ "sap/ui/test/OpaBuilder",
10
+ "sap/fe/test/builder/FEBuilder",
11
+ "sap/fe/test/builder/MacroFieldBuilder",
12
+ "sap/fe/test/builder/OverflowToolbarBuilder"
13
+ ],
14
+ function(FormAPI, Utils, OpaBuilder, FEBuilder, MacroFieldBuilder, OverflowToolbarBuilder) {
8
15
  "use strict";
9
16
 
10
17
  /**
@@ -59,13 +66,30 @@ sap.ui.define(
59
66
  * @public
60
67
  */
61
68
  FormActions.prototype.iExecuteAction = function(vActionIdentifier) {
62
- var oFormBuilder = this.getBuilder();
63
- return this.prepareResult(
64
- oFormBuilder
65
- .doOnAggregation("actions", this.createActionMatcher(vActionIdentifier), OpaBuilder.Actions.press())
66
- .description(Utils.formatMessage("Pressing action '{1}' on form '{0}'", this.getIdentifier(), vActionIdentifier))
67
- .execute()
68
- );
69
+ var oFormBuilder = this.getBuilder(),
70
+ vFormDescription = this.getIdentifier(),
71
+ sFormContainerId;
72
+ if (vFormDescription.fieldGroupId === undefined) {
73
+ // Action Button in Section Header
74
+ return this.prepareResult(
75
+ oFormBuilder
76
+ .doOnAggregation("actions", this.createActionMatcher(vActionIdentifier), OpaBuilder.Actions.press())
77
+ .description(Utils.formatMessage("Pressing action '{1}' on form '{0}'", this.getIdentifier(), vActionIdentifier))
78
+ .execute()
79
+ );
80
+ } else {
81
+ // Action Button in Form Container Toolbar ("Inline Action")
82
+ sFormContainerId =
83
+ vFormDescription.fullSubSectionId.substring(0, vFormDescription.fullSubSectionId.indexOf("--")) +
84
+ "--" +
85
+ vFormDescription.fieldGroupId;
86
+ return this.prepareResult(
87
+ OverflowToolbarBuilder.create(this)
88
+ .hasId(sFormContainerId + "::FormActionsToolbar")
89
+ .doOnContent(this.createActionMatcher(vActionIdentifier))
90
+ .execute()
91
+ );
92
+ }
69
93
  };
70
94
 
71
95
  /**