@sapui5/sap.fe.test 1.93.3 → 1.96.2

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 (33) hide show
  1. package/package.json +2 -2
  2. package/src/sap/fe/test/.library +1 -1
  3. package/src/sap/fe/test/Flexibility.js +33 -8
  4. package/src/sap/fe/test/JestTemplatingHelper.js +32 -7
  5. package/src/sap/fe/test/JestTemplatingHelper.ts +23 -6
  6. package/src/sap/fe/test/ListReport.js +20 -3
  7. package/src/sap/fe/test/ObjectPage.js +52 -0
  8. package/src/sap/fe/test/Shell.js +16 -11
  9. package/src/sap/fe/test/TemplatePage.js +48 -0
  10. package/src/sap/fe/test/UI5MockHelper.js +218 -0
  11. package/src/sap/fe/test/UI5MockHelper.ts +137 -0
  12. package/src/sap/fe/test/Utils.js +5 -1
  13. package/src/sap/fe/test/api/BaseAPI.js +10 -0
  14. package/src/sap/fe/test/api/ChartActions.js +11 -0
  15. package/src/sap/fe/test/api/ChartAssertions.js +35 -7
  16. package/src/sap/fe/test/api/DialogAPI.js +82 -37
  17. package/src/sap/fe/test/api/DialogActions.js +27 -0
  18. package/src/sap/fe/test/api/DialogAssertions.js +33 -0
  19. package/src/sap/fe/test/api/DialogCreateActions.js +3 -1
  20. package/src/sap/fe/test/api/DialogCreateAssertions.js +1 -1
  21. package/src/sap/fe/test/api/FilterBarActions.js +21 -15
  22. package/src/sap/fe/test/api/FilterBarAssertions.js +38 -6
  23. package/src/sap/fe/test/api/FormActions.js +33 -9
  24. package/src/sap/fe/test/api/HeaderAssertions.js +29 -12
  25. package/src/sap/fe/test/api/KPICardAPI.js +28 -0
  26. package/src/sap/fe/test/api/KPICardAssertions.js +204 -0
  27. package/src/sap/fe/test/api/TableActions.js +49 -0
  28. package/src/sap/fe/test/api/TableAssertions.js +27 -0
  29. package/src/sap/fe/test/builder/KPIBuilder.js +60 -4
  30. package/src/sap/fe/test/builder/MacroFieldBuilder.js +2 -0
  31. package/src/sap/fe/test/builder/MdcTableBuilder.js +63 -0
  32. package/src/sap/fe/test/library.js +1 -1
  33. package/src/sap/fe/test/massEdit.js +33 -16
