@sapui5/sap.fe.test 1.100.0 → 1.102.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 (31) hide show
  1. package/package.json +2 -3
  2. package/src/sap/fe/test/.library +1 -1
  3. package/src/sap/fe/test/BaseArrangements.js +65 -18
  4. package/src/sap/fe/test/CollaborationClient.js +77 -0
  5. package/src/sap/fe/test/CollaborationClient.ts +105 -0
  6. package/src/sap/fe/test/FeMocks.js +3 -3
  7. package/src/sap/fe/test/FeMocks.ts +10 -6
  8. package/src/sap/fe/test/FlexibleColumnLayout.js +148 -141
  9. package/src/sap/fe/test/JestTemplatingHelper.js +31 -10
  10. package/src/sap/fe/test/JestTemplatingHelper.ts +62 -48
  11. package/src/sap/fe/test/ListReport.js +72 -77
  12. package/src/sap/fe/test/LocationUtil.js +12 -16
  13. package/src/sap/fe/test/ObjectPage.js +116 -124
  14. package/src/sap/fe/test/Shell.js +94 -34
  15. package/src/sap/fe/test/TemplatePage.js +49 -27
  16. package/src/sap/fe/test/UI5MockHelper.js +100 -20
  17. package/src/sap/fe/test/UI5MockHelper.ts +79 -14
  18. package/src/sap/fe/test/api/APIHelper.js +26 -15
  19. package/src/sap/fe/test/api/CollaborationAPI.js +215 -0
  20. package/src/sap/fe/test/api/CollaborationAPI.ts +240 -0
  21. package/src/sap/fe/test/api/DialogActions.js +3 -1
  22. package/src/sap/fe/test/api/DialogMessageActions.js +78 -64
  23. package/src/sap/fe/test/api/HeaderActions.js +229 -226
  24. package/src/sap/fe/test/api/HeaderAssertions.js +76 -41
  25. package/src/sap/fe/test/api/TableAPI.js +30 -34
  26. package/src/sap/fe/test/api/TableActions.js +58 -70
  27. package/src/sap/fe/test/api/TableAssertions.js +51 -46
  28. package/src/sap/fe/test/builder/MacroFieldBuilder.js +161 -153
  29. package/src/sap/fe/test/builder/MdcTableBuilder.js +247 -191
  30. package/src/sap/fe/test/library.js +26 -35
  31. package/src/sap/fe/test/library.ts +28 -0
@@ -16,7 +16,7 @@ sap.ui.define(
16
16
  "sap/fe/test/builder/MdcFilterFieldBuilder",
17
17
  "./APIHelper"
18
18
  ],
