@sapui5/sap.fe.test 1.99.0 → 1.101.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.
@@ -3,21 +3,21 @@
3
3
  (c) Copyright 2009-2021 SAP SE. All rights reserved
4
4
 
5
5
  */
6
- sap.ui.define(["sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/builder/FEBuilder"], function(Utils, OpaBuilder, FEBuilder) {
6
+ sap.ui.define(["sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/builder/FEBuilder"], function (Utils, OpaBuilder, FEBuilder) {
7
7
  "use strict";
8
8
 
9
9
  var APIHelper = {
10
- createSaveAsTileBuilder: function() {
10
+ createSaveAsTileBuilder: function () {
11
11
  return new FEBuilder().isDialogElement().hasType("sap.ushell.ui.footerbar.AddBookmarkButton");
12
12
  },
13
13
 
14
- createSaveAsTileCheckBuilder: function(mState) {
14
+ createSaveAsTileCheckBuilder: function (mState) {
15
15
  return APIHelper.createSaveAsTileBuilder()
16
16
  .hasState(mState)
17
17
  .description(Utils.formatMessage("Checking 'Save as Tile' action in state '{0}'", mState));
18
18
  },
19
19
 
20
- createSaveAsTileExecutorBuilder: function(sBookmarkTitle) {
20
+ createSaveAsTileExecutorBuilder: function (sBookmarkTitle) {
21
21
  return APIHelper.createSaveAsTileBuilder()
22
22
  .doPress()
23
23
  .description("Executing 'Save as Tile' action")
@@ -39,7 +39,7 @@ sap.ui.define(["sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/build
39
39
  );
40
40
  },
41
41
 
42
- createSendEmailBuilder: function() {
42
+ createSendEmailBuilder: function () {
43
43
  return new FEBuilder()
44
44
  .isDialogElement()
45
45
  .hasType("sap.m.Button")
@@ -47,19 +47,17 @@ sap.ui.define(["sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/build
47
47
  .has(OpaBuilder.Matchers.resourceBundle("text", "sap.fe.core", "T_SEMANTIC_CONTROL_SEND_EMAIL"));
48
48
  },
49
49
 
50
- createSendEmailCheckBuilder: function(mState) {
50
+ createSendEmailCheckBuilder: function (mState) {
51
51
  return APIHelper.createSendEmailBuilder()
52
52
  .hasState(mState)
53
53
  .description(Utils.formatMessage("Checking 'Send Email' action in state '{0}'", mState));
54
54
  },
55
55
 
56
- createSendEmailExecutorBuilder: function() {
57
- return APIHelper.createSendEmailBuilder()
58
- .doPress()
59
- .description("Executing 'Send Email' action");
56
+ createSendEmailExecutorBuilder: function () {
57
+ return APIHelper.createSendEmailBuilder().doPress().description("Executing 'Send Email' action");
60
58
  },
61
59
 
62
- createMenuActionMatcher: function(vAction, bReturnAction) {
60
+ createMenuAndListActionMatcher: function (vAction, bReturnAction) {
63
61
  var vActionMatcher;
64
62
  if (Utils.isOfType(vAction, String)) {
65
63
  vAction = { text: vAction };
@@ -87,7 +85,7 @@ sap.ui.define(["sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/build
87
85
  return vActionMatcher;
88
86
  },
89
87
 
90
- createMenuActionExecutorBuilder: function(vAction) {
88
+ createMenuActionExecutorBuilder: function (vAction) {
91
89
  if (!vAction) {
92
90
  throw new Error("vAction parameter missing");
93
91
  }
@@ -95,12 +93,12 @@ sap.ui.define(["sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/build
95
93
  return FEBuilder.create()
96
94
  .hasType("sap.ui.unified.Menu")
97
95
  .isDialogElement(true)
98
- .has(APIHelper.createMenuActionMatcher(vAction, true))
96
+ .has(APIHelper.createMenuAndListActionMatcher(vAction, true))
99
97
  .doPress()
100
98
  .description(Utils.formatMessage("Executing action '{0}' from currently open action menu", vAction));
101
99
  },
102
100
 
103
- createMenuActionCheckBuilder: function(vAction) {
101
+ createMenuActionCheckBuilder: function (vAction) {
104
102
  if (!vAction) {
105
103
  throw new Error("vAction parameter missing");
106
104
  }
@@ -108,8 +106,21 @@ sap.ui.define(["sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/build
108
106
  return FEBuilder.create()
109
107
  .hasType("sap.ui.unified.Menu")
110
108
  .isDialogElement(true)
111
- .has(APIHelper.createMenuActionMatcher(vAction))
109
+ .has(APIHelper.createMenuAndListActionMatcher(vAction))
112
110
  .description(Utils.formatMessage("Checking currently open action menu having action '{0}'", vAction));
111
+ },
112
+
113
+ createSelectListActionExecutorBuilder: function (vAction) {
114
+ if (!vAction) {
115
+ throw new Error("vAction parameter missing");
116
+ }
117
+
118
+ return FEBuilder.create()
119
+ .hasType("sap.m.SelectList")
120
+ .isDialogElement(true)
121
+ .has(APIHelper.createMenuAndListActionMatcher(vAction, true))
122
+ .doPress()
123
+ .description(Utils.formatMessage("Executing action '{0}' from currently open selection list", vAction));
113
124
  }
114
125
  };
115
126
 
@@ -100,11 +100,13 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"], fu
100
100
  /**
101
101
  * Changes the content of a field in an action parameter dialog.
102
102
  *
103
+ * Deprecated: Please use dialog action iChangeDialogField.
104
+ *
103
105
  * @param {sap.fe.test.api.ActionDialogFieldIdentifier} vFieldIdentifier The identifier of the field
104
106
  * @param {string} [vValue] The new target value.
105
107
  * @param {boolean} [bClearFirst] Set to <code>true</code> to clear previously set filters, otherwise all previously set values will be kept
106
108
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
107
- * @public
109
+ * @ui5-restricted
108
110
  */
109
111
  DialogActions.prototype.iChangeActionParameterDialogField = function(vFieldIdentifier, vValue, bClearFirst) {
110
112
  return this.iChangeDialogField(vFieldIdentifier, vValue, bClearFirst);
@@ -3,72 +3,86 @@
3
3
  (c) Copyright 2009-2021 SAP SE. All rights reserved
4
4
 
5
5
  */
6
- sap.ui.define(["./DialogActions", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"], function(DialogActions, Utils, OpaBuilder) {
7
- "use strict";
6
+ sap.ui.define(
7
+ ["./DialogActions", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/builder/FEBuilder"],
8
+ function (DialogActions, Utils, OpaBuilder, FEBuilder) {
9
+ "use strict";
8
10
 
9
- /**
10
- * Constructs a new DialogMessageActions instance.
11
- *
12
- * @param {sap.fe.test.builder.DialogBuilder} oDialogBuilder The {@link sap.fe.test.builder.DialogBuilder} instance used to interact with the UI
13
- * @param {string} [vDialogDescription] Description (optional) of the dialog to be used for logging messages
14
- * @returns {sap.fe.test.api.DialogMessageActions} The new instance
15
- * @extends sap.fe.test.api.DialogActions
16
- * @alias sap.fe.test.api.DialogMessageActions
17
- * @class
18
- * @hideconstructor
19
- * @public
20
- */
21
- var DialogMessageActions = function(oDialogBuilder, vDialogDescription) {
22
- return DialogActions.call(this, oDialogBuilder, vDialogDescription, 0);
23
- };
24
- DialogMessageActions.prototype = Object.create(DialogActions.prototype);
25
- DialogMessageActions.prototype.constructor = DialogMessageActions;
26
- DialogMessageActions.prototype.isAction = true;
11
+ /**
12
+ * Constructs a new DialogMessageActions instance.
13
+ *
14
+ * @param {sap.fe.test.builder.DialogBuilder} oDialogBuilder The {@link sap.fe.test.builder.DialogBuilder} instance used to interact with the UI
15
+ * @param {string} [vDialogDescription] Description (optional) of the dialog to be used for logging messages
16
+ * @returns {sap.fe.test.api.DialogMessageActions} The new instance
17
+ * @extends sap.fe.test.api.DialogActions
18
+ * @alias sap.fe.test.api.DialogMessageActions
19
+ * @class
20
+ * @hideconstructor
21
+ * @public
22
+ */
23
+ var DialogMessageActions = function (oDialogBuilder, vDialogDescription) {
24
+ return DialogActions.call(this, oDialogBuilder, vDialogDescription, 0);
25
+ };
26
+ DialogMessageActions.prototype = Object.create(DialogActions.prototype);
27
+ DialogMessageActions.prototype.constructor = DialogMessageActions;
28
+ DialogMessageActions.prototype.isAction = true;
27
29
 
28
- /**
29
- * Executes the <code>Back</code> action on the message dialog.
30
- *
31
- * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
32
- * @public
33
- */
34
- DialogMessageActions.prototype.iExecuteBack = function() {
35
- return this.prepareResult(
36
- this.getBuilder()
37
- .doPressHeaderButton(OpaBuilder.Matchers.properties({ icon: "sap-icon://nav-back" }))
38
- .description(Utils.formatMessage("Pressing back button on dialog '{0}'", this.getIdentifier()))
39
- .execute()
40
- );
41
- };
30
+ /**
31
+ * Executes the <code>Back</code> action on the message dialog.
32
+ *
33
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
34
+ * @public
35
+ */
36
+ DialogMessageActions.prototype.iExecuteBack = function () {
37
+ return this.prepareResult(
38
+ this.getBuilder()
39
+ .doPressHeaderButton(OpaBuilder.Matchers.properties({ icon: "sap-icon://nav-back" }))
40
+ .description(Utils.formatMessage("Pressing back button on dialog '{0}'", this.getIdentifier()))
41
+ .execute()
42
+ );
43
+ };
42
44
 
43
- /**
44
- * Executes the <code>Refresh</code> action on the message dialog.
45
- *
46
- * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
47
- * @public
48
- */
49
- DialogMessageActions.prototype.iExecuteRefresh = function() {
50
- return this.prepareResult(
51
- this.getBuilder()
52
- .doPressFooterButton(OpaBuilder.Matchers.resourceBundle("text", "sap.fe.core", "C_COMMON_SAPFE_REFRESH"))
53
- .description(Utils.formatMessage("Pressing refresh button on dialog '{0}'", this.getIdentifier()))
54
- .execute()
55
- );
56
- };
45
+ /**
46
+ * Executes the <code>Refresh</code> action on the message dialog.
47
+ *
48
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
49
+ * @public
50
+ */
51
+ DialogMessageActions.prototype.iExecuteRefresh = function () {
52
+ return this.prepareResult(
53
+ this.getBuilder()
54
+ .doPressFooterButton(OpaBuilder.Matchers.resourceBundle("text", "sap.fe.core", "C_COMMON_SAPFE_REFRESH"))
55
+ .description(Utils.formatMessage("Pressing refresh button on dialog '{0}'", this.getIdentifier()))
56
+ .execute()
57
+ );
58
+ };
57
59
 
58
- /**
59
- * Confirms the draft message with Discard Draft when navigating back to the list-report.
60
- *
61
- * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
62
- * @public
63
- */
64
- DialogMessageActions.prototype.iConfirmDiscardDraft = function() {
65
- return this.prepareResult(
66
- this.getBuilder()
67
- .doPressFooterButton(this._getConfirmDiscardDraftButtonMatcher())
68
- .description(Utils.formatMessage("Confirming dialog '{0}' with Discard Draft", this.getIdentifier()))
69
- .execute()
70
- );
71
- };
60
+ /**
61
+ * Selects the specified entry in the draft data loss popup
62
+ *
63
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
64
+ * @public
65
+ */
66
+ DialogMessageActions.prototype.iSelectDraftDataLossOption = function (optionKey) {
67
+ // The logic below uses customData for identifying the entry in list in the dialog
68
+ // which needs to be pressed
69
+ // The dialog's XML fragment for the custom data and the used keys
70
+ return this.prepareResult(
71
+ FEBuilder.create()
72
+ .hasType("sap.m.List")
73
+ .isDialogElement(true)
74
+ .has(OpaBuilder.Matchers.aggregation("items"))
75
+ .has(function (oItem) {
76
+ return oItem.find(function (element) {
77
+ return element.data("itemKey") === optionKey;
78
+ });
79
+ })
80
+ .doPress()
81
+ .description("Selecting option with key {0} in draft data loss popup")
82
+ .execute()
83
+ );
84
+ };
72
85
 
73
- return DialogMessageActions;
74
- });
86
+ return DialogMessageActions;
87
+ }
88
+ );
@@ -151,7 +151,15 @@ sap.ui.define(
151
151
  }
152
152
 
153
153
  mState = aArguments[1];
154
- var bCheckForNotVisible = mState && mState.visible === false;
154
+ if (mState.visible !== undefined) {
155
+ mState.exists = mState.visible;
156
+ delete mState.visible;
157
+ }
158
+ if (mState.selected !== undefined) {
159
+ mState.visible = mState.selected;
160
+ delete mState.selected;
161
+ }
162
+ var bCheckForNotVisible = mState && mState.exists === false;
155
163
  if (!bCheckForNotVisible && !Utils.isOfType(mState, [null, undefined])) {
156
164
  oAdaptColumnBuilder.has(OpaBuilder.Matchers.bindingProperties(BaseAPI.MDC_P13N_MODEL, mState));
157
165
  }