@sapui5/sap.fe.test 1.102.2 → 1.104.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.
Files changed (65) hide show
  1. package/package.json +3 -4
  2. package/src/sap/fe/test/.library +1 -1
  3. package/src/sap/fe/test/BaseActions.js +103 -97
  4. package/src/sap/fe/test/BaseArrangements.js +4 -15
  5. package/src/sap/fe/test/BaseAssertions.js +39 -46
  6. package/src/sap/fe/test/CollaborationClient.js +5 -5
  7. package/src/sap/fe/test/CollaborationClient.ts +5 -5
  8. package/src/sap/fe/test/FeMocks.js +1 -1
  9. package/src/sap/fe/test/FeMocks.ts +4 -3
  10. package/src/sap/fe/test/Flexibility.js +115 -162
  11. package/src/sap/fe/test/JestTemplatingHelper.js +99 -7
  12. package/src/sap/fe/test/JestTemplatingHelper.ts +91 -14
  13. package/src/sap/fe/test/JourneyRunner.js +31 -37
  14. package/src/sap/fe/test/ListReport.js +9 -13
  15. package/src/sap/fe/test/ObjectPage.js +35 -33
  16. package/src/sap/fe/test/Shell.js +0 -6
  17. package/src/sap/fe/test/TemplatePage.js +0 -2
  18. package/src/sap/fe/test/TemplatingTestUtils.js +20 -20
  19. package/src/sap/fe/test/UI5MockHelper.js +16 -10
  20. package/src/sap/fe/test/UI5MockHelper.ts +28 -18
  21. package/src/sap/fe/test/Utils.js +19 -20
  22. package/src/sap/fe/test/api/BaseAPI.js +11 -26
  23. package/src/sap/fe/test/api/ChartActions.js +116 -119
  24. package/src/sap/fe/test/api/ChartAssertions.js +18 -22
  25. package/src/sap/fe/test/api/CollaborationAPI.js +6 -6
  26. package/src/sap/fe/test/api/CollaborationAPI.ts +9 -11
  27. package/src/sap/fe/test/api/DialogAPI.js +11 -13
  28. package/src/sap/fe/test/api/DialogActions.js +8 -8
  29. package/src/sap/fe/test/api/DialogAssertions.js +9 -10
  30. package/src/sap/fe/test/api/DialogHelper.js +63 -0
  31. package/src/sap/fe/test/api/DialogMessageActions.js +2 -1
  32. package/src/sap/fe/test/api/DialogValueHelpActions.js +17 -39
  33. package/src/sap/fe/test/api/DialogValueHelpAssertions.js +47 -19
  34. package/src/sap/fe/test/api/FilterBarAPI.js +11 -12
  35. package/src/sap/fe/test/api/FilterBarActions.js +26 -40
  36. package/src/sap/fe/test/api/FilterBarAssertions.js +28 -47
  37. package/src/sap/fe/test/api/FooterActionsBase.js +3 -4
  38. package/src/sap/fe/test/api/FooterActionsOP.js +6 -10
  39. package/src/sap/fe/test/api/FooterAssertionsBase.js +5 -10
  40. package/src/sap/fe/test/api/FooterAssertionsOP.js +8 -13
  41. package/src/sap/fe/test/api/FormAPI.js +5 -6
  42. package/src/sap/fe/test/api/FormActions.js +11 -21
  43. package/src/sap/fe/test/api/FormAssertions.js +14 -20
  44. package/src/sap/fe/test/api/HeaderAPI.js +12 -27
  45. package/src/sap/fe/test/api/HeaderActions.js +10 -12
  46. package/src/sap/fe/test/api/HeaderActionsLR.js +76 -82
  47. package/src/sap/fe/test/api/HeaderAssertions.js +2 -20
  48. package/src/sap/fe/test/api/HeaderAssertionsLR.js +5 -8
  49. package/src/sap/fe/test/api/HeaderLR.js +7 -19
  50. package/src/sap/fe/test/api/KPICardAssertions.js +18 -37
  51. package/src/sap/fe/test/api/TableAPI.js +3 -13
  52. package/src/sap/fe/test/api/TableActions.js +2 -34
  53. package/src/sap/fe/test/api/TableAssertions.js +1 -24
  54. package/src/sap/fe/test/builder/FEBuilder.js +71 -75
  55. package/src/sap/fe/test/builder/MacroFieldBuilder.js +4 -3
  56. package/src/sap/fe/test/builder/MdcFieldBuilder.js +33 -29
  57. package/src/sap/fe/test/builder/MdcFilterBarBuilder.js +102 -104
  58. package/src/sap/fe/test/builder/MdcFilterFieldBuilder.js +9 -7
  59. package/src/sap/fe/test/builder/MdcTableBuilder.js +8 -4
  60. package/src/sap/fe/test/builder/VMBuilder.js +39 -55
  61. package/src/sap/fe/test/internal/ConsoleErrorChecker.js +241 -0
  62. package/src/sap/fe/test/internal/ConsoleErrorChecker.ts +206 -0
  63. package/src/sap/fe/test/internal/FEArrangements.js +28 -8
  64. package/src/sap/fe/test/library.js +3 -2
  65. package/src/sap/fe/test/library.ts +1 -0