@@ -17,15 +17,15 @@ sap.ui.define(["./FEBuilder", "sap/ui/test/OpaBuilder", "sap/fe/test/Utils"], fu
17
17
  KPIBuilder.prototype.constructor = KPIBuilder;
18
18
 
19
19
  /**
20
- * Checks if a KPI exists with a given label and other optional properties.
20
+ * Checks if a KPI tag exists with a given label and other optional properties.
21
21
  *
22
- * @param {string} sKPILabel The label of the new variant
22
+ * @param {string} sKPILabel The label of the KPI
23
23
  * @param {object} oKPIProperties Additional optional properties on the KPI (status, number, or unit)
24
24
  * @returns {sap.fe.test.builder.KPIBuilder} This instance
25
- * @public
25
+ * @private
26
26
  * @ui5-restricted
27
27
  */
28
- KPIBuilder.prototype.checkKPI = function(sKPILabel, oKPIProperties) {
28
+ KPIBuilder.prototype.checkKPITag = function(sKPILabel, oKPIProperties) {
29
29
  var oTagProperties = { text: sKPILabel };
30
30
 
31
31
  if (oKPIProperties && oKPIProperties.status) {
@@ -51,5 +51,61 @@ sap.ui.define(["./FEBuilder", "sap/ui/test/OpaBuilder", "sap/fe/test/Utils"], fu
51
51
  return retValue;
52
52
  };
53
53
 
54
+ /**
55
+ * Clicks on a KPI tag to open the card.
56
+ *
57
+ * @param {string} sKPILabel The label of the KPI
58
+ * @returns {sap.fe.test.builder.KPIBuilder} This instance
59
+ * @private
60
+ */
61
+ KPIBuilder.prototype.clickKPITag = function(sKPILabel) {
62
+ var oTagProperties = { text: sKPILabel };
63
+
64
+ return this.hasType("sap.m.GenericTag")
65
+ .hasProperties(oTagProperties)
66
+ .doPress();
67
+ };
68
+
69
+ /**
70
+ * Checks if a KPI Card is displayed.
71
+ *
72
+ * @returns {sap.fe.test.builder.KPIBuilder} This instance
73
+ * @private
74
+ */
75
+ KPIBuilder.prototype.checkKPICard = function() {
76
+ return this.hasType("sap.m.Popover").hasChildren(FEBuilder.create(this).hasType("sap.ui.integration.widgets.Card"));
77
+ };
78
+
79
+ /**
80
+ * Applies a matcher to the card header content.
81
+ *
82
+ * @param {sap.ui.test.matchers.Matcher} vMatcher The matcher to filter child items
83
+ * @param {boolean} bDirectChild Specifies if the matcher shoould be applied onlmy to direct children or all descendants
84
+ * @returns {sap.fe.test.builder.KPIBuilder} This instance
85
+ */
86
+ KPIBuilder.prototype.doOnKPICardHeader = function(vMatcher, bDirectChild) {
87
+ return this.hasType("sap.ui.integration.widgets.Card").hasChildren(
88
+ FEBuilder.create(this)
89
+ .hasType("sap.ui.integration.cards.NumericHeader")
90
+ .hasChildren(vMatcher, bDirectChild)
91
+ );
92
+ };
93
+
94
+ /**
95
+ * Applies a matcher to the card chart.
96
+ *
97
+ * @param {sap.ui.test.matchers.Matcher} vMatcher The matcher to be applied to the chart
98
+ * @returns {sap.fe.test.builder.KPIBuilder} This instance
99
+ */
100
+ KPIBuilder.prototype.doOnKPICardChart = function(vMatcher) {
101
+ var analyticalContentMatcher = vMatcher
102
+ ? FEBuilder.create(this)
103
+ .hasType("sap.ui.integration.cards.AnalyticalContent")
104
+ .hasChildren(vMatcher)
105
+ : FEBuilder.create(this).hasType("sap.ui.integration.cards.AnalyticalContent");
106
+
107
+ return this.hasType("sap.ui.integration.widgets.Card").hasChildren(analyticalContentMatcher);
108
+ };
109
+
54
110
  return KPIBuilder;
55
111
  });
@@ -63,6 +63,7 @@ sap.ui.define(["./FEBuilder", "./MdcFieldBuilder", "sap/ui/test/OpaBuilder", "sa
63
63
 
64
64
  return oContent.isA("sap.ui.mdc.Field") ||
65
65
  oContent.isA("sap.m.Text") ||
66
+ oContent.isA("sap.m.ExpandableText") ||
66
67
  oContent.isA("sap.m.Label") ||
67
68
  oContent.isA("sap.m.CheckBox") ||
68
69
  oContent.isA("sap.m.Link") ||
@@ -78,6 +79,7 @@ sap.ui.define(["./FEBuilder", "./MdcFieldBuilder", "sap/ui/test/OpaBuilder", "sa
78
79
  OpaBuilder.create().hasSome(
79
80
  FEBuilder.Matchers.state("controlType", "sap.ui.mdc.Field"),
80
81
  FEBuilder.Matchers.state("controlType", "sap.m.Text"),
82
+ FEBuilder.Matchers.state("controlType", "sap.m.ExpandableText"),
81
83
  FEBuilder.Matchers.state("controlType", "sap.m.Label"),
82
84
  FEBuilder.Matchers.state("controlType", "sap.m.Link"),
83
85
  FEBuilder.Matchers.state("controlType", "sap.m.ObjectStatus"),
@@ -236,6 +236,23 @@ sap.ui.define(
236
236
  return this.has(TableBuilder.Matchers.columnsMatcher(mColumnMap, bIgnoreColumnState));
237
237
  };
238
238
 
239
+ TableBuilder.prototype.hasSearchField = function(sSearchText, mState) {
240
+ var aArguments = Utils.parseArguments([String, Object], arguments);
241
+ mState = aArguments[1];
242
+ var oSuccessBuilder = new TableBuilder(this.getOpaInstance(), this.build()).hasConditional(
243
+ mState && mState.visible === false,
244
+ OpaBuilder.Matchers.not(FEBuilder.Matchers.deepAggregationMatcher("actions/action", FEBuilder.Matchers.id(/BasicSearch$/))),
245
+ OpaBuilder.Matchers.childrenMatcher(
246
+ FEBuilder.create(this)
247
+ .hasType("sap.fe.macros.table.BasicSearch")
248
+ .checkNumberOfMatches(1)
249
+ .hasProperties(mState)
250
+ .hasAggregation("filter", OpaBuilder.Matchers.properties(aArguments[0] ? { value: sSearchText } : {}))
251
+ )
252
+ );
253
+ return this.doOpenOverflow().success(oSuccessBuilder);
254
+ };
255
+
239
256
  TableBuilder.prototype.hasRows = function(vRowMatcher, bReturnAggregationItems) {
240
257
  vRowMatcher = _getRowMatcher(vRowMatcher);
241
258
 
@@ -379,6 +396,26 @@ sap.ui.define(
379
396
  return this.doColumnHeaderAction(vColumn, "sap-icon://sum", sFieldName);
380
397
  };
381
398
 
399
+ TableBuilder.prototype.doChangeSearch = function(sSearchText) {
400
+ var oSuccessBuilder = new TableBuilder(this.getOpaInstance(), this.build()).doOnChildren(
401
+ OpaBuilder.create(this)
402
+ .hasType("sap.fe.macros.table.BasicSearch")
403
+ .checkNumberOfMatches(1)
404
+ .doOnAggregation("filter", OpaBuilder.Actions.press(), OpaBuilder.Actions.enterText(sSearchText || ""))
405
+ );
406
+ return this.doOpenOverflow().success(oSuccessBuilder);
407
+ };
408
+
409
+ TableBuilder.prototype.doResetSearch = function() {
410
+ var oSuccessBuilder = new TableBuilder(this.getOpaInstance(), this.build()).doOnChildren(
411
+ OpaBuilder.create(this)
412
+ .hasType("sap.fe.macros.table.BasicSearch")
413
+ .checkNumberOfMatches(1)
414
+ .doOnAggregation("filter", OpaBuilder.Actions.press(), OpaBuilder.Actions.press("reset"))
415
+ );
416
+ return this.doOpenOverflow().success(oSuccessBuilder);
417
+ };
418
+
382
419
  TableBuilder.prototype.checkColumnHeaderAction = function(vColumn, sActionIconName, sFieldName, iExpectedNumber) {
383
420
  var oHeaderPopoverBuilder;
384
421
 
@@ -409,6 +446,13 @@ sap.ui.define(
409
446
  .isDialogElement()
410
447
  .hasType("sap.m.StandardListItem")
411
448
  .checkNumberOfMatches(iExpectedNumber)
449
+ .success(
450
+ OpaBuilder.create()
451
+ .isDialogElement()
452
+ .hasType("sap.m.Button")
453
+ .hasProperties({ icon: "sap-icon://decline" })
454
+ .doPress()
455
+ )
412
456
  );
413
457
  }
414
458
  } else {
@@ -428,6 +472,13 @@ sap.ui.define(
428
472
  .hasType("sap.m.StandardListItem")
429
473
  .hasProperties({ title: sFieldName })
430
474
  .checkNumberOfMatches(iExpectedNumber)
475
+ .success(
476
+ OpaBuilder.create()
477
+ .isDialogElement()
478
+ .hasType("sap.m.Button")
479
+ .hasProperties({ icon: "sap-icon://decline" })
480
+ .doPress()
481
+ )
431
482
  );
432
483
  }
433
484
 
@@ -534,6 +585,18 @@ sap.ui.define(
534
585
  return this.doOpenOverflow().success(oSuccessBuilder);
535
586
  };
536
587
 
588
+ TableBuilder.prototype.doClickOnMessageStripFilter = function() {
589
+ return this.do(function(oMdcTable) {
590
+ var oLink = oMdcTable.getDataStateIndicator()._oLink;
591
+ return OpaBuilder.create()
592
+ .hasType("sap.m.Link")
593
+ .hasId(oLink.getId())
594
+ .description("Press the messageStrip filter on Table")
595
+ .doPress()
596
+ .execute();
597
+ });
598
+ };
599
+
537
600
  TableBuilder.prototype.hasShowHideDetails = function() {
538
601
  return _createTableInternalButtonBuilder(this, "showHideDetails", false);
539
602
  };
@@ -27,7 +27,7 @@ sap.ui.define(
27
27
  interfaces: [],
28
28
  controls: [],
29
29
  elements: [],
30
- version: "1.93.3",
30
+ version: "1.96.2",
31
31
  noLibraryCSS: true
32
32
  });
33
33
 
@@ -8,33 +8,50 @@ sap.ui.define(
8
8
  "use strict";
9
9
 
10
10
  var MassEditRuntime = {
11
- handleMassEditChange: function(oSource, value, bValidationCase) {
11
+ handleMassEditChange: function(oSource, value) {
12
+ var aParams = oSource && oSource.getSelectedKey() && oSource.getSelectedKey().split("/");
12
13
  var oDialog =
13
14
  oSource &&
14
15
  oSource
16
+ .getParent()
15
17
  .getParent()
16
18
  .getParent()
17
19
  .getParent();
18
20
  var oFieldsInfoData = oDialog && oDialog.getModel("fieldsInfo").getData();
19
- var oDataObject = {
20
- keyValue: oSource.getId().substring(oSource.getId().lastIndexOf(":") + 1),
21
- value: value
22
- };
23
- if (!value && bValidationCase) {
24
- // var oSourceControl = sap.ui.getCore().byId(sUnitId);
25
- oSource.setValueState("Error");
26
- oSource.setValueStateText("Please enter a value");
21
+ var oDataObject;
22
+ if (aParams[0] === "Default") {
23
+ oDataObject = { keyValue: aParams[1], value: aParams[0] };
24
+ } else if (aParams[0] === "ClearFieldValue") {
25
+ oDataObject = { keyValue: aParams[1], value: "" };
26
+ } else if (!aParams) {
27
+ var sPropertyName = oSource.getId().substring(oSource.getId().lastIndexOf(":") + 1);
27
28
  oDataObject = {
28
- control: oSource,
29
- valueState: "Error",
30
- valueStateText: "Please enter a value",
31
- validationError: true
29
+ keyValue: sPropertyName,
30
+ value: value
32
31
  };
33
32
  } else {
34
- oSource.setValueState("None");
35
- oSource.setValueStateText(null);
33
+ var aRelatedField =
34
+ aParams[0] &&
35
+ oFieldsInfoData.values &&
36
+ oFieldsInfoData.values[aParams[0]].filter(function(oFieldData) {
37
+ return oFieldData.text === oSource.getValue();
38
+ });
39
+ oDataObject =
40
+ aRelatedField && aRelatedField[0] && aRelatedField[0].textInfo
41
+ ? { keyValue: aParams[0], value: aRelatedField[0].textInfo.value }
42
+ : { keyValue: aParams[0], value: oSource.getValue() };
43
+ }
44
+ var bExistingElementindex = false;
45
+ for (var i = 0; i < oFieldsInfoData.results.length; i++) {
46
+ if (oFieldsInfoData.results[i].keyValue === oDataObject.keyValue) {
47
+ bExistingElementindex = i;
48
+ }
49
+ }
50
+ if (bExistingElementindex !== false) {
51
+ oFieldsInfoData.results[bExistingElementindex] = oDataObject;
52
+ } else {
53
+ oFieldsInfoData.results.push(oDataObject);
36
54
  }
37
- oFieldsInfoData.results.push(oDataObject);
38
55
  }
39
56
  };
40
57