19
- function(TableAPI, Utils, OpaBuilder, FEBuilder, Interactable, VMBuilder, SortOrder, Core, FilterFieldBuilder, APIHelper) {
19
+ function (TableAPI, Utils, OpaBuilder, FEBuilder, Interactable, VMBuilder, SortOrder, Core, FilterFieldBuilder, APIHelper) {
20
20
  "use strict";
21
21
 
22
22
  /**
@@ -31,7 +31,7 @@ sap.ui.define(
31
31
  * @hideconstructor
32
32
  * @public
33
33
  */
34
- var Actions = function(oBuilderInstance, vTableDescription) {
34
+ var Actions = function (oBuilderInstance, vTableDescription) {
35
35
  return TableAPI.call(this, oBuilderInstance, vTableDescription);
36
36
  };
37
37
  Actions.prototype = Object.create(TableAPI.prototype);
@@ -53,7 +53,7 @@ sap.ui.define(
53
53
  *
54
54
  * @public
55
55
  */
56
- Actions.prototype.iPressCell = function(mRowValues, vColumn) {
56
+ Actions.prototype.iPressCell = function (mRowValues, vColumn) {
57
57
  var oTableBuilder = this.getBuilder();
58
58
  return this.prepareResult(
59
59
  oTableBuilder
@@ -87,7 +87,7 @@ sap.ui.define(
87
87
  *
88
88
  * @public
89
89
  */
90
- Actions.prototype.iSelectRows = function(vRowValues, mState) {
90
+ Actions.prototype.iSelectRows = function (vRowValues, mState) {
91
91
  var aArguments = Utils.parseArguments([[Object, Number], Object], arguments),
92
92
  oTableBuilder = this.getBuilder();
93
93
  return this.prepareResult(
@@ -112,7 +112,7 @@ sap.ui.define(
112
112
  *
113
113
  * @public
114
114
  */
115
- Actions.prototype.iSelectAllRows = function() {
115
+ Actions.prototype.iSelectAllRows = function () {
116
116
  var oTableBuilder = this.getBuilder();
117
117
  return this.prepareResult(
118
118
  oTableBuilder
@@ -136,7 +136,7 @@ sap.ui.define(
136
136
  *
137
137
  * @public
138
138
  */
139
- Actions.prototype.iPressRow = function(vRowValues) {
139
+ Actions.prototype.iPressRow = function (vRowValues) {
140
140
  var oTableBuilder = this.getBuilder();
141
141
  return this.prepareResult(
142
142
  oTableBuilder
@@ -156,7 +156,7 @@ sap.ui.define(
156
156
  *
157
157
  * @public
158
158
  */
159
- Actions.prototype.iExpandGroupRow = function(iLevel, sTitle) {
159
+ Actions.prototype.iExpandGroupRow = function (iLevel, sTitle) {
160
160
  var oTableBuilder = this.getBuilder();
161
161
  return this.prepareResult(
162
162
  oTableBuilder
@@ -176,7 +176,7 @@ sap.ui.define(
176
176
  *
177
177
  * @public
178
178
  */
179
- Actions.prototype.iCollapseGroupRow = function(iLevel, sTitle) {
179
+ Actions.prototype.iCollapseGroupRow = function (iLevel, sTitle) {
180
180
  var oTableBuilder = this.getBuilder();
181
181
  return this.prepareResult(
182
182
  oTableBuilder
@@ -195,7 +195,7 @@ sap.ui.define(
195
195
  *
196
196
  * @ui5-restricted
197
197
  */
198
- Actions.prototype.iScroll = function(sDirection) {
198
+ Actions.prototype.iScroll = function (sDirection) {
199
199
  var oTableBuilder = this.getBuilder();
200
200
  return this.prepareResult(
201
201
  oTableBuilder
@@ -213,14 +213,10 @@ sap.ui.define(
213
213
  *
214
214
  * @ui5-restricted
215
215
  */
216
- Actions.prototype.iPressMore = function() {
216
+ Actions.prototype.iPressMore = function () {
217
217
  var oTableBuilder = this.getBuilder();
218
218
  return this.prepareResult(
219
- oTableBuilder
220
- .checkNumberOfMatches(1)
221
- .doPressMore()
222
- .description(Utils.formatMessage("Press more"))
223
- .execute()
219
+ oTableBuilder.checkNumberOfMatches(1).doPressMore().description(Utils.formatMessage("Press more")).execute()
224
220
  );
225
221
  };
226
222
 
@@ -238,11 +234,12 @@ sap.ui.define(
238
234
  * </pre></code>
239
235
  * Alternatively, the 0-based row index can be used.
240
236
  * @param {object} mTargetValues A map of columns (either name or index) to its new value. The columns do not need to match the ones defined in <code>vRowValues</code>.
237
+ * @param {boolean} bInputNotFinalized If true, we keep the focus on the modified cell and don't press enter to validate the input
241
238
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
242
239
  *
243
240
  * @public
244
241
  */
245
- Actions.prototype.iChangeRow = function(vRowValues, mTargetValues) {
242
+ Actions.prototype.iChangeRow = function (vRowValues, mTargetValues, bInputNotFinalized) {
246
243
  var oTableBuilder = this.getBuilder(),
247
244
  bIsCreationRow = false;
248
245
 
@@ -252,9 +249,11 @@ sap.ui.define(
252
249
  }
253
250
 
254
251
  if (!bIsCreationRow) {
255
- oTableBuilder.checkNumberOfMatches(1).doEditValues(TableAPI.createRowMatchers(vRowValues), mTargetValues);
252
+ oTableBuilder
253
+ .checkNumberOfMatches(1)
254
+ .doEditValues(TableAPI.createRowMatchers(vRowValues), mTargetValues, bInputNotFinalized);
256
255
  } else {
257
- oTableBuilder.checkNumberOfMatches(1).doEditCreationRowValues(mTargetValues);
256
+ oTableBuilder.checkNumberOfMatches(1).doEditCreationRowValues(mTargetValues, bInputNotFinalized);
258
257
  }
259
258
 
260
259
  return this.prepareResult(
@@ -279,7 +278,7 @@ sap.ui.define(
279
278
  *
280
279
  * @public
281
280
  */
282
- Actions.prototype.iExecuteAction = function(vActionIdentifier) {
281
+ Actions.prototype.iExecuteAction = function (vActionIdentifier) {
283
282
  var aArguments = Utils.parseArguments([[Object, String]], arguments),
284
283
  oTableBuilder = this.getBuilder();
285
284
 
@@ -299,7 +298,7 @@ sap.ui.define(
299
298
  *
300
299
  * @public
301
300
  */
302
- Actions.prototype.iExecuteMenuAction = function(vAction) {
301
+ Actions.prototype.iExecuteMenuAction = function (vAction) {
303
302
  return this.prepareResult(APIHelper.createMenuActionExecutorBuilder(vAction).execute());
304
303
  };
305
304
 
@@ -311,7 +310,7 @@ sap.ui.define(
311
310
  *
312
311
  * @public
313
312
  */
314
- Actions.prototype.iExecuteShowHideDetails = function(bShowDetails) {
313
+ Actions.prototype.iExecuteShowHideDetails = function (bShowDetails) {
315
314
  var oTableBuilder = this.getBuilder();
316
315
  return this.prepareResult(
317
316
  oTableBuilder
@@ -334,7 +333,7 @@ sap.ui.define(
334
333
  *
335
334
  * @public
336
335
  */
337
- Actions.prototype.iExecuteDelete = function() {
336
+ Actions.prototype.iExecuteDelete = function () {
338
337
  var oTableBuilder = this.getBuilder(),
339
338
  sDeleteId = "::StandardAction::Delete";
340
339
 
@@ -360,7 +359,7 @@ sap.ui.define(
360
359
  *
361
360
  * @public
362
361
  */
363
- Actions.prototype.iSelectQuickFilterItem = function(vItemIdentifier) {
362
+ Actions.prototype.iSelectQuickFilterItem = function (vItemIdentifier) {
364
363
  var oPropertyMatcher;
365
364
  if (Utils.isOfType(vItemIdentifier, String)) {
366
365
  oPropertyMatcher = { text: vItemIdentifier };
@@ -388,7 +387,7 @@ sap.ui.define(
388
387
  *
389
388
  * @public
390
389
  */
391
- Actions.prototype.iExecuteCreate = function() {
390
+ Actions.prototype.iExecuteCreate = function () {
392
391
  var oTableBuilder = this.getBuilder(),
393
392
  sCreateId = "::StandardAction::Create";
394
393
 
@@ -407,7 +406,7 @@ sap.ui.define(
407
406
  *
408
407
  * @public
409
408
  */
410
- Actions.prototype.iExecuteFullScreen = function() {
409
+ Actions.prototype.iExecuteFullScreen = function () {
411
410
  var oTableBuilder = this.getBuilder(),
412
411
  sFullScreenId = "::StandardAction::FullScreen";
413
412
 
@@ -426,7 +425,7 @@ sap.ui.define(
426
425
  *
427
426
  * @public
428
427
  */
429
- Actions.prototype.iExecuteInlineCreate = function() {
428
+ Actions.prototype.iExecuteInlineCreate = function () {
430
429
  var oTableBuilder = this.getBuilder();
431
430
 
432
431
  return this.prepareResult(
@@ -458,7 +457,7 @@ sap.ui.define(
458
457
  *
459
458
  * @public
460
459
  */
461
- Actions.prototype.iExecuteInlineAction = function(vRowValues, vColumn) {
460
+ Actions.prototype.iExecuteInlineAction = function (vRowValues, vColumn) {
462
461
  var aArguments = Utils.parseArguments(
463
462
  [
464
463
  [Object, Number],
@@ -503,7 +502,7 @@ sap.ui.define(
503
502
  *
504
503
  * @public
505
504
  */
506
- Actions.prototype.iExecuteKeyboardShortcut = function(sShortcut, vRowValues, vColumn) {
505
+ Actions.prototype.iExecuteKeyboardShortcut = function (sShortcut, vRowValues, vColumn) {
507
506
  return this.prepareResult(
508
507
  this.getBuilder()
509
508
  .doPressKeyboardShortcut(sShortcut, vRowValues, vColumn)
@@ -530,16 +529,16 @@ sap.ui.define(
530
529
  *
531
530
  * @public
532
531
  */
533
- Actions.prototype.iSaveVariant = function(sVariantName) {
532
+ Actions.prototype.iSaveVariant = function (sVariantName) {
534
533
  var fnSuccessFunction = Utils.isOfType(sVariantName, String)
535
- ? function(oTable) {
534
+ ? function (oTable) {
536
535
  return VMBuilder.create(this)
537
536
  .hasId(oTable.getId ? oTable.getId() + "::VM" : oTable[0].getId() + "::VM")
538
537
  .doSaveAs(sVariantName)
539
538
  .description(Utils.formatMessage("Saving variant for '{0}' as '{1}'", this.getIdentifier(), sVariantName))
540
539
  .execute();
541
540
  }
542
- : function(oTable) {
541
+ : function (oTable) {
543
542
  return VMBuilder.create(this)
544
543
  .hasId(oTable.getId ? oTable.getId() + "::VM" : oTable[0].getId() + "::VM")
545
544
  .doSave()
@@ -547,11 +546,7 @@ sap.ui.define(
547
546
  .execute();
548
547
  };
549
548
 
550
- return this.prepareResult(
551
- this.getBuilder()
552
- .success(fnSuccessFunction.bind(this))
553
- .execute()
554
- );
549
+ return this.prepareResult(this.getBuilder().success(fnSuccessFunction.bind(this)).execute());
555
550
  };
556
551
 
557
552
  /**
@@ -562,11 +557,11 @@ sap.ui.define(
562
557
  *
563
558
  * @public
564
559
  */
565
- Actions.prototype.iRemoveVariant = function(sVariantName) {
560
+ Actions.prototype.iRemoveVariant = function (sVariantName) {
566
561
  return this.prepareResult(
567
562
  this.getBuilder()
568
563
  .success(
569
- function(oTable) {
564
+ function (oTable) {
570
565
  return VMBuilder.create(this)
571
566
  .hasId(oTable.getId() + "::VM")
572
567
  .doRemoveVariant(sVariantName)
@@ -586,11 +581,11 @@ sap.ui.define(
586
581
  *
587
582
  * @public
588
583
  */
589
- Actions.prototype.iSelectVariant = function(sVariantName) {
584
+ Actions.prototype.iSelectVariant = function (sVariantName) {
590
585
  return this.prepareResult(
591
586
  this.getBuilder()
592
587
  .success(
593
- function(oTable) {
588
+ function (oTable) {
594
589
  return VMBuilder.create(this)
595
590
  .hasId(oTable.getId() + "::VM")
596
591
  .doSelectVariant(sVariantName)
@@ -610,11 +605,11 @@ sap.ui.define(
610
605
  *
611
606
  * @public
612
607
  */
613
- Actions.prototype.iSetDefaultVariant = function(sVariantName) {
608
+ Actions.prototype.iSetDefaultVariant = function (sVariantName) {
614
609
  return this.prepareResult(
615
610
  this.getBuilder()
616
611
  .success(
617
- function(oTable) {
612
+ function (oTable) {
618
613
  return sVariantName
619
614
  ? VMBuilder.create(this)
620
615
  .hasId(oTable.getId ? oTable.getId() + "::VM" : oTable[0].getId() + "::VM")
@@ -648,7 +643,7 @@ sap.ui.define(
648
643
  *
649
644
  * @public
650
645
  */
651
- Actions.prototype.iAddAdaptationColumn = function(vColumnIdentifier) {
646
+ Actions.prototype.iAddAdaptationColumn = function (vColumnIdentifier) {
652
647
  return this.columnAdaptation(
653
648
  vColumnIdentifier,
654
649
  { selected: false },
@@ -665,7 +660,7 @@ sap.ui.define(
665
660
  *
666
661
  * @public
667
662
  */
668
- Actions.prototype.iRemoveAdaptationColumn = function(vColumnIdentifier) {
663
+ Actions.prototype.iRemoveAdaptationColumn = function (vColumnIdentifier) {
669
664
  return this.columnAdaptation(
670
665
  vColumnIdentifier,
671
666
  { selected: true },
@@ -683,21 +678,21 @@ sap.ui.define(
683
678
  *
684
679
  * @public
685
680
  */
686
- Actions.prototype.iChangeSortOrder = function(vColumnIdentifier, sSortOrder) {
681
+ Actions.prototype.iChangeSortOrder = function (vColumnIdentifier, sSortOrder) {
687
682
  var oOpaInstance = this.getOpaInstance(),
688
683
  aActions = [],
689
- fnSelectSortingColumnAction = function(oColumnListItem) {
690
- var oChildBuilder = OpaBuilder.create(oOpaInstance).hasType("sap.m.Select"),
684
+ fnSelectSortingColumnAction = function (oColumnListItem) {
685
+ var oChildBuilder = OpaBuilder.create(oOpaInstance).hasType("sap.m.ComboBox"),
691
686
  vControls = OpaBuilder.Matchers.children(oChildBuilder)(oColumnListItem),
692
687
  fnFindItem = Utils.isOfType(vColumnIdentifier, String)
693
- ? function(oItem) {
688
+ ? function (oItem) {
694
689
  return oItem.getText() === vColumnIdentifier;
695
690
  }
696
- : function(oItem) {
691
+ : function (oItem) {
697
692
  return oItem.getKey() === vColumnIdentifier.name;
698
693
  };
699
694
 
700
- return OpaBuilder.Actions.executor(function(oSelectControl) {
695
+ return OpaBuilder.Actions.executor(function (oSelectControl) {
701
696
  var oItemToSelect = oSelectControl.getItems().find(fnFindItem);
702
697
  if (!oItemToSelect) {
703
698
  throw Error(Utils.formatMessage("can not find sort item '{0}'", vColumnIdentifier));
@@ -707,14 +702,12 @@ sap.ui.define(
707
702
  oSelectControl.fireChange({ selectedItem: oItemToSelect });
708
703
  })(vControls);
709
704
  },
710
- fnSelectSortOrderAction = function(oColumnListItem) {
705
+ fnSelectSortOrderAction = function (oColumnListItem) {
711
706
  var sIcon =
712
707
  sSortOrder === SortOrder.None
713
708
  ? "sap-icon://decline"
714
709
  : "sap-icon://sort-" + (sSortOrder === SortOrder.Ascending ? "ascending" : "descending"),
715
- oTargetButtonMatcher = OpaBuilder.create(oOpaInstance)
716
- .hasType("sap.m.Button")
717
- .hasProperties({ icon: sIcon });
710
+ oTargetButtonMatcher = OpaBuilder.create(oOpaInstance).hasType("sap.m.Button").hasProperties({ icon: sIcon });
718
711
  var vControl = OpaBuilder.Matchers.children(oTargetButtonMatcher)(oColumnListItem);
719
712
  return OpaBuilder.Actions.executor(OpaBuilder.Actions.press())(vControl);
720
713
  };
@@ -748,7 +741,7 @@ sap.ui.define(
748
741
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
749
742
  * @public
750
743
  */
751
- Actions.prototype.iSortByColumn = function(vColumnIdentifier, sFieldLabel, bDescending) {
744
+ Actions.prototype.iSortByColumn = function (vColumnIdentifier, sFieldLabel, bDescending) {
752
745
  var oTableBuilder = this.getBuilder(),
753
746
  vColumn = Utils.isOfType(vColumnIdentifier, Object) ? vColumnIdentifier.name : vColumnIdentifier;
754
747
  return this.prepareResult(
@@ -775,7 +768,7 @@ sap.ui.define(
775
768
  *
776
769
  * @public
777
770
  */
778
- Actions.prototype.iGroupByColumn = function(vColumnIdentifier, sFieldLabel) {
771
+ Actions.prototype.iGroupByColumn = function (vColumnIdentifier, sFieldLabel) {
779
772
  var oTableBuilder = this.getBuilder(),
780
773
  vColumn = Utils.isOfType(vColumnIdentifier, Object) ? vColumnIdentifier.name : vColumnIdentifier;
781
774
  return this.prepareResult(
@@ -802,7 +795,7 @@ sap.ui.define(
802
795
  *
803
796
  * @public
804
797
  */
805
- Actions.prototype.iAggregateByColumn = function(vColumnIdentifier, sFieldLabel) {
798
+ Actions.prototype.iAggregateByColumn = function (vColumnIdentifier, sFieldLabel) {
806
799
  var oTableBuilder = this.getBuilder(),
807
800
  vColumn = Utils.isOfType(vColumnIdentifier, Object) ? vColumnIdentifier.name : vColumnIdentifier;
808
801
  return this.prepareResult(
@@ -828,7 +821,7 @@ sap.ui.define(
828
821
  *
829
822
  * @public
830
823
  */
831
- Actions.prototype.iChangeSearchField = function(sSearchText) {
824
+ Actions.prototype.iChangeSearchField = function (sSearchText) {
832
825
  return this.prepareResult(
833
826
  this.getBuilder()
834
827
  .doChangeSearch(sSearchText)
@@ -846,7 +839,7 @@ sap.ui.define(
846
839
  *
847
840
  * @public
848
841
  */
849
- Actions.prototype.iResetSearchField = function() {
842
+ Actions.prototype.iResetSearchField = function () {
850
843
  return this.prepareResult(
851
844
  this.getBuilder()
852
845
  .doResetSearch()
@@ -865,7 +858,7 @@ sap.ui.define(
865
858
  *
866
859
  * @public
867
860
  */
868
- Actions.prototype.iChangeFilterField = function(vColumnIdentifier, vValue, bClearFirst) {
861
+ Actions.prototype.iChangeFilterField = function (vColumnIdentifier, vValue, bClearFirst) {
869
862
  var oFilterFieldBuilder = FilterFieldBuilder.create(this.getOpaInstance())
870
863
  .isDialogElement()
871
864
  .hasType("sap.ui.mdc.FilterField")
@@ -888,16 +881,13 @@ sap.ui.define(
888
881
 
889
882
  return this.prepareResult(
890
883
  FEBuilder.create(this.getOpaInstance())
891
- .success(function() {
884
+ .success(function () {
892
885
  bDialogOpen = FEBuilder.controlsExist(oFilterFieldBuilder);
893
886
  if (!bDialogOpen) {
894
887
  fnOpenDialog();
895
888
  oFilterFieldBuilder.success(fnCloseDialog);
896
889
  }
897
- return oFilterFieldBuilder
898
- .doChangeValue(vValue, bClearFirst)
899
- .description(sDescription)
900
- .execute();
890
+ return oFilterFieldBuilder.doChangeValue(vValue, bClearFirst).description(sDescription).execute();
901
891
  })
902
892
  .execute()
903
893
  );
@@ -911,7 +901,7 @@ sap.ui.define(
911
901
  *
912
902
  * @public
913
903
  */
914
- Actions.prototype.iPasteData = function(aData) {
904
+ Actions.prototype.iPasteData = function (aData) {
915
905
  return this.prepareResult(
916
906
  this.getBuilder()
917
907
  .doPasteData(aData)
@@ -928,10 +918,8 @@ sap.ui.define(
928
918
  * @public
929
919
  * @ui5-restricted
930
920
  */
931
- Actions.prototype.iClickOnMessageStripFilter = function() {
932
- return this.getBuilder()
933
- .doClickOnMessageStripFilter()
934
- .execute();
921
+ Actions.prototype.iClickOnMessageStripFilter = function () {
922
+ return this.getBuilder().doClickOnMessageStripFilter().execute();
935
923
  };
936
924
 
937
925
  return Actions;