@sapui5/sap.fe.test 1.92.0 → 1.93.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.fe.test",
3
- "version": "1.92.0",
3
+ "version": "1.93.3",
4
4
  "description": "SAPUI5 Library sap.fe.test",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "SAP SE (https://www.sap.com)",
@@ -19,7 +19,6 @@
19
19
  "@babel/cli": "7.8.4",
20
20
  "@ui5/cli": "^2.10.0",
21
21
  "copyfiles": "2.2.0",
22
- "xpath": "0.0.27",
23
- "yarn": "1.22.10"
22
+ "xpath": "0.0.27"
24
23
  }
25
24
  }
@@ -6,7 +6,7 @@
6
6
  <copyright>SAP UI development toolkit for HTML5 (SAPUI5)
7
7
  (c) Copyright 2009-2021 SAP SE. All rights reserved
8
8
  </copyright>
9
- <version>1.92.0</version>
9
+ <version>1.93.3</version>
10
10
 
11
11
  <documentation>UI5 library: sap.fe.test</documentation>
12
12
 
@@ -603,12 +603,12 @@ sap.ui.define(["sap/ui/test/Opa5", "sap/ui/test/OpaBuilder", "sap/ui/qunit/QUnit
603
603
  .execute();
604
604
  },
605
605
 
606
- iDoNotSeeTheVariantManagementPopover: function() {
607
- return this.iDoNotSeeTheButtonByIcon("sap-icon://duplicate", "The Popover");
606
+ iSeeTheVariantManagementPopover: function() {
607
+ return this.iSeeTheButtonByIcon("sap-icon://duplicate", "The Popover");
608
608
  },
609
609
 
610
- iDoNotSeeTheRTAPopover: function() {
611
- return this.iDoNotSeeTheButtonByIcon("sap-icon://key-user-settings", "The RTAPopover");
610
+ iSeeTheRTAPopover: function() {
611
+ return this.iSeeTheButtonByIcon("sap-icon://key-user-settings", "The RTAPopover");
612
612
  },
613
613
 
614
614
  iSeeTheRenameButton: function() {
@@ -12,6 +12,7 @@ sap.ui.define(
12
12
  "sap/fe/test/builder/MacroFieldBuilder",
13
13
  "sap/fe/test/builder/VMBuilder",
14
14
  "sap/fe/test/builder/OverflowToolbarBuilder",
15
+ "sap/fe/test/builder/KPIBuilder",
15
16
  "sap/fe/test/api/FooterActionsBase",
16
17
  "sap/fe/test/api/FooterAssertionsBase",
17
18
  "sap/fe/test/api/HeaderActionsLR",
@@ -26,6 +27,7 @@ sap.ui.define(
26
27
  FieldBuilder,
27
28
  VMBuilder,
28
29
  OverflowToolbarBuilder,
30
+ KPIBuilder,
29
31
  FooterActionsBase,
30
32
  FooterAssertionsBase,
31
33
  HeaderActionsLR,
@@ -171,6 +173,14 @@ sap.ui.define(
171
173
  .description("Pressing dialog button '" + sText + "'")
172
174
  .execute();
173
175
  },
176
+ iClickLinkWithText: function(sText) {
177
+ return OpaBuilder.create(this)
178
+ .hasType("sap.m.Link")
179
+ .hasProperties({ text: sText })
180
+ .doPress()
181
+ .description("Navigating via link '" + sText + "'")
182
+ .execute();
183
+ },
174
184
  iOpenIconTabWithTitle: function(sName) {
175
185
  return OpaBuilder.create(this)
176
186
  .hasId(IconTabBarId)
@@ -319,6 +329,22 @@ sap.ui.define(
319
329
  .description("Seeing link with text '" + sText + "'")
320
330
  .execute();
321
331
  },
332
+ iSeeQuickViewMoreLinksButton: function() {
333
+ return OpaBuilder.create(this)
334
+ .isDialogElement(true)
335
+ .hasType("sap.m.Button")
336
+ .has(OpaBuilder.Matchers.resourceBundle("text", "sap.ui.mdc", "info.POPOVER_DEFINE_LINKS"))
337
+ .description("The 'More Links' button found")
338
+ .execute();
339
+ },
340
+ iSeeFlpLink: function(sDescription) {
341
+ return OpaBuilder.create(this)
342
+ .hasType("sap.ui.mdc.link.PanelListItem")
343
+ .isDialogElement(true)
344
+ .hasProperties({ text: sDescription })
345
+ .description("FLP link with text '" + sDescription + "' is present")
346
+ .execute();
347
+ },
322
348
  iSeeHeaderPinnableToggle: function(bVisible) {
323
349
  var sState = bVisible ? "visible" : "hidden";
324
350
  return OpaBuilder.create(this)
@@ -500,6 +526,16 @@ sap.ui.define(
500
526
  Utils.formatMessage("Seeing Create dialog parameter '{0}' with value '{1}'", sFieldId, sValue)
501
527
  )
502
528
  .execute();
529
+ },
530
+ iSeeKPI: function(sTitle, oProperties) {
531
+ var sDescription = "Seeing KPI '" + sTitle + "'";
532
+ if (oProperties) {
533
+ sDescription += " with properties " + JSON.stringify(oProperties);
534
+ }
535
+ return KPIBuilder.create(this)
536
+ .checkKPI(sTitle, oProperties)
537
+ .description(sDescription)
538
+ .execute();
503
539
  }
504
540
  }
505
541
  }
@@ -76,7 +76,10 @@ sap.ui.define(
76
76
 
77
77
  if (!Utils.isOfType(vSectionIdentifier, String)) {
78
78
  if (typeof vSectionIdentifier.section === "string" && !vSectionIdentifier.subSection) {
79
- sActionId = sOPSectionIdPrefix + "::" + vSectionIdentifier.section + "-anchor";
79
+ sActionId =
80
+ vSectionIdentifier.section === "EditableHeaderSection"
81
+ ? "fe::" + vSectionIdentifier.section + "-anchor"
82
+ : sOPSectionIdPrefix + "::" + vSectionIdentifier.section + "-anchor";
80
83
  vMatcher = OpaBuilder.Matchers.children(FEBuilder.Matchers.id(new RegExp(Utils.formatMessage("{0}$", sActionId))));
81
84
  } else {
82
85
  throw new Error(
@@ -147,7 +150,6 @@ sap.ui.define(
147
150
  BreadCrumbId = ViewId + "--fe::Breadcrumbs",
148
151
  AnchorBarId = "fe::ObjectPage-anchBar",
149
152
  PaginatorId = "fe::Paginator",
150
- EditableHeaderSectionId = "fe::EditableHeaderSection",
151
153
  EditableHeaderTitleId = "EditableHeaderForm::EditableHeaderTitle",
152
154
  Page_EditMode = {
153
155
  DISPLAY: "Display",
@@ -317,6 +319,12 @@ sap.ui.define(
317
319
  * subSection: <string>
318
320
  * }
319
321
  * </pre></code>
322
+ * to open the editable header section use pattern:
323
+ * <code><pre>
324
+ * {
325
+ * section: "EditableHeaderSection"
326
+ * }
327
+ * </pre></code>
320
328
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
321
329
  *
322
330
  * @function
@@ -333,7 +341,7 @@ sap.ui.define(
333
341
  ) {
334
342
  // open sub-section via menu
335
343
  var oMenuButton = { section: vSectionIdentifier.section };
336
- oBuilder
344
+ return oBuilder
337
345
  .has(_createSectionMatcher(oMenuButton, OPSectionIdPrefix))
338
346
  .doOnChildren(
339
347
  OpaBuilder.create(this)
@@ -356,15 +364,13 @@ sap.ui.define(
356
364
  .description("Selecting section " + vSectionIdentifier.section)
357
365
  .execute();
358
366
  } else {
359
- // open simple section
360
- oBuilder
367
+ // open section by string (section label) or by object with section parameter
368
+ return oBuilder
361
369
  .has(_createSectionMatcher(vSectionIdentifier, OPSectionIdPrefix))
362
370
  .doPress()
363
- .description("Selecting section " + vSectionIdentifier)
371
+ .description("Selecting section " + (vSectionIdentifier.section || vSectionIdentifier))
364
372
  .execute();
365
373
  }
366
-
367
- return oBuilder;
368
374
  },
369
375
  /**
370
376
  * TODO This function is only here for legacy reasons and therefore private. Use iGoToSection instead.
@@ -375,27 +381,7 @@ sap.ui.define(
375
381
  * @private
376
382
  */
377
383
  iOpenSectionWithTitle: function(sName) {
378
- return OpaBuilder.create(this)
379
- .hasId(AnchorBarId)
380
- .has(
381
- OpaBuilder.Matchers.children(
382
- FEBuilder.Matchers.states({
383
- controlType: "sap.m.Button",
384
- text: sName
385
- })
386
- )
387
- )
388
- .doPress()
389
- .description("Selecting section " + sName)
390
- .execute();
391
- },
392
-
393
- iOpenEditableHeaderSection: function(sName) {
394
- return OpaBuilder.create(this)
395
- .hasId(ObjectPageLayoutId + "-anchBar-" + ViewId + "--" + EditableHeaderSectionId + "-anchor")
396
- .doPress()
397
- .description("Selecting section " + sName)
398
- .execute();
384
+ return this.iGoToSection(sName);
399
385
  },
400
386
 
401
387
  iEnterValueForFieldInEditableHeader: function(sValue) {
@@ -440,6 +426,15 @@ sap.ui.define(
440
426
  .description("Clicked on Message Button")
441
427
  .execute();
442
428
  },
429
+ iCheckMessageButtonTooltip: function(sText) {
430
+ return OpaBuilder.create(this)
431
+ .hasType("sap.fe.common.MessageButton")
432
+ .check(function(oControl) {
433
+ return oControl[0].getTooltip() === sText;
434
+ }, true)
435
+ .description("Checking tooltip of MessageButton")
436
+ .execute();
437
+ },
443
438
  iClickOnMessage: function(oMessageInfo) {
444
439
  return OpaBuilder.create(this)
445
440
  .hasType("sap.m.MessageListItem")
@@ -803,7 +798,7 @@ sap.ui.define(
803
798
  return OpaBuilder.create(this)
804
799
  .hasType("sap.m.MessageView")
805
800
  .check(function(oMessageView) {
806
- var messages = oMessageView[iMessagePosition].getItems();
801
+ var messages = oMessageView[0].getItems();
807
802
  return (
808
803
  messages[iMessagePosition].getGroupName() === oBoundMessageInfo.GroupLabel &&
809
804
  messages[iMessagePosition].getTitle() === oBoundMessageInfo.MessageText &&
@@ -836,6 +831,19 @@ sap.ui.define(
836
831
  .hasProperties({ text: sText, visible: bExpectedVisibility })
837
832
  .description("Button '" + sText + "' is " + (bExpectedVisibility ? "visible" : "NOT visible"))
838
833
  .execute();
834
+ },
835
+ iCheckFieldVisibilityInMassEditDialog: function(sFieldID, sValue) {
836
+ return OpaBuilder.create(this)
837
+ .isDialogElement()
838
+ .hasType("sap.m.ComboBox")
839
+ .check(function(aControls) {
840
+ var bControlExists = aControls.some(function(oControl) {
841
+ return oControl.getId() === sFieldID;
842
+ });
843
+ return bControlExists === sValue;
844
+ })
845
+ .description("Checking visibility of field in mass edit dialog")
846
+ .execute();
839
847
  }
840
848
  }
841
849
  }
@@ -124,7 +124,7 @@ sap.ui.define(
124
124
 
125
125
  // assertions
126
126
  /**
127
- * Shortcut for <code>&nbsp;onDialog({ type: sap.fe.test.api.DialogType.Confirmation })</code>.
127
+ * Shortcut for <code>onDialog({ type: sap.fe.test.api.DialogType.Confirmation })</code>.
128
128
  *
129
129
  * @returns {sap.fe.test.api.DialogAssertions} The available dialog assertions
130
130
  * @function
@@ -132,7 +132,7 @@ sap.ui.define(
132
132
  * @public
133
133
  */
134
134
  /**
135
- * Shortcut for <code>&nbsp;onDialog({ type: sap.fe.test.api.DialogType.ValueHelp })</code>.
135
+ * Shortcut for <code>onDialog({ type: sap.fe.test.api.DialogType.ValueHelp })</code>.
136
136
  *
137
137
  * @returns {sap.fe.test.api.DialogValueHelpAssertions} The available dialog assertions
138
138
  * @function
@@ -140,7 +140,7 @@ sap.ui.define(
140
140
  * @public
141
141
  */
142
142
  /**
143
- * Shortcut for <code>&nbsp;onDialog({ type: sap.fe.test.api.DialogType.Message })</code>.
143
+ * Shortcut for <code>onDialog({ type: sap.fe.test.api.DialogType.Message })</code>.
144
144
  *
145
145
  * @returns {sap.fe.test.api.DialogMessageAssertions} The available dialog assertions
146
146
  * @function
@@ -148,7 +148,7 @@ sap.ui.define(
148
148
  * @public
149
149
  */
150
150
  /**
151
- * Shortcut for <code>&nbsp;onDialog({ type: sap.fe.test.api.DialogType.Error })</code>.
151
+ * Shortcut for <code>onDialog({ type: sap.fe.test.api.DialogType.Error })</code>.
152
152
  *
153
153
  * @returns {sap.fe.test.api.DialogAssertions} The available dialog assertions
154
154
  * @function
@@ -156,7 +156,7 @@ sap.ui.define(
156
156
  * @public
157
157
  */
158
158
  /**
159
- * Shortcut for <code>&nbsp;onDialog({ type: sap.fe.test.api.DialogType.Action })</code>.
159
+ * Shortcut for <code>onDialog({ type: sap.fe.test.api.DialogType.Action })</code>.
160
160
  *
161
161
  * @returns {sap.fe.test.api.DialogAssertions} The available dialog assertions
162
162
  * @function
@@ -164,7 +164,7 @@ sap.ui.define(
164
164
  * @public
165
165
  */
166
166
  /**
167
- * Shortcut for <code>&nbsp;onDialog({ type: sap.fe.test.api.DialogType.Create })</code>.
167
+ * Shortcut for <code>onDialog({ type: sap.fe.test.api.DialogType.Create })</code>.
168
168
  *
169
169
  * @returns {sap.fe.test.api.DialogCreateAssertions} The available dialog assertions
170
170
  * @function
@@ -173,7 +173,7 @@ sap.ui.define(
173
173
  */
174
174
  // actions
175
175
  /**
176
- * Shortcut for <code>&nbsp;onDialog({ type: sap.fe.test.api.DialogType.Confirmation })</code>.
176
+ * Shortcut for <code>onDialog({ type: sap.fe.test.api.DialogType.Confirmation })</code>.
177
177
  *
178
178
  * @returns {sap.fe.test.api.DialogActions} The available dialog actions
179
179
  * @function
@@ -181,7 +181,7 @@ sap.ui.define(
181
181
  * @public
182
182
  */
183
183
  /**
184
- * Shortcut for <code>&nbsp;onDialog({ type: sap.fe.test.api.DialogType.ValueHelp })</code>.
184
+ * Shortcut for <code>onDialog({ type: sap.fe.test.api.DialogType.ValueHelp })</code>.
185
185
  *
186
186
  * @returns {sap.fe.test.api.DialogValueHelpActions} The available dialog actions
187
187
  * @function
@@ -189,7 +189,7 @@ sap.ui.define(
189
189
  * @public
190
190
  */
191
191
  /**
192
- * Shortcut for <code>&nbsp;onDialog({ type: sap.fe.test.api.DialogType.Message })</code>.
192
+ * Shortcut for <code>onDialog({ type: sap.fe.test.api.DialogType.Message })</code>.
193
193
  *
194
194
  * @returns {sap.fe.test.api.DialogMessageActions} The available dialog actions
195
195
  * @function
@@ -197,7 +197,7 @@ sap.ui.define(
197
197
  * @public
198
198
  */
199
199
  /**
200
- * Shortcut for <code>&nbsp;onDialog({ type: sap.fe.test.api.DialogType.Error })</code>.
200
+ * Shortcut for <code>onDialog({ type: sap.fe.test.api.DialogType.Error })</code>.
201
201
  *
202
202
  * @returns {sap.fe.test.api.DialogActions} The available dialog actions
203
203
  * @function
@@ -205,7 +205,7 @@ sap.ui.define(
205
205
  * @public
206
206
  */
207
207
  /**
208
- * Shortcut for <code>&nbsp;onDialog({ type: sap.fe.test.api.DialogType.Action })</code>.
208
+ * Shortcut for <code>onDialog({ type: sap.fe.test.api.DialogType.Action })</code>.
209
209
  *
210
210
  * @returns {sap.fe.test.api.DialogActions} The available dialog actions
211
211
  * @function
@@ -213,7 +213,7 @@ sap.ui.define(
213
213
  * @public
214
214
  */
215
215
  /**
216
- * Shortcut for <code>&nbsp;onDialog({ type: sap.fe.test.api.DialogType.Create })</code>.
216
+ * Shortcut for <code>onDialog({ type: sap.fe.test.api.DialogType.Create })</code>.
217
217
  *
218
218
  * @returns {sap.fe.test.api.DialogCreateActions} The available dialog actions
219
219
  * @function
@@ -43,7 +43,7 @@ sap.ui.define(["sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/build
43
43
  .isDialogElement()
44
44
  .hasType("sap.m.Button")
45
45
  .hasProperties({ icon: "sap-icon://email" })
46
- .has(OpaBuilder.Matchers.resourceBundle("text", "sap.fe.macros", "T_SEMANTIC_CONTROL_SEND_EMAIL"));
46
+ .has(OpaBuilder.Matchers.resourceBundle("text", "sap.fe.core", "T_SEMANTIC_CONTROL_SEND_EMAIL"));
47
47
  },
48
48
 
49
49
  createSendEmailCheckBuilder: function(mState) {
@@ -291,6 +291,9 @@ sap.ui.define(
291
291
  selectItem = oItem;
292
292
  }
293
293
  });
294
+ if (!selectItem) {
295
+ selectItem = aItems[0];
296
+ }
294
297
  if (oInteractiveChart.isA("sap.suite.ui.microchart.InteractiveLineChart")) {
295
298
  var aPoints = oInteractiveChart.getSelectedPoints();
296
299
  return oInteractiveChart.fireSelectionChanged({
@@ -141,7 +141,7 @@ sap.ui.define(
141
141
  FormActions.prototype.iChangeField = function(vFieldIdentifier, sValue) {
142
142
  return this.prepareResult(
143
143
  this.createFieldBuilder(vFieldIdentifier)
144
- .doEnterText(sValue)
144
+ .doEnterText(sValue, true, false, true)
145
145
  .description(
146
146
  Utils.formatMessage(
147
147
  "Entering value '{1}' into field '{2}' on form '{0}'",
@@ -10,9 +10,10 @@ sap.ui.define(
10
10
  "sap/fe/test/builder/MdcTableBuilder",
11
11
  "sap/fe/test/builder/DialogBuilder",
12
12
  "sap/ui/test/OpaBuilder",
13
- "sap/ui/test/actions/Action"
13
+ "sap/ui/test/actions/Action",
14
+ "sap/ui/core/SortOrder"
14
15
  ],
15
- function(BaseAPI, Utils, FEBuilder, TableBuilder, DialogBuilder, OpaBuilder, Action) {
16
+ function(BaseAPI, Utils, FEBuilder, TableBuilder, DialogBuilder, OpaBuilder, Action, SortOrder) {
16
17
  "use strict";
17
18
 
18
19
  /**
@@ -181,7 +182,7 @@ sap.ui.define(
181
182
  };
182
183
 
183
184
  /**
184
- * Helper method to personalize table. If no actions are given, this function can be used for checking only.
185
+ * Helper method to personalize table, either adapt columns or filter. If no actions are given, this function can be used for checking only.
185
186
  * During execution it checks for an already open dialog. If it does not exist, it is opened before
186
187
  * the check/interaction of the columns, and closed/confirmed directly afterwards.
187
188
  *
@@ -273,7 +274,128 @@ sap.ui.define(
273
274
  .execute()
274
275
  );
275
276
  };
277
+ /**
278
+ * Helper method to adapt the sorting of a table. If no actions are given, this function can be used for checking only.
279
+ * During execution it checks for an already open dialog. If it does not exist, it is opened before
280
+ * the check/interaction of the columns, and closed/confirmed directly afterwards.
281
+ *
282
+ * @param {string | sap.fe.test.api.ColumnIdentifier} vColumnIdentifier The field identifier
283
+ * @param {object} [mState] The state of the personalization field. The following states are supported:
284
+ * <code><pre>
285
+ * {
286
+ * sortOrder: SortOrder.Ascending|SortOrder.Descending|SortOrder.None
287
+ * }
288
+ * </pre></code>
289
+ * @param {Function|Array|sap.ui.test.actions.Action} [vActions] The actions to be executed on found field
290
+ * @param {string} sDescription The description of the check or adaptation
291
+ * @param {sap.ui.test.OpaBuilder} oDialogBuilder The dialog builder
292
+ * @param {Function} fnOpenDialog A callback for opening the dialog
293
+ * @param {Function} fnCloseDialog A callback for closing the dialog
294
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
295
+ *
296
+ * @ui5-restricted
297
+ */
298
+ TableAPI.prototype.sortingPersonalization = function(
299
+ vColumnIdentifier,
300
+ mState,
301
+ vActions,
302
+ sDescription,
303
+ oDialogBuilder,
304
+ fnOpenDialog,
305
+ fnCloseDialog
306
+ ) {
307
+ var aArguments = Utils.parseArguments(
308
+ [[String, Object], Object, [Function, Array, Action], String, OpaBuilder, Function, Function],
309
+ arguments
310
+ ),
311
+ oBuilder = FEBuilder.create(this.getOpaInstance()),
312
+ bDialogOpen,
313
+ oAdaptColumnBuilder = FEBuilder.create(this.getOpaInstance())
314
+ .hasType("sap.m.CustomListItem")
315
+ .isDialogElement(),
316
+ oNoneColumnMatcher = OpaBuilder.Matchers.childrenMatcher(
317
+ OpaBuilder.create()
318
+ .hasType("sap.m.Select")
319
+ .hasProperties({ selectedKey: "$_none" })
320
+ ),
321
+ oTargetColumnMatcher;
322
+
323
+ oDialogBuilder = aArguments[4];
324
+ fnOpenDialog = aArguments[5];
325
+ fnCloseDialog = aArguments[6];
326
+
327
+ vColumnIdentifier = aArguments[0];
328
+ if (Utils.isOfType(vColumnIdentifier, String)) {
329
+ oTargetColumnMatcher = OpaBuilder.Matchers.childrenMatcher(
330
+ OpaBuilder.create(this.getOpaInstance())
331
+ .hasType("sap.m.Select")
332
+ .has(function(oSelectControl) {
333
+ return oSelectControl.getSelectedItem().getText() === vColumnIdentifier;
334
+ })
335
+ );
336
+ } else {
337
+ oTargetColumnMatcher = OpaBuilder.Matchers.childrenMatcher(
338
+ OpaBuilder.create(this.getOpaInstance())
339
+ .hasType("sap.m.Select")
340
+ .hasProperties({ selectedKey: vColumnIdentifier.name })
341
+ );
342
+ }
276
343
 
344
+ oDialogBuilder
345
+ .has(OpaBuilder.Matchers.children(oAdaptColumnBuilder))
346
+ .has(function(aCustomListItems) {
347
+ var aMatchingListItems = OpaBuilder.Matchers.filter(oTargetColumnMatcher)(aCustomListItems);
348
+ if (aMatchingListItems.length) {
349
+ return aMatchingListItems;
350
+ }
351
+ return OpaBuilder.Matchers.filter(oNoneColumnMatcher)(aCustomListItems);
352
+ })
353
+ .has(function(aFoundAdaptationColumns) {
354
+ if (bCheckForNotVisible) {
355
+ return aFoundAdaptationColumns.length === 0;
356
+ }
357
+ return FEBuilder.Matchers.atIndex(0)(aFoundAdaptationColumns);
358
+ });
359
+
360
+ mState = aArguments[1];
361
+ var bCheckForNotVisible = mState && mState.visible === false;
362
+ if (!bCheckForNotVisible && !Utils.isOfType(mState, [null, undefined])) {
363
+ if (mState.sortOrder) {
364
+ var sSortOrder = mState.sortOrder;
365
+ delete mState.sortOrder;
366
+ oDialogBuilder.hasChildren(
367
+ OpaBuilder.create()
368
+ .hasType("sap.m.SegmentedButton")
369
+ .has(function(oSegmentedButton) {
370
+ if (sSortOrder === SortOrder.None) {
371
+ return !oSegmentedButton.enabled;
372
+ }
373
+ return oSegmentedButton.getSelectedKey() === (sSortOrder === SortOrder.Ascending ? "asc" : "desc");
374
+ })
375
+ );
376
+ }
377
+ //oDialogBuilder.hasState(mState);
378
+ }
379
+
380
+ vActions = aArguments[2];
381
+ if (!Utils.isOfType(vActions, [null, undefined])) {
382
+ oDialogBuilder.do(vActions);
383
+ }
384
+
385
+ sDescription = aArguments[3];
386
+ return this.prepareResult(
387
+ oBuilder
388
+ .success(function() {
389
+ bDialogOpen = FEBuilder.controlsExist(oDialogBuilder);
390
+ if (!bDialogOpen) {
391
+ fnOpenDialog();
392
+ oDialogBuilder.success(fnCloseDialog);
393
+ }
394
+ return oDialogBuilder.description(sDescription).execute();
395
+ })
396
+ .execute()
397
+ );
398
+ };
277
399
  /**
278
400
  * Helper method to adapt columns fields. If no actions are given, this function can be used for checking only.
279
401
  * During execution it checks for an already open adaptation dialog. If it does not exist, it is opened before
@@ -313,7 +435,7 @@ sap.ui.define(
313
435
  * @ui5-restricted
314
436
  */
315
437
  TableAPI.prototype.columnSorting = function(vColumnIdentifier, mState, vActions, sDescription) {
316
- return this.personalization(
438
+ return this.sortingPersonalization(
317
439
  vColumnIdentifier,
318
440
  mState,
319
441
  vActions,
@@ -704,46 +704,48 @@ sap.ui.define(
704
704
  Actions.prototype.iChangeSortOrder = function(vColumnIdentifier, sSortOrder) {
705
705
  var oOpaInstance = this.getOpaInstance(),
706
706
  aActions = [],
707
- oMdcResourceBundle = Core.getLibraryResourceBundle("sap.ui.mdc"),
708
- fnSortOrderAction = function(oColumnListItem) {
707
+ fnSelectSortingColumnAction = function(oColumnListItem) {
709
708
  var oChildBuilder = OpaBuilder.create(oOpaInstance).hasType("sap.m.Select"),
710
- vControls = OpaBuilder.Matchers.children(oChildBuilder)(oColumnListItem);
711
- // this function is not used in case of sSortOrder === SortOrder.None, so this case isn't handled
712
- return OpaBuilder.Actions.executor(
713
- OpaBuilder.Actions.enterText(
714
- sSortOrder === SortOrder.Ascending
715
- ? oMdcResourceBundle.getText("sort.PERSONALIZATION_DIALOG_OPTION_ASCENDING")
716
- : oMdcResourceBundle.getText("sort.PERSONALIZATION_DIALOG_OPTION_DESCENDING")
717
- )
718
- )(vControls);
709
+ vControls = OpaBuilder.Matchers.children(oChildBuilder)(oColumnListItem),
710
+ fnFindItem = Utils.isOfType(vColumnIdentifier, String)
711
+ ? function(oItem) {
712
+ return oItem.getText() === vColumnIdentifier;
713
+ }
714
+ : function(oItem) {
715
+ return oItem.getKey() === vColumnIdentifier.name;
716
+ };
717
+
718
+ return OpaBuilder.Actions.executor(function(oSelectControl) {
719
+ var oItemToSelect = oSelectControl.getItems().find(fnFindItem);
720
+ if (!oItemToSelect) {
721
+ throw Error(Utils.formatMessage("can not find sort item '{0}'", vColumnIdentifier));
722
+ }
723
+ oSelectControl.setSelectedItem(oItemToSelect);
724
+ // not the recommended way - but seems to do?!
725
+ oSelectControl.fireChange({ selectedItem: oItemToSelect });
726
+ })(vControls);
727
+ },
728
+ fnSelectSortOrderAction = function(oColumnListItem) {
729
+ var sIcon =
730
+ sSortOrder === SortOrder.None
731
+ ? "sap-icon://decline"
732
+ : "sap-icon://sort-" + (sSortOrder === SortOrder.Ascending ? "ascending" : "descending"),
733
+ oTargetButtonMatcher = OpaBuilder.create(oOpaInstance)
734
+ .hasType("sap.m.Button")
735
+ .hasProperties({ icon: sIcon });
736
+ var vControl = OpaBuilder.Matchers.children(oTargetButtonMatcher)(oColumnListItem);
737
+ return OpaBuilder.Actions.executor(OpaBuilder.Actions.press())(vControl);
719
738
  };
739
+
720
740
  sSortOrder = sSortOrder || SortOrder.Ascending;
721
741
  switch (sSortOrder) {
722
742
  case SortOrder.Ascending:
723
- aActions.push(
724
- OpaBuilder.Actions.conditional(
725
- OpaBuilder.Matchers.properties({ selected: false }),
726
- OpaBuilder.Actions.press("selectMulti")
727
- )
728
- );
729
- aActions.push(fnSortOrderAction);
730
- break;
731
743
  case SortOrder.Descending:
732
- aActions.push(
733
- OpaBuilder.Actions.conditional(
734
- OpaBuilder.Matchers.properties({ selected: false }),
735
- OpaBuilder.Actions.press("selectMulti")
736
- )
737
- );
738
- aActions.push(fnSortOrderAction);
744
+ aActions.push(fnSelectSortingColumnAction);
745
+ aActions.push(fnSelectSortOrderAction);
739
746
  break;
740
747
  case SortOrder.None:
741
- aActions.push(
742
- OpaBuilder.Actions.conditional(
743
- OpaBuilder.Matchers.properties({ selected: true }),
744
- OpaBuilder.Actions.press("selectMulti")
745
- )
746
- );
748
+ aActions.push(fnSelectSortOrderAction);
747
749
  break;
748
750
  default:
749
751
  throw new Error("unhandled switch case: " + sSortOrder);
@@ -382,7 +382,9 @@ sap.ui.define(
382
382
  * @public
383
383
  */
384
384
  TableAssertions.prototype.iCheckColumnSorting = function() {
385
- return this._iCheckTableProvidedAction("ColumnSorting");
385
+ this.iOpenColumnSorting();
386
+ TableBuilder.createSortingDialogBuilder(this.getOpaInstance()).execute();
387
+ return this.iConfirmColumnSorting();
386
388
  };
387
389
 
388
390
  /**
@@ -393,7 +395,10 @@ sap.ui.define(
393
395
  * @public
394
396
  */
395
397
  TableAssertions.prototype.iCheckColumnFiltering = function() {
396
- return this._iCheckTableProvidedAction("ColumnFiltering");
398
+ this.iOpenFilterDialog();
399
+ TableBuilder.createFilteringDialogBuilder(this.getOpaInstance()).execute();
400
+ return this.iConfirmFilterDialog();
401
+ // return this._iCheckTableProvidedAction("ColumnAdaptation");
397
402
  };
398
403
 
399
404
  /**
@@ -495,12 +500,7 @@ sap.ui.define(
495
500
  // either check via sorting dialog...
496
501
  if (bCheckPersonalization) {
497
502
  var mState = {};
498
- if (sSortOrder === SortOrder.None) {
499
- mState.selected = false;
500
- } else {
501
- mState.selected = true;
502
- mState.content = { selectedKey: sSortOrder === SortOrder.Descending ? "true" : "false" };
503
- }
503
+ mState.sortOrder = sSortOrder;
504
504
  return this.columnSorting(vColumnIdentifier, mState, undefined, sDescription);
505
505
  }
506
506
 
@@ -0,0 +1,55 @@
1
+ /*
2
+ * ! SAPUI5
3
+ * (c) Copyright 2009-2021 SAP SE. All rights reserved.
4
+ */
5
+ sap.ui.define(["./FEBuilder", "sap/ui/test/OpaBuilder", "sap/fe/test/Utils"], function(FEBuilder, OpaBuilder, Utils) {
6
+ "use strict";
7
+
8
+ var KPIBuilder = function() {
9
+ return FEBuilder.apply(this, arguments);
10
+ };
11
+
12
+ KPIBuilder.create = function(oOpaInstance) {
13
+ return new KPIBuilder(oOpaInstance);
14
+ };
15
+
16
+ KPIBuilder.prototype = Object.create(FEBuilder.prototype);
17
+ KPIBuilder.prototype.constructor = KPIBuilder;
18
+
19
+ /**
20
+ * Checks if a KPI exists with a given label and other optional properties.
21
+ *
22
+ * @param {string} sKPILabel The label of the new variant
23
+ * @param {object} oKPIProperties Additional optional properties on the KPI (status, number, or unit)
24
+ * @returns {sap.fe.test.builder.KPIBuilder} This instance
25
+ * @public
26
+ * @ui5-restricted
27
+ */
28
+ KPIBuilder.prototype.checkKPI = function(sKPILabel, oKPIProperties) {
29
+ var oTagProperties = { text: sKPILabel };
30
+
31
+ if (oKPIProperties && oKPIProperties.status) {
32
+ oTagProperties.status = oKPIProperties.status;
33
+ }
34
+
35
+ var retValue = this.hasType("sap.m.GenericTag").hasProperties(oTagProperties);
36
+
37
+ if (oKPIProperties && (oKPIProperties.number || oKPIProperties.unit)) {
38
+ var oNumberProperties = {};
39
+ if (oKPIProperties.number) {
40
+ oNumberProperties.number = oKPIProperties.number;
41
+ }
42
+ if (oKPIProperties.unit) {
43
+ oNumberProperties.unit = oKPIProperties.unit;
44
+ }
45
+ retValue = retValue.hasChildren(
46
+ FEBuilder.create(this)
47
+ .hasType("sap.m.ObjectNumber")
48
+ .hasProperties(oNumberProperties)
49
+ );
50
+ }
51
+ return retValue;
52
+ };
53
+
54
+ return KPIBuilder;
55
+ });
@@ -571,11 +571,24 @@ sap.ui.define(
571
571
  };
572
572
 
573
573
  TableBuilder.prototype.hasColumnSorting = function() {
574
- return _createTableInternalButtonBuilder(this, "sort", false);
574
+ return _createTableInternalButtonBuilder(this, "settings", false);
575
575
  };
576
576
 
577
577
  TableBuilder.prototype.doOpenColumnSorting = function() {
578
- return _createTableInternalButtonBuilder(this, "sort", OpaBuilder.Actions.press());
578
+ return _createTableInternalButtonBuilder(this, "settings", OpaBuilder.Actions.press()).success(
579
+ OpaBuilder.create(this.getOpaInstance())
580
+ .isDialogElement()
581
+ .hasType("sap.m.IconTabBar")
582
+ .has(
583
+ OpaBuilder.Matchers.aggregation(
584
+ "items",
585
+ OpaBuilder.Matchers.resourceBundle("text", "sap.ui.mdc", "p13nDialog.TAB_Sort")
586
+ )
587
+ )
588
+ .has(FEBuilder.Matchers.singleElement())
589
+ .doPress()
590
+ .description("Selecting Icon Tab Sort")
591
+ );
579
592
  };
580
593
 
581
594
  TableBuilder.prototype.hasColumnFiltering = function() {
@@ -583,7 +596,20 @@ sap.ui.define(
583
596
  };
584
597
 
585
598
  TableBuilder.prototype.doOpenColumnFiltering = function() {
586
- return _createTableInternalButtonBuilder(this, "filter", OpaBuilder.Actions.press());
599
+ return _createTableInternalButtonBuilder(this, "settings", OpaBuilder.Actions.press()).success(
600
+ OpaBuilder.create(this.getOpaInstance())
601
+ .isDialogElement()
602
+ .hasType("sap.m.IconTabBar")
603
+ .has(
604
+ OpaBuilder.Matchers.aggregation(
605
+ "items",
606
+ OpaBuilder.Matchers.resourceBundle("text", "sap.ui.mdc", "p13nDialog.TAB_Filter")
607
+ )
608
+ )
609
+ .has(FEBuilder.Matchers.singleElement())
610
+ .doPress()
611
+ .description("Selecting Icon Tab Filter")
612
+ );
587
613
  };
588
614
 
589
615
  TableBuilder.prototype.hasColumnExport = function() {
@@ -603,18 +629,28 @@ sap.ui.define(
603
629
  TableBuilder.createAdaptationDialogBuilder = function(oOpaInstance) {
604
630
  return DialogBuilder.create(oOpaInstance).hasSome(
605
631
  OpaBuilder.Matchers.resourceBundle("title", "sap.ui.mdc", "table.SETTINGS_COLUMN"),
606
- OpaBuilder.Matchers.resourceBundle("title", "sap.ui.mdc", "p13nDialog.VIEW_SETTINGS") // new adaptation dialog title (sap-ui-xx-mdcTableP13n=true or for RTA)
632
+ OpaBuilder.Matchers.resourceBundle("title", "sap.ui.mdc", "p13nDialog.VIEW_SETTINGS")
607
633
  );
608
634
  };
609
635
 
610
636
  TableBuilder.createSortingDialogBuilder = function(oOpaInstance) {
611
- return DialogBuilder.create(oOpaInstance).has(OpaBuilder.Matchers.resourceBundle("title", "sap.ui.mdc", "table.SETTINGS_SORT"));
637
+ return DialogBuilder.create(oOpaInstance)
638
+ .has(OpaBuilder.Matchers.resourceBundle("title", "sap.ui.mdc", "p13nDialog.VIEW_SETTINGS"))
639
+ .hasChildren(
640
+ OpaBuilder.create(oOpaInstance)
641
+ .hasType("sap.m.IconTabFilter")
642
+ .has(OpaBuilder.Matchers.resourceBundle("text", "sap.ui.mdc", "p13nDialog.TAB_Sort"))
643
+ );
612
644
  };
613
645
 
614
646
  TableBuilder.createFilteringDialogBuilder = function(oOpaInstance) {
615
- return DialogBuilder.create(oOpaInstance).has(
616
- OpaBuilder.Matchers.resourceBundle("title", "sap.ui.mdc", "filter.PERSONALIZATION_DIALOG_TITLE")
617
- );
647
+ return DialogBuilder.create(oOpaInstance)
648
+ .has(OpaBuilder.Matchers.resourceBundle("title", "sap.ui.mdc", "p13nDialog.VIEW_SETTINGS"))
649
+ .hasChildren(
650
+ OpaBuilder.create(oOpaInstance)
651
+ .hasType("sap.m.IconTabFilter")
652
+ .has(OpaBuilder.Matchers.resourceBundle("text", "sap.ui.mdc", "p13nDialog.TAB_Filter"))
653
+ );
618
654
  };
619
655
 
620
656
  TableBuilder.Cell = {
@@ -835,6 +871,21 @@ sap.ui.define(
835
871
  ? oCellControl.getContentDisplay()
836
872
  : oCellControl.getContentEdit()[0];
837
873
  }
874
+ if (oCellControl.isA("sap.m.VBox")) {
875
+ oCellControl =
876
+ oCellControl
877
+ .getItems()[0]
878
+ .getContent()
879
+ .getEditMode() === "Display"
880
+ ? oCellControl
881
+ .getItems()[0]
882
+ .getContent()
883
+ .getContentDisplay()
884
+ : oCellControl
885
+ .getItems()[0]
886
+ .getContent()
887
+ .getContentEdit()[0];
888
+ }
838
889
  if (oCellControl.isA("sap.fe.core.controls.ConditionalWrapper")) {
839
890
  oCellControl = oCellControl.getCondition() ? oCellControl.getContentTrue() : oCellControl.getContentFalse();
840
891
  }
@@ -17,7 +17,9 @@ sap.ui.define(["sap/fe/test/JourneyRunner", "sap/fe/test/Utils", "./FEArrangemen
17
17
 
18
18
  var DEFAULT_RUNNER = new FERunner({
19
19
  launchUrl: "test-resources/sap/fe/templates/internal/demokit/flpSandbox.html",
20
- launchParameters: {},
20
+ launchParameters: {
21
+ "sap-ui-xx-mdcTableP13n": true
22
+ },
21
23
  opaConfig: {
22
24
  frameWidth: 1300,
23
25
  frameHeight: 1024
@@ -25,7 +27,9 @@ sap.ui.define(["sap/fe/test/JourneyRunner", "sap/fe/test/Utils", "./FEArrangemen
25
27
  });
26
28
  var WIDE_RUNNER = new FERunner({
27
29
  launchUrl: "test-resources/sap/fe/templates/internal/demokit/flpSandbox.html",
28
- launchParameters: {},
30
+ launchParameters: {
31
+ "sap-ui-xx-mdcTableP13n": true
32
+ },
29
33
  opaConfig: {
30
34
  frameWidth: 1700,
31
35
  frameHeight: 1024
@@ -33,7 +37,9 @@ sap.ui.define(["sap/fe/test/JourneyRunner", "sap/fe/test/Utils", "./FEArrangemen
33
37
  });
34
38
  var FCL_RUNNER = new FERunner({
35
39
  launchUrl: "test-resources/sap/fe/templates/internal/demokit/flpSandbox.html",
36
- launchParameters: {},
40
+ launchParameters: {
41
+ "sap-ui-xx-mdcTableP13n": true
42
+ },
37
43
  opaConfig: {
38
44
  frameWidth: 1900,
39
45
  frameHeight: 1440
@@ -27,7 +27,7 @@ sap.ui.define(
27
27
  interfaces: [],
28
28
  controls: [],
29
29
  elements: [],
30
- version: "1.92.0",
30
+ version: "1.93.3",
31
31
  noLibraryCSS: true
32
32
  });
33
33
 
@@ -8,7 +8,7 @@ sap.ui.define(
8
8
  "use strict";
9
9
 
10
10
  var MassEditRuntime = {
11
- handleMassEditChange: function(oSource, value) {
11
+ handleMassEditChange: function(oSource, value, bValidationCase) {
12
12
  var oDialog =
13
13
  oSource &&
14
14
  oSource
@@ -20,6 +20,20 @@ sap.ui.define(
20
20
  keyValue: oSource.getId().substring(oSource.getId().lastIndexOf(":") + 1),
21
21
  value: value
22
22
  };
23
+ if (!value && bValidationCase) {
24
+ // var oSourceControl = sap.ui.getCore().byId(sUnitId);
25
+ oSource.setValueState("Error");
26
+ oSource.setValueStateText("Please enter a value");
27
+ oDataObject = {
28
+ control: oSource,
29
+ valueState: "Error",
30
+ valueStateText: "Please enter a value",
31
+ validationError: true
32
+ };
33
+ } else {
34
+ oSource.setValueState("None");
35
+ oSource.setValueStateText(null);
36
+ }
23
37
  oFieldsInfoData.results.push(oDataObject);
24
38
  }
25
39
  };