@@ -3,7 +3,7 @@
3
3
  (c) Copyright 2009-2021 SAP SE. All rights reserved
4
4
 
5
5
  */
6
- sap.ui.define(["./DialogAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"], function(DialogAPI, Utils, OpaBuilder) {
6
+ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"], function (DialogAPI, Utils, OpaBuilder) {
7
7
  "use strict";
8
8
 
9
9
  /**
@@ -11,14 +11,14 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"], fu
11
11
  *
12
12
  * @param {sap.fe.test.builder.DialogBuilder} oDialogBuilder The {@link sap.fe.test.builder.DialogBuilder} instance used to interact with the UI
13
13
  * @param {string} [vDialogDescription] Description (optional) of the dialog to be used for logging messages
14
- * @param {int} [iConfirmButtonIndex] Index of the 'confirm' button in the button aggregation; the default setting is 0 (first button from the left)
14
+ * @param {number} [iConfirmButtonIndex] Index of the 'confirm' button in the button aggregation; the default setting is 0 (first button from the left)
15
15
  * @returns {sap.fe.test.api.DialogActions} The new DialogActions instance
16
16
  * @alias sap.fe.test.api.DialogActions
17
17
  * @class
18
18
  * @hideconstructor
19
19
  * @public
20
20
  */
21
- var DialogActions = function(oDialogBuilder, vDialogDescription, iConfirmButtonIndex) {
21
+ var DialogActions = function (oDialogBuilder, vDialogDescription, iConfirmButtonIndex) {
22
22
  return DialogAPI.call(this, oDialogBuilder, vDialogDescription, iConfirmButtonIndex);
23
23
  };
24
24
  DialogActions.prototype = Object.create(DialogAPI.prototype);
@@ -31,7 +31,7 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"], fu
31
31
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
32
32
  * @public
33
33
  */
34
- DialogActions.prototype.iConfirm = function() {
34
+ DialogActions.prototype.iConfirm = function () {
35
35
  return this.prepareResult(
36
36
  this.getBuilder()
37
37
  .doPressFooterButton(this._getConfirmButtonMatcher())
@@ -46,7 +46,7 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"], fu
46
46
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
47
47
  * @public
48
48
  */
49
- DialogActions.prototype.iCancel = function() {
49
+ DialogActions.prototype.iCancel = function () {
50
50
  return this.prepareResult(
51
51
  this.getBuilder()
52
52
  .doPressFooterButton(this._getCancelButtonMatcher())
@@ -61,7 +61,7 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"], fu
61
61
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
62
62
  * @public
63
63
  */
64
- DialogActions.prototype.iClose = function() {
64
+ DialogActions.prototype.iClose = function () {
65
65
  return this.prepareResult(
66
66
  this.getBuilder()
67
67
  .doPressKeyboardShortcut("Escape")
@@ -79,7 +79,7 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"], fu
79
79
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
80
80
  * @public
81
81
  */
82
- DialogActions.prototype.iChangeDialogField = function(vFieldIdentifier, vValue, bClearFirst) {
82
+ DialogActions.prototype.iChangeDialogField = function (vFieldIdentifier, vValue, bClearFirst) {
83
83
  var aArguments = Utils.parseArguments([Object, String, Boolean], arguments);
84
84
  return this.prepareResult(
85
85
  this._createFieldBuilder(vFieldIdentifier, this.getIdentifier())
@@ -108,7 +108,7 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"], fu
108
108
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
109
109
  * @ui5-restricted
110
110
  */
111
- DialogActions.prototype.iChangeActionParameterDialogField = function(vFieldIdentifier, vValue, bClearFirst) {
111
+ DialogActions.prototype.iChangeActionParameterDialogField = function (vFieldIdentifier, vValue, bClearFirst) {
112
112
  return this.iChangeDialogField(vFieldIdentifier, vValue, bClearFirst);
113
113
  };
114
114
 
@@ -3,7 +3,7 @@
3
3
  (c) Copyright 2009-2021 SAP SE. All rights reserved
4
4
 
5
5
  */
6
- sap.ui.define(["./DialogAPI", "sap/fe/test/Utils"], function(DialogAPI, Utils) {
6
+ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils"], function (DialogAPI, Utils) {
7
7
  "use strict";
8
8
 
9
9
  /**
@@ -11,14 +11,14 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils"], function(DialogAPI, Utils) {
11
11
  *
12
12
  * @param {sap.fe.test.builder.DialogBuilder} oDialogBuilder The {@link sap.fe.test.builder.DialogBuilder} instance used to interact with the UI
13
13
  * @param {string} [vDialogDescription] Description (optional) of the dialog to be used for logging messages
14
- * @param {int} [iConfirmButtonIndex] Index of the 'confirm' button in the button aggregation; the default setting is 0 (first button from the left)
14
+ * @param {number} [iConfirmButtonIndex] Index of the 'confirm' button in the button aggregation; the default setting is 0 (first button from the left)
15
15
  * @returns {sap.fe.test.api.DialogAssertions} The new instance
16
16
  * @alias sap.fe.test.api.DialogAssertions
17
17
  * @class
18
18
  * @hideconstructor
19
19
  * @public
20
20
  */
21
- var DialogAssertions = function(oDialogBuilder, vDialogDescription, iConfirmButtonIndex) {
21
+ var DialogAssertions = function (oDialogBuilder, vDialogDescription, iConfirmButtonIndex) {
22
22
  return DialogAPI.call(this, oDialogBuilder, vDialogDescription, iConfirmButtonIndex);
23
23
  };
24
24
  DialogAssertions.prototype = Object.create(DialogAPI.prototype);
@@ -30,10 +30,9 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils"], function(DialogAPI, Utils) {
30
30
  *
31
31
  * @param {object} [mDialogState] Defines the expected state of the dialog
32
32
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
33
- *
34
33
  * @public
35
34
  */
36
- DialogAssertions.prototype.iCheckState = function(mDialogState) {
35
+ DialogAssertions.prototype.iCheckState = function (mDialogState) {
37
36
  return this.prepareResult(
38
37
  this.getBuilder()
39
38
  .hasState(mDialogState)
@@ -41,7 +40,7 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils"], function(DialogAPI, Utils) {
41
40
  .execute()
42
41
  );
43
42
  };
44
-
43
+
45
44
  /**
46
45
  * Checks the confirmation button of the dialog.
47
46
  *
@@ -49,7 +48,7 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils"], function(DialogAPI, Utils) {
49
48
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
50
49
  * @public
51
50
  */
52
- DialogAssertions.prototype.iCheckConfirm = function(mButtonState) {
51
+ DialogAssertions.prototype.iCheckConfirm = function (mButtonState) {
53
52
  return this.prepareResult(
54
53
  this.getBuilder()
55
54
  .hasFooterButton(this._getConfirmButtonMatcher(), mButtonState)
@@ -71,7 +70,7 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils"], function(DialogAPI, Utils) {
71
70
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
72
71
  * @public
73
72
  */
74
- DialogAssertions.prototype.iCheckCancel = function(mButtonState) {
73
+ DialogAssertions.prototype.iCheckCancel = function (mButtonState) {
75
74
  return this.prepareResult(
76
75
  this.getBuilder()
77
76
  .hasFooterButton(this._getCancelButtonMatcher(), mButtonState)
@@ -101,7 +100,7 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils"], function(DialogAPI, Utils) {
101
100
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
102
101
  * @public
103
102
  */
104
- DialogAssertions.prototype.iCheckDialogField = function(vFieldIdentifier, vValue, mState) {
103
+ DialogAssertions.prototype.iCheckDialogField = function (vFieldIdentifier, vValue, mState) {
105
104
  var aArguments = Utils.parseArguments([Object, [String, Array, Object], Object], arguments);
106
105
  return this.prepareResult(
107
106
  this._createFieldBuilder(vFieldIdentifier, this.getIdentifier())
@@ -135,7 +134,7 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils"], function(DialogAPI, Utils) {
135
134
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
136
135
  * @public
137
136
  */
138
- DialogAssertions.prototype.iCheckActionParameterDialogField = function(vFieldIdentifier, vValue, mState) {
137
+ DialogAssertions.prototype.iCheckActionParameterDialogField = function (vFieldIdentifier, vValue, mState) {
139
138
  return this.iCheckDialogField(vFieldIdentifier, vValue, mState);
140
139
  };
141
140
 
@@ -0,0 +1,63 @@
1
+ /*
2
+ * ! SAP UI development toolkit for HTML5 (SAPUI5)
3
+ (c) Copyright 2009-2021 SAP SE. All rights reserved
4
+
5
+ */
6
+ sap.ui.define(["./DialogAPI"], function (DialogAPI) {
7
+ "use strict";
8
+
9
+ return {
10
+ /**
11
+ * A helper function that ensures that a draft is available and confirmed.
12
+ *
13
+ * @param {object} When The Opa5 When chain
14
+ * @param {object} Then The Opa5 Then chain
15
+ * @param {object} oParams The general object describing the parameters for this function
16
+ * @param {boolean} oParams.secondPage Optional boolean to describe whether the test is executed on the second or detailpage
17
+ * @param {string} oParams.formSection The form section on which the change shall be applied
18
+ * @param {string} oParams.fieldGroup The optional field group on which the change shall be applied, defaulted to "OrderData"
19
+ * @param {boolean} oParams.noFieldGroup The optional boolean parameter to remove the default fieldgroup again
20
+ * @param {object} oParams.changeField The field to be changed in a key value relationship
21
+ * @param {string} oParams.draftOption The draftOption that should be used in this helper, default "draftDataLossOptionKeep"
22
+ */
23
+ iProcessDraftDataLossDialog: function (When, Then, oParams) {
24
+ var loParams = oParams || {};
25
+ var pageKey = loParams.secondPage ? "onTheSecondDetailPage" : "onTheDetailPage";
26
+ var formSection = loParams.formSection ? loParams.formSection : "GeneralInfo";
27
+ var changeField = loParams.changeField
28
+ ? loParams.changeField
29
+ : {
30
+ "PurchaseOrderByCustomer": "CHANGED" //default field with "changed value"
31
+ };
32
+
33
+ var draftOption = loParams.draftOption ? loParams.draftOption : "draftDataLossOptionKeep";
34
+ var sGoToSection = loParams.goToSection ? loParams.goToSection : false;
35
+
36
+ var aFields = Object.keys(changeField);
37
+ var sFieldProperty;
38
+ var sValue;
39
+ if (aFields.length === 1) {
40
+ var lsKey = aFields[0];
41
+ sFieldProperty = lsKey;
42
+ sValue = changeField[sFieldProperty];
43
+ } // TODO: potentially prepare more use cases with multi changing fields
44
+
45
+ var oFormSettings = { section: formSection };
46
+
47
+ oFormSettings.fieldGroup = loParams.fieldGroup ? oFormSettings.fieldGroup : "OrderData";
48
+ if (loParams.noFieldGroup) {
49
+ delete oFormSettings["fieldGroup"];
50
+ }
51
+
52
+ if (sGoToSection) {
53
+ When[pageKey].iGoToSection(sGoToSection);
54
+ }
55
+
56
+ When[pageKey].onForm(oFormSettings).iChangeField({ property: sFieldProperty }, sValue);
57
+ Then[pageKey].onFooter().iCheckDraftStateSaved();
58
+ When.onTheShell.iNavigateBack();
59
+ When[pageKey].onMessageDialog().iSelectDraftDataLossOption(draftOption);
60
+ When[pageKey].onMessageDialog().iConfirm();
61
+ }
62
+ };
63
+ });
@@ -58,8 +58,9 @@ sap.ui.define(
58
58
  };
59
59
 
60
60
  /**
61
- * Selects the specified entry in the draft data loss popup
61
+ * Selects the specified entry in the draft data loss popup.
62
62
  *
63
+ * @param {any} optionKey
63
64
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
64
65
  * @public
65
66
  */
@@ -15,7 +15,7 @@ sap.ui.define(
15
15
  "./FilterBarAPI",
16
16
  "./TableAPI"
17
17
  ],
18
- function(DialogActions, Utils, OpaBuilder, FEBuilder, FilterBarBuilder, TableBuilder, FieldBuilder, FilterBarAPI, TableAPI) {
18
+ function (DialogActions, Utils, OpaBuilder, FEBuilder, FilterBarBuilder, TableBuilder, FieldBuilder, FilterBarAPI, TableAPI) {
19
19
  "use strict";
20
20
 
21
21
  /**
@@ -24,14 +24,13 @@ sap.ui.define(
24
24
  * @param {sap.fe.test.builder.DialogBuilder} oDialogBuilder The {@link sap.fe.test.builder.DialogBuilder} instance used to interact with the UI
25
25
  * @param {string} [vDialogDescription] Description (optional) of the dialog to be used for logging messages
26
26
  * @returns {sap.fe.test.api.DialogValueHelpActions} The new instance
27
- *
28
27
  * @extends sap.fe.test.api.DialogActions
29
28
  * @alias sap.fe.test.api.DialogValueHelpActions
30
29
  * @hideconstructor
31
30
  * @class
32
31
  * @public
33
32
  */
34
- var DialogValueHelpActions = function(oDialogBuilder, vDialogDescription) {
33
+ var DialogValueHelpActions = function (oDialogBuilder, vDialogDescription) {
35
34
  return DialogActions.call(this, oDialogBuilder, vDialogDescription, 0);
36
35
  };
37
36
  DialogValueHelpActions.prototype = Object.create(DialogActions.prototype);
@@ -42,10 +41,9 @@ sap.ui.define(
42
41
  * Navigates to the <code>Search and Select</code> tab.
43
42
  *
44
43
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
45
- *
46
44
  * @public
47
45
  */
48
- DialogValueHelpActions.prototype.iGoToSearchAndSelect = function() {
46
+ DialogValueHelpActions.prototype.iGoToSearchAndSelect = function () {
49
47
  return this.prepareResult(
50
48
  FEBuilder.create(this.getOpaInstance())
51
49
  .isDialogElement()
@@ -61,10 +59,9 @@ sap.ui.define(
61
59
  * Navigates to the <code>Define Conditions</code> tab.
62
60
  *
63
61
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
64
- *
65
62
  * @public
66
63
  */
67
- DialogValueHelpActions.prototype.iGoToDefineConditions = function() {
64
+ DialogValueHelpActions.prototype.iGoToDefineConditions = function () {
68
65
  return this.prepareResult(
69
66
  FEBuilder.create(this.getOpaInstance())
70
67
  .isDialogElement()
@@ -80,10 +77,9 @@ sap.ui.define(
80
77
  * Clicks the <code>Hide/Show Filters</code> button.
81
78
  *
82
79
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
83
- *
84
80
  * @public
85
81
  */
86
- DialogValueHelpActions.prototype.iExecuteShowHideFilters = function() {
82
+ DialogValueHelpActions.prototype.iExecuteShowHideFilters = function () {
87
83
  return this.prepareResult(
88
84
  FEBuilder.create(this.getOpaInstance())
89
85
  .isDialogElement()
@@ -100,10 +96,9 @@ sap.ui.define(
100
96
  *
101
97
  * @param {string} [sSearchText] The new search value.
102
98
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
103
- *
104
99
  * @public
105
100
  */
106
- DialogValueHelpActions.prototype.iChangeSearchField = function(sSearchText) {
101
+ DialogValueHelpActions.prototype.iChangeSearchField = function (sSearchText) {
107
102
  var oFilterBarBuilder = FilterBarBuilder.create(this.getOpaInstance())
108
103
  .isDialogElement()
109
104
  .hasType("sap.ui.mdc.filterbar.vh.FilterBar");
@@ -120,40 +115,28 @@ sap.ui.define(
120
115
  * Starts the search.
121
116
  *
122
117
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
123
- *
124
118
  * @public
125
119
  */
126
- DialogValueHelpActions.prototype.iExecuteSearch = function() {
120
+ DialogValueHelpActions.prototype.iExecuteSearch = function () {
127
121
  var oFilterBarBuilder = FilterBarBuilder.create(this.getOpaInstance())
128
122
  .isDialogElement()
129
123
  .hasType("sap.ui.mdc.filterbar.vh.FilterBar");
130
124
 
131
- return this.prepareResult(
132
- oFilterBarBuilder
133
- .doSearch()
134
- .description("Starting value help search field search")
135
- .execute()
136
- );
125
+ return this.prepareResult(oFilterBarBuilder.doSearch().description("Starting value help search field search").execute());
137
126
  };
138
127
 
139
128
  /**
140
129
  * Resets the search field value.
141
130
  *
142
131
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
143
- *
144
132
  * @public
145
133
  */
146
- DialogValueHelpActions.prototype.iResetSearchField = function() {
134
+ DialogValueHelpActions.prototype.iResetSearchField = function () {
147
135
  var oFilterBarBuilder = FilterBarBuilder.create(this.getOpaInstance())
148
136
  .isDialogElement()
149
137
  .hasType("sap.ui.mdc.filterbar.vh.FilterBar");
150
138
 
151
- return this.prepareResult(
152
- oFilterBarBuilder
153
- .doResetSearch()
154
- .description("Resetting value help search field")
155
- .execute()
156
- );
139
+ return this.prepareResult(oFilterBarBuilder.doResetSearch().description("Resetting value help search field").execute());
157
140
  };
158
141
 
159
142
  /**
@@ -163,10 +146,9 @@ sap.ui.define(
163
146
  * @param {string} [vValue] The new target value.
164
147
  * @param {boolean} [bClearFirst] Set to <code>true</code> to clear previously set filters, otherwise all previously set values will be kept
165
148
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
166
- *
167
149
  * @public
168
150
  */
169
- DialogValueHelpActions.prototype.iChangeFilterField = function(vFieldIdentifier, vValue, bClearFirst) {
151
+ DialogValueHelpActions.prototype.iChangeFilterField = function (vFieldIdentifier, vValue, bClearFirst) {
170
152
  var aArguments = Utils.parseArguments([[String, Object], String, Boolean], arguments),
171
153
  oFilterBarBuilder = FilterBarBuilder.create(this.getOpaInstance())
172
154
  .isDialogElement()
@@ -201,10 +183,9 @@ sap.ui.define(
201
183
  * Alternatively, the 0-based row index can be used.
202
184
  * @param {object} [mState] Defines the expected state of the row
203
185
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
204
- *
205
186
  * @public
206
187
  */
207
- DialogValueHelpActions.prototype.iSelectRows = function(vRowValues, mState) {
188
+ DialogValueHelpActions.prototype.iSelectRows = function (vRowValues, mState) {
208
189
  var aArguments = Utils.parseArguments([[Object, Number], Object], arguments),
209
190
  oTableBuilder = TableBuilder.createWrapper(this.getOpaInstance(), "sap.ui.table.Table").isDialogElement();
210
191
  return this.prepareResult(
@@ -229,10 +210,9 @@ sap.ui.define(
229
210
  * @param {string | string[]} vValues The values to be set. If the operator requires more than one value, like BT (between),
230
211
  * an array with the two entries is expected
231
212
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
232
- *
233
213
  * @public
234
214
  */
235
- DialogValueHelpActions.prototype.iAddCondition = function(sOperator, vValues) {
215
+ DialogValueHelpActions.prototype.iAddCondition = function (sOperator, vValues) {
236
216
  return this.iChangeCondition(sOperator || "EQ", vValues, -1);
237
217
  };
238
218
 
@@ -244,10 +224,9 @@ sap.ui.define(
244
224
  * an array with the two entries is expected
245
225
  * @param {number} [iConditionIndex] The index of the condition to be altered. If not set, the index 0 is used
246
226
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
247
- *
248
227
  * @public
249
228
  */
250
- DialogValueHelpActions.prototype.iChangeCondition = function(sOperator, vValues, iConditionIndex) {
229
+ DialogValueHelpActions.prototype.iChangeCondition = function (sOperator, vValues, iConditionIndex) {
251
230
  iConditionIndex = iConditionIndex || 0;
252
231
  var bIsEmpty = vValues === undefined;
253
232
  vValues = bIsEmpty || Array.isArray(vValues) ? vValues : [vValues];
@@ -261,7 +240,7 @@ sap.ui.define(
261
240
  FEBuilder.create(this.getOpaInstance())
262
241
  .isDialogElement()
263
242
  .hasType("sap.ui.mdc.field.DefineConditionPanel")
264
- .do(function(oConditionsPanel) {
243
+ .do(function (oConditionsPanel) {
265
244
  var aConditions = [].concat(oConditionsPanel.getConditions());
266
245
  if (iConditionIndex === -1) {
267
246
  aConditions.push(oCondition);
@@ -287,16 +266,15 @@ sap.ui.define(
287
266
  *
288
267
  * @param {number} [iConditionIndex] The index of the condition to be removed. If not set, the index 0 is used
289
268
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
290
- *
291
269
  * @public
292
270
  */
293
- DialogValueHelpActions.prototype.iRemoveCondition = function(iConditionIndex) {
271
+ DialogValueHelpActions.prototype.iRemoveCondition = function (iConditionIndex) {
294
272
  iConditionIndex = iConditionIndex || 0;
295
273
  return this.prepareResult(
296
274
  FEBuilder.create(this.getOpaInstance())
297
275
  .isDialogElement()
298
276
  .hasType("sap.ui.mdc.field.DefineConditionPanel")
299
- .do(function(oConditionsPanel) {
277
+ .do(function (oConditionsPanel) {
300
278
  var aConditions = [].concat(oConditionsPanel.getConditions());
301
279
  aConditions.splice(iConditionIndex, 1);
302
280
  oConditionsPanel.setConditions(aConditions);
@@ -14,7 +14,7 @@ sap.ui.define(
14
14
  "sap/fe/test/builder/MdcTableBuilder",
15
15
  "sap/fe/test/Utils"
16
16
  ],
17
- function(DialogAssertions, FilterBarAPI, TableAPI, OpaBuilder, FEBuilder, FilterBarBuilder, TableBuilder, Utils) {
17
+ function (DialogAssertions, FilterBarAPI, TableAPI, OpaBuilder, FEBuilder, FilterBarBuilder, TableBuilder, Utils) {
18
18
  "use strict";
19
19
 
20
20
  /**
@@ -23,14 +23,13 @@ sap.ui.define(
23
23
  * @param {sap.fe.test.builder.DialogBuilder} oDialogBuilder The {@link sap.fe.test.builder.DialogBuilder} instance used to interact with the UI
24
24
  * @param {string} [vDialogDescription] Description (optional) of the dialog to be used for logging messages
25
25
  * @returns {sap.fe.test.api.DialogValueHelpAssertions} The new instance
26
- *
27
26
  * @extends sap.fe.test.api.DialogAssertions
28
27
  * @alias sap.fe.test.api.DialogValueHelpAssertions
29
28
  * @hideconstructor
30
29
  * @class
31
30
  * @public
32
31
  */
33
- var DialogValueHelpAssertions = function(oDialogBuilder, vDialogDescription) {
32
+ var DialogValueHelpAssertions = function (oDialogBuilder, vDialogDescription) {
34
33
  return DialogAssertions.call(this, oDialogBuilder, vDialogDescription, 0);
35
34
  };
36
35
  DialogValueHelpAssertions.prototype = Object.create(DialogAssertions.prototype);
@@ -42,10 +41,9 @@ sap.ui.define(
42
41
  *
43
42
  * @param {object} [mState] Defines the expected state of the filter bar
44
43
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
45
- *
46
44
  * @public
47
45
  */
48
- DialogValueHelpAssertions.prototype.iCheckFilterBar = function(mState) {
46
+ DialogValueHelpAssertions.prototype.iCheckFilterBar = function (mState) {
49
47
  return this.prepareResult(
50
48
  FilterBarBuilder.create(this.getOpaInstance())
51
49
  .isDialogElement()
@@ -71,10 +69,9 @@ sap.ui.define(
71
69
  * @param {string} [sOperator] The expected operator
72
70
  * @param {object} [mState] Defines the expected state of the filter field
73
71
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
74
- *
75
72
  * @public
76
73
  */
77
- DialogValueHelpAssertions.prototype.iCheckFilterField = function(vFieldIdentifier, vConditionValues, sOperator, mState) {
74
+ DialogValueHelpAssertions.prototype.iCheckFilterField = function (vFieldIdentifier, vConditionValues, sOperator, mState) {
78
75
  var aArguments = Utils.parseArguments([[String, Object], [String, Array, Object, Boolean], String, Object], arguments),
79
76
  oFilterBarBuilder = FilterBarBuilder.create(this.getOpaInstance())
80
77
  .isDialogElement()
@@ -107,10 +104,9 @@ sap.ui.define(
107
104
  * @param {string} [sSearchText] The expected text in the search field
108
105
  * @param {object} [mState] Defines the expected state of the search field
109
106
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
110
- *
111
107
  * @public
112
108
  */
113
- DialogValueHelpAssertions.prototype.iCheckSearchField = function(sSearchText, mState) {
109
+ DialogValueHelpAssertions.prototype.iCheckSearchField = function (sSearchText, mState) {
114
110
  var aArguments = Utils.parseArguments([String, Object], arguments),
115
111
  oFilterBarBuilder = FilterBarBuilder.create(this.getOpaInstance())
116
112
  .isDialogElement()
@@ -135,10 +131,9 @@ sap.ui.define(
135
131
  *
136
132
  * @param {object} [mState] Defines the expected state of the search field
137
133
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
138
- *
139
134
  * @public
140
135
  */
141
- DialogValueHelpAssertions.prototype.iCheckTable = function(mState) {
136
+ DialogValueHelpAssertions.prototype.iCheckTable = function (mState) {
142
137
  return this.prepareResult(
143
138
  TableBuilder.createWrapper(this.getOpaInstance(), "sap.ui.table.Table")
144
139
  .isDialogElement()
@@ -170,10 +165,9 @@ sap.ui.define(
170
165
  * @param {number} [iExpectedNumberOfRows] The expected number of rows considering <code>mRowValues</code> and <code>mRowState</code>
171
166
  * @param {object} [mState] Defines the expected state of the target row
172
167
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
173
- *
174
168
  * @public
175
169
  */
176
- DialogValueHelpAssertions.prototype.iCheckRows = function(mRowValues, iExpectedNumberOfRows, mState) {
170
+ DialogValueHelpAssertions.prototype.iCheckRows = function (mRowValues, iExpectedNumberOfRows, mState) {
177
171
  var aArguments = Utils.parseArguments([Object, Number, Object], arguments),
178
172
  iNumberOfRows = aArguments[1],
179
173
  aRowMatcher = TableAPI.createRowMatchers(aArguments[0], aArguments[2]),
@@ -182,7 +176,7 @@ sap.ui.define(
182
176
  // the order of the matchers matters here
183
177
  if (aRowMatcher.length) {
184
178
  // if matchers are defined, first match rows then check number of results
185
- oTableBuilder.hasRows(aRowMatcher, true).has(function(aRows) {
179
+ oTableBuilder.hasRows(aRowMatcher, true).has(function (aRows) {
186
180
  return Utils.isOfType(iNumberOfRows, Number) ? aRows.length === iNumberOfRows : aRows.length > 0;
187
181
  });
188
182
  } else {
@@ -224,7 +218,7 @@ sap.ui.define(
224
218
  oTabIdMatcher = FEBuilder.Matchers.id(RegExp(sIdSuffix + "$"));
225
219
 
226
220
  if (mState && mState.visible === false) {
227
- oBuilder.check(function(aIconTabFilters) {
221
+ oBuilder.check(function (aIconTabFilters) {
228
222
  return OpaBuilder.Matchers.filter(oTabIdMatcher)(aIconTabFilters).length === 0;
229
223
  });
230
224
  } else {
@@ -239,10 +233,9 @@ sap.ui.define(
239
233
  *
240
234
  * @param {object} [mState] Defines the expected state of the filter bar
241
235
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
242
- *
243
236
  * @public
244
237
  */
245
- DialogValueHelpAssertions.prototype.iCheckSearchAndSelect = function(mState) {
238
+ DialogValueHelpAssertions.prototype.iCheckSearchAndSelect = function (mState) {
246
239
  return _checkTabBuilder(this, "-VHP--fromList", mState);
247
240
  };
248
241
 
@@ -251,12 +244,47 @@ sap.ui.define(
251
244
  *
252
245
  * @param {object} [mState] Defines the expected state of the filter bar
253
246
  * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, that can be used for chaining statements
254
- *
255
247
  * @public
256
248
  */
257
- DialogValueHelpAssertions.prototype.iCheckDefineConditions = function(mState) {
249
+ DialogValueHelpAssertions.prototype.iCheckDefineConditions = function (mState) {
258
250
  return _checkTabBuilder(this, "-VHP--defineCondition", mState);
259
251
  };
252
+ /**
253
+ * Checks the dialog.
254
+ *
255
+ * @param {object} [mDialogState] Defines the expected state of the dialog
256
+ * @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
257
+ * @public
258
+ */
259
+ DialogValueHelpAssertions.prototype.iCheckState = function (mDialogState) {
260
+ if (this.getIdentifier().type === "ValueHelp" && mDialogState && mDialogState.title && Object.keys(mDialogState).length === 1) {
261
+ //TODO: check VH Dialog title
262
+ return this.prepareResult(
263
+ this.getBuilder()
264
+ .has(function (oControl) {
265
+ var sTitle = oControl.getParent && oControl.getParent() && oControl.getParent().getProperty("title");
266
+ return sTitle && sTitle.indexOf(mDialogState.title) >= 0;
267
+ })
268
+ //.hasState(mDialogState)
269
+ .description(Utils.formatMessage("Checking dialog '{0}' in state '{1}'", this.getIdentifier(), mDialogState))
270
+ .execute()
271
+ );
272
+ } else {
273
+ return this.prepareResult(
274
+ this.getBuilder()
275
+ .has(function (oControl) {
276
+ var sTitle = oControl.getTitle && oControl.getTitle();
277
+ if (mDialogState && sTitle === "Select: " + mDialogState.title) {
278
+ oControl.setTitle(mDialogState.title); //TODO testing
279
+ }
280
+ return true;
281
+ })
282
+ .hasState(mDialogState)
283
+ .description(Utils.formatMessage("Checking dialog '{0}' in state '{1}'", this.getIdentifier(), mDialogState))
284
+ .execute()
285
+ );
286
+ }
287
+ };
260
288
 
261
289
  return DialogValueHelpAssertions;
262
290
  }