@sapui5/sap.fe.test 1.93.3 → 1.97.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.
- package/package.json +5 -4
- package/src/sap/fe/test/.library +1 -1
- package/src/sap/fe/test/FCLView.js +0 -6
- package/src/sap/fe/test/Flexibility.js +47 -11
- package/src/sap/fe/test/JestTemplatingHelper.js +109 -7
- package/src/sap/fe/test/JestTemplatingHelper.ts +75 -6
- package/src/sap/fe/test/ListReport.js +20 -14
- package/src/sap/fe/test/ObjectPage.js +40 -26
- package/src/sap/fe/test/Shell.js +16 -11
- package/src/sap/fe/test/TemplatePage.js +48 -12
- package/src/sap/fe/test/UI5MockHelper.js +239 -0
- package/src/sap/fe/test/UI5MockHelper.ts +151 -0
- package/src/sap/fe/test/Utils.js +5 -1
- package/src/sap/fe/test/api/BaseAPI.js +31 -0
- package/src/sap/fe/test/api/ChartActions.js +11 -0
- package/src/sap/fe/test/api/ChartAssertions.js +35 -7
- package/src/sap/fe/test/api/DialogAPI.js +86 -37
- package/src/sap/fe/test/api/DialogActions.js +40 -0
- package/src/sap/fe/test/api/DialogAssertions.js +53 -0
- package/src/sap/fe/test/api/DialogCreateActions.js +3 -1
- package/src/sap/fe/test/api/DialogCreateAssertions.js +1 -1
- package/src/sap/fe/test/api/EditState.js +9 -0
- package/src/sap/fe/test/api/FilterBarActions.js +59 -19
- package/src/sap/fe/test/api/FilterBarAssertions.js +38 -6
- package/src/sap/fe/test/api/FormActions.js +33 -9
- package/src/sap/fe/test/api/FormAssertions.js +33 -4
- package/src/sap/fe/test/api/HeaderAssertions.js +29 -12
- package/src/sap/fe/test/api/KPICardAPI.js +28 -0
- package/src/sap/fe/test/api/KPICardAssertions.js +204 -0
- package/src/sap/fe/test/api/TableActions.js +50 -1
- package/src/sap/fe/test/api/TableAssertions.js +27 -0
- package/src/sap/fe/test/builder/KPIBuilder.js +60 -4
- package/src/sap/fe/test/builder/MacroFieldBuilder.js +2 -0
- package/src/sap/fe/test/builder/MdcTableBuilder.js +49 -0
- package/src/sap/fe/test/library.js +1 -1
- package/src/sap/fe/test/massEdit.js +33 -16
|
@@ -171,10 +171,39 @@ sap.ui.define(
|
|
|
171
171
|
return this.iCheckField(aArguments[0], aArguments[1], Utils.mergeObjects({ controlType: "sap.m.Link" }, aArguments[2]));
|
|
172
172
|
};
|
|
173
173
|
|
|
174
|
-
FormAssertions.prototype.
|
|
175
|
-
|
|
176
|
-
.
|
|
177
|
-
|
|
174
|
+
FormAssertions.prototype.iCheckFormContainersElementCount = function(sFormContainer, iCount, mState) {
|
|
175
|
+
var aArguments = Utils.parseArguments([String, Number, Object], arguments),
|
|
176
|
+
fullSubSectionId = this.getIdentifier().fullSubSectionId,
|
|
177
|
+
mFormState = aArguments[2],
|
|
178
|
+
sView = fullSubSectionId.split("--")[0],
|
|
179
|
+
sForm = fullSubSectionId.split("--")[1].split("::")[2],
|
|
180
|
+
sFormContainerId = sView + "--" + "fe::FormContainer::" + aArguments[0];
|
|
181
|
+
return this.prepareResult(
|
|
182
|
+
this.getBuilder()
|
|
183
|
+
.hasId(sFormContainerId)
|
|
184
|
+
.has(function(oFormContainer) {
|
|
185
|
+
var oMatchingFormContainers;
|
|
186
|
+
if (Object.keys(mFormState).length) {
|
|
187
|
+
oMatchingFormContainers = oFormContainer.getFormElements().filter(function(oFormElement) {
|
|
188
|
+
return Object.keys(mFormState).every(function(sFormElementKey) {
|
|
189
|
+
return mFormState[sFormElementKey] === oFormElement.getProperty(sFormElementKey);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
} else {
|
|
193
|
+
oMatchingFormContainers = oFormContainer.getFormElements();
|
|
194
|
+
}
|
|
195
|
+
return oMatchingFormContainers.length === iCount;
|
|
196
|
+
})
|
|
197
|
+
.description(
|
|
198
|
+
Utils.formatMessage(
|
|
199
|
+
"Form Container '{0}' on Form '{1}' has '{2}' Form Elements.",
|
|
200
|
+
aArguments[0],
|
|
201
|
+
sForm,
|
|
202
|
+
aArguments[1]
|
|
203
|
+
)
|
|
204
|
+
)
|
|
205
|
+
.execute()
|
|
206
|
+
);
|
|
178
207
|
};
|
|
179
208
|
return FormAssertions;
|
|
180
209
|
}
|
|
@@ -288,14 +288,12 @@ sap.ui.define(
|
|
|
288
288
|
* Checks a MicroChart shown in the header of an object page.
|
|
289
289
|
*
|
|
290
290
|
* TODO this function will not be public yet: Its signature doesn't fit the framework.
|
|
291
|
-
*
|
|
292
291
|
* @param {object|string} vMicroChartIdentifier Id/Type or Title of MicroChart
|
|
293
|
-
*
|
|
292
|
+
* @param sUoMLabel UoM label of the MicroChart
|
|
294
293
|
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
295
|
-
*
|
|
296
294
|
* @ui5-restricted
|
|
297
295
|
*/
|
|
298
|
-
HeaderAssertions.prototype.iCheckMicroChart = function(vMicroChartIdentifier) {
|
|
296
|
+
HeaderAssertions.prototype.iCheckMicroChart = function(vMicroChartIdentifier, sUoMLabel) {
|
|
299
297
|
var oOpaBuilder = OpaBuilder.create(this.getOpaInstance());
|
|
300
298
|
|
|
301
299
|
if (!Utils.isOfType(vMicroChartIdentifier, String)) {
|
|
@@ -308,16 +306,35 @@ sap.ui.define(
|
|
|
308
306
|
"::" +
|
|
309
307
|
vMicroChartIdentifier.chartType
|
|
310
308
|
);
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
309
|
+
if (sUoMLabel !== undefined) {
|
|
310
|
+
oOpaBuilder.hasAggregationProperties("_uomLabel", { text: sUoMLabel });
|
|
311
|
+
oOpaBuilder.description(
|
|
312
|
+
Utils.formatMessage(
|
|
313
|
+
"Seeing Micro Chart of type '{0}' with identifier '{1}' and UoM Label '{2}'",
|
|
314
|
+
vMicroChartIdentifier.chartType,
|
|
315
|
+
vMicroChartIdentifier.chartId,
|
|
316
|
+
sUoMLabel
|
|
317
|
+
)
|
|
318
|
+
);
|
|
319
|
+
} else {
|
|
320
|
+
oOpaBuilder.description(
|
|
321
|
+
Utils.formatMessage(
|
|
322
|
+
"Seeing Micro Chart of type '{0}' with identifier '{1}'",
|
|
323
|
+
vMicroChartIdentifier.chartType,
|
|
324
|
+
vMicroChartIdentifier.chartId
|
|
325
|
+
)
|
|
326
|
+
);
|
|
327
|
+
}
|
|
318
328
|
} else {
|
|
319
329
|
oOpaBuilder.hasProperties({ chartTitle: vMicroChartIdentifier });
|
|
320
|
-
|
|
330
|
+
if (sUoMLabel !== undefined) {
|
|
331
|
+
oOpaBuilder.hasAggregationProperties("_uomLabel", { text: sUoMLabel });
|
|
332
|
+
oOpaBuilder.description(
|
|
333
|
+
Utils.formatMessage("Seeing Micro Chart with title '{0}' and UoM Label '{1}'", vMicroChartIdentifier, sUoMLabel)
|
|
334
|
+
);
|
|
335
|
+
} else {
|
|
336
|
+
oOpaBuilder.description(Utils.formatMessage("Seeing Micro Chart with title '{0}'", vMicroChartIdentifier));
|
|
337
|
+
}
|
|
321
338
|
}
|
|
322
339
|
return this.prepareResult(oOpaBuilder.execute());
|
|
323
340
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ! SAPUI5
|
|
3
|
+
* (c) Copyright 2009-2021 SAP SE. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
sap.ui.define(["./BaseAPI", "sap/fe/test/Utils", "sap/fe/test/builder/KPIBuilder"], function(BaseAPI, Utils, KPIBuilder) {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Constructs a new KPICardAPI instance.
|
|
10
|
+
*
|
|
11
|
+
* @param {sap.fe.test.builder.KPIBuilder} oKPIBuilder The builder instance used to interact with the UI
|
|
12
|
+
* @returns {sap.fe.test.api.KPICardAPI} The new instance
|
|
13
|
+
* @alias sap.fe.test.api.TableAPI
|
|
14
|
+
* @class
|
|
15
|
+
* @hideconstructor
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
var KPICardAPI = function(oKPIBuilder) {
|
|
19
|
+
if (!Utils.isOfType(oKPIBuilder, KPIBuilder)) {
|
|
20
|
+
throw new Error("oKPIBuilder parameter must be an KPIBuilder instance");
|
|
21
|
+
}
|
|
22
|
+
return BaseAPI.call(this, oKPIBuilder);
|
|
23
|
+
};
|
|
24
|
+
KPICardAPI.prototype = Object.create(BaseAPI.prototype);
|
|
25
|
+
KPICardAPI.prototype.constructor = KPICardAPI;
|
|
26
|
+
|
|
27
|
+
return KPICardAPI;
|
|
28
|
+
});
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ! SAPUI5
|
|
3
|
+
* (c) Copyright 2009-2021 SAP SE. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
sap.ui.define(["./KPICardAPI", "sap/fe/test/Utils", "sap/fe/test/builder/FEBuilder"], function(KPICardAPI, Utils, FEBuilder) {
|
|
6
|
+
"use strict";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Constructs a new TableAssertions instance.
|
|
10
|
+
*
|
|
11
|
+
* @param {sap.fe.test.builder.KPIBuilder} oBuilderInstance The builder instance used to interact with the UI
|
|
12
|
+
* @returns {sap.fe.test.api.KPICardAssertions} The new instance
|
|
13
|
+
* @class
|
|
14
|
+
* @extends sap.fe.test.api.KPICardAPI
|
|
15
|
+
* @hideconstructor
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
var KPICardAssertions = function(oBuilderInstance) {
|
|
19
|
+
return KPICardAPI.call(this, oBuilderInstance);
|
|
20
|
+
};
|
|
21
|
+
KPICardAssertions.prototype = Object.create(KPICardAPI.prototype);
|
|
22
|
+
KPICardAssertions.prototype.constructor = KPICardAssertions;
|
|
23
|
+
KPICardAssertions.prototype.isAction = false;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Checks the title of the KPI Card.
|
|
27
|
+
*
|
|
28
|
+
* @param {string} sTitle The expected title
|
|
29
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
30
|
+
*/
|
|
31
|
+
KPICardAssertions.prototype.iSeeHeaderTitle = function(sTitle) {
|
|
32
|
+
var oKPIBuilder = this.getBuilder();
|
|
33
|
+
var vTitleMatcher = FEBuilder.create(this)
|
|
34
|
+
.hasType("sap.m.Text")
|
|
35
|
+
.has(function(oControl) {
|
|
36
|
+
return oControl.getId().endsWith("-title");
|
|
37
|
+
})
|
|
38
|
+
.hasProperties({ text: sTitle });
|
|
39
|
+
|
|
40
|
+
return this.prepareResult(
|
|
41
|
+
oKPIBuilder
|
|
42
|
+
.doOnKPICardHeader(vTitleMatcher, true)
|
|
43
|
+
.description("Checking card title: " + sTitle)
|
|
44
|
+
.execute()
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Checks the subtitle of the KPI Card.
|
|
50
|
+
*
|
|
51
|
+
* @param {string} sSubtitle The expected title
|
|
52
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
53
|
+
*/
|
|
54
|
+
KPICardAssertions.prototype.iSeeHeaderSubtitle = function(sSubtitle) {
|
|
55
|
+
var oKPIBuilder = this.getBuilder();
|
|
56
|
+
var vTitleMatcher = FEBuilder.create(this)
|
|
57
|
+
.hasType("sap.m.Text")
|
|
58
|
+
.has(function(oControl) {
|
|
59
|
+
return oControl.getId().endsWith("-subtitle");
|
|
60
|
+
})
|
|
61
|
+
.hasProperties({ text: sSubtitle });
|
|
62
|
+
|
|
63
|
+
return this.prepareResult(
|
|
64
|
+
oKPIBuilder
|
|
65
|
+
.doOnKPICardHeader(vTitleMatcher, true)
|
|
66
|
+
.description("Checking card sub-title: " + sSubtitle)
|
|
67
|
+
.execute()
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Checks the unit of the KPI Card.
|
|
73
|
+
*
|
|
74
|
+
* @param {string} sText The expected unit
|
|
75
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
76
|
+
*/
|
|
77
|
+
KPICardAssertions.prototype.iSeeHeaderUnit = function(sText) {
|
|
78
|
+
var oKPIBuilder = this.getBuilder();
|
|
79
|
+
var vTitleMatcher = FEBuilder.create(this)
|
|
80
|
+
.hasType("sap.m.Text")
|
|
81
|
+
.has(function(oControl) {
|
|
82
|
+
return oControl.getId().endsWith("-unitOfMeasurement");
|
|
83
|
+
})
|
|
84
|
+
.hasProperties({ text: sText });
|
|
85
|
+
|
|
86
|
+
return this.prepareResult(
|
|
87
|
+
oKPIBuilder
|
|
88
|
+
.doOnKPICardHeader(vTitleMatcher, true)
|
|
89
|
+
.description("Checking card unit: " + sText)
|
|
90
|
+
.execute()
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Checks the details of the KPI Card.
|
|
96
|
+
*
|
|
97
|
+
* @param {string} sText The expected detail value
|
|
98
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
99
|
+
*/
|
|
100
|
+
KPICardAssertions.prototype.iSeeHeaderDetails = function(sText) {
|
|
101
|
+
var oKPIBuilder = this.getBuilder();
|
|
102
|
+
var vTitleMatcher = FEBuilder.create(this)
|
|
103
|
+
.hasType("sap.m.Text")
|
|
104
|
+
.has(function(oControl) {
|
|
105
|
+
return oControl.getId().endsWith("-details");
|
|
106
|
+
})
|
|
107
|
+
.hasProperties({ text: sText });
|
|
108
|
+
|
|
109
|
+
return this.prepareResult(
|
|
110
|
+
oKPIBuilder
|
|
111
|
+
.doOnKPICardHeader(vTitleMatcher, true)
|
|
112
|
+
.description("Checking card details: " + sText)
|
|
113
|
+
.execute()
|
|
114
|
+
);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Checks the main indicator of the KPI Card.
|
|
119
|
+
*
|
|
120
|
+
* @param {string} sValue The expected value of the indicator
|
|
121
|
+
* @param {object} mStates Additionnal properties to check (indicator, valueColor, scale)
|
|
122
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
123
|
+
*/
|
|
124
|
+
KPICardAssertions.prototype.iSeeHeaderValue = function(sValue, mStates) {
|
|
125
|
+
var oKPIBuilder = this.getBuilder();
|
|
126
|
+
var oProperties = mStates || {};
|
|
127
|
+
oProperties.value = sValue;
|
|
128
|
+
|
|
129
|
+
var vTitleMatcher = FEBuilder.create(this)
|
|
130
|
+
.hasType("sap.m.NumericContent")
|
|
131
|
+
.hasProperties(oProperties);
|
|
132
|
+
|
|
133
|
+
var sDescription = mStates
|
|
134
|
+
? Utils.formatMessage("Checking card header value '{0}' in state '{1}'", sValue, mStates)
|
|
135
|
+
: Utils.formatMessage("Checking card header value '{0}'", sValue);
|
|
136
|
+
return this.prepareResult(
|
|
137
|
+
oKPIBuilder
|
|
138
|
+
.doOnKPICardHeader(vTitleMatcher, true)
|
|
139
|
+
.description("Checking card header: " + sDescription)
|
|
140
|
+
.execute()
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Checks a side indicator of the KPI Card.
|
|
146
|
+
*
|
|
147
|
+
* @param {string} sTitle The expected title of the side indicator
|
|
148
|
+
* @param {string} sValue The expected value of the side indicator
|
|
149
|
+
* @param {string} sUnit The expected unit of the side indicator
|
|
150
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
151
|
+
*/
|
|
152
|
+
KPICardAssertions.prototype.iSeeSideIndicator = function(sTitle, sValue, sUnit) {
|
|
153
|
+
var oKPIBuilder = this.getBuilder();
|
|
154
|
+
|
|
155
|
+
var vIndicatorMatcher = FEBuilder.create(this)
|
|
156
|
+
.hasType("sap.f.cards.NumericSideIndicator")
|
|
157
|
+
.hasChildren(
|
|
158
|
+
FEBuilder.create(this)
|
|
159
|
+
.hasType("sap.m.Text")
|
|
160
|
+
.hasProperties({ text: sTitle })
|
|
161
|
+
)
|
|
162
|
+
.hasChildren(
|
|
163
|
+
FEBuilder.create(this)
|
|
164
|
+
.hasType("sap.m.Text")
|
|
165
|
+
.hasProperties({ text: sValue })
|
|
166
|
+
)
|
|
167
|
+
.hasChildren(
|
|
168
|
+
FEBuilder.create(this)
|
|
169
|
+
.hasType("sap.m.Text")
|
|
170
|
+
.hasProperties({ text: sUnit })
|
|
171
|
+
);
|
|
172
|
+
|
|
173
|
+
return this.prepareResult(
|
|
174
|
+
oKPIBuilder
|
|
175
|
+
.doOnKPICardHeader(vIndicatorMatcher, true)
|
|
176
|
+
.description("Checking card side indicator: " + sTitle + " - " + sValue + " - " + sUnit)
|
|
177
|
+
.execute()
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Checks the chart of the KPI card.
|
|
183
|
+
*
|
|
184
|
+
* @param {object} mProperties The properties to be checked on the chart (vizType). If null or empty, we just check if the chart is visible.
|
|
185
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
186
|
+
*/
|
|
187
|
+
KPICardAssertions.prototype.iSeeChart = function(mProperties) {
|
|
188
|
+
var oKPIBuilder = this.getBuilder();
|
|
189
|
+
|
|
190
|
+
var vChartMatcher = mProperties && Object.keys(mProperties).length ? FEBuilder.create(this).hasProperties(mProperties) : undefined;
|
|
191
|
+
|
|
192
|
+
var sDescription = vChartMatcher
|
|
193
|
+
? Utils.formatMessage("Checking card chart with properties '{0}'", mProperties)
|
|
194
|
+
: Utils.formatMessage("Checking card chart");
|
|
195
|
+
|
|
196
|
+
return this.prepareResult(
|
|
197
|
+
oKPIBuilder
|
|
198
|
+
.doOnKPICardChart(vChartMatcher)
|
|
199
|
+
.description(sDescription)
|
|
200
|
+
.execute()
|
|
201
|
+
);
|
|
202
|
+
};
|
|
203
|
+
return KPICardAssertions;
|
|
204
|
+
});
|
|
@@ -597,7 +597,7 @@ sap.ui.define(
|
|
|
597
597
|
};
|
|
598
598
|
|
|
599
599
|
/**
|
|
600
|
-
* Selects the variant
|
|
600
|
+
* Selects the chosen variant.
|
|
601
601
|
*
|
|
602
602
|
* @param {string} sVariantName The name of the variant to be selected
|
|
603
603
|
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
@@ -838,6 +838,41 @@ sap.ui.define(
|
|
|
838
838
|
);
|
|
839
839
|
};
|
|
840
840
|
|
|
841
|
+
/**
|
|
842
|
+
* Changes the search field.
|
|
843
|
+
*
|
|
844
|
+
* @param {string} [sSearchText] The new search text
|
|
845
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
846
|
+
*
|
|
847
|
+
* @public
|
|
848
|
+
*/
|
|
849
|
+
Actions.prototype.iChangeSearchField = function(sSearchText) {
|
|
850
|
+
return this.prepareResult(
|
|
851
|
+
this.getBuilder()
|
|
852
|
+
.doChangeSearch(sSearchText)
|
|
853
|
+
.description(
|
|
854
|
+
Utils.formatMessage("Changing the search text on table '{0}' to '{1}'", this.getIdentifier(), sSearchText || "")
|
|
855
|
+
)
|
|
856
|
+
.execute()
|
|
857
|
+
);
|
|
858
|
+
};
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Resets the search field.
|
|
862
|
+
*
|
|
863
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
864
|
+
*
|
|
865
|
+
* @public
|
|
866
|
+
*/
|
|
867
|
+
Actions.prototype.iResetSearchField = function() {
|
|
868
|
+
return this.prepareResult(
|
|
869
|
+
this.getBuilder()
|
|
870
|
+
.doResetSearch()
|
|
871
|
+
.description(Utils.formatMessage("Resetting the search field on table '{0}'", this.getIdentifier()))
|
|
872
|
+
.execute()
|
|
873
|
+
);
|
|
874
|
+
};
|
|
875
|
+
|
|
841
876
|
/**
|
|
842
877
|
* Adds a filter condition to the filter field.
|
|
843
878
|
*
|
|
@@ -903,6 +938,20 @@ sap.ui.define(
|
|
|
903
938
|
);
|
|
904
939
|
};
|
|
905
940
|
|
|
941
|
+
/**
|
|
942
|
+
* Presses the messageStrip filter in case of issues, warnings or error message on the table.
|
|
943
|
+
*
|
|
944
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
945
|
+
*
|
|
946
|
+
* @public
|
|
947
|
+
* @ui5-restricted
|
|
948
|
+
*/
|
|
949
|
+
Actions.prototype.iClickOnMessageStripFilter = function() {
|
|
950
|
+
return this.getBuilder()
|
|
951
|
+
.doClickOnMessageStripFilter()
|
|
952
|
+
.execute();
|
|
953
|
+
};
|
|
954
|
+
|
|
906
955
|
return Actions;
|
|
907
956
|
}
|
|
908
957
|
);
|
|
@@ -316,6 +316,33 @@ sap.ui.define(
|
|
|
316
316
|
return this.iCheckAction({ service: "StandardAction", action: "Delete", unbound: true }, mState);
|
|
317
317
|
};
|
|
318
318
|
|
|
319
|
+
/**
|
|
320
|
+
* Checks the search field in the table toolbar. If the <code>sSearchText</code> parameter is <code>undefined</code>, the search text is not validated.
|
|
321
|
+
*
|
|
322
|
+
* @param {string} [sSearchText] The expected text in the search field
|
|
323
|
+
* @param {object} [mState] Defines the expected state of the search field
|
|
324
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function that can be used for chaining statements
|
|
325
|
+
*
|
|
326
|
+
* @public
|
|
327
|
+
*/
|
|
328
|
+
TableAssertions.prototype.iCheckSearchField = function(sSearchText, mState) {
|
|
329
|
+
var aArguments = Utils.parseArguments([String, Object], arguments),
|
|
330
|
+
oTableBuilder = this.getBuilder();
|
|
331
|
+
return this.prepareResult(
|
|
332
|
+
oTableBuilder
|
|
333
|
+
.hasSearchField(sSearchText, mState)
|
|
334
|
+
.description(
|
|
335
|
+
Utils.formatMessage(
|
|
336
|
+
"Checking the search field on table '{0}' having search text '{1}' and state='{2}'",
|
|
337
|
+
this.getIdentifier(),
|
|
338
|
+
aArguments[0] || "",
|
|
339
|
+
aArguments[1]
|
|
340
|
+
)
|
|
341
|
+
)
|
|
342
|
+
.execute()
|
|
343
|
+
);
|
|
344
|
+
};
|
|
345
|
+
|
|
319
346
|
/**
|
|
320
347
|
* Checks the <code>Create</code> action of the table.
|
|
321
348
|
*
|
|
@@ -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
|
|
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
|
-
* @
|
|
25
|
+
* @private
|
|
26
26
|
* @ui5-restricted
|
|
27
27
|
*/
|
|
28
|
-
KPIBuilder.prototype.
|
|
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
|
|
|
@@ -534,6 +571,18 @@ sap.ui.define(
|
|
|
534
571
|
return this.doOpenOverflow().success(oSuccessBuilder);
|
|
535
572
|
};
|
|
536
573
|
|
|
574
|
+
TableBuilder.prototype.doClickOnMessageStripFilter = function() {
|
|
575
|
+
return this.do(function(oMdcTable) {
|
|
576
|
+
var oLink = oMdcTable.getDataStateIndicator()._oLink;
|
|
577
|
+
return OpaBuilder.create()
|
|
578
|
+
.hasType("sap.m.Link")
|
|
579
|
+
.hasId(oLink.getId())
|
|
580
|
+
.description("Press the messageStrip filter on Table")
|
|
581
|
+
.doPress()
|
|
582
|
+
.execute();
|
|
583
|
+
});
|
|
584
|
+
};
|
|
585
|
+
|
|
537
586
|
TableBuilder.prototype.hasShowHideDetails = function() {
|
|
538
587
|
return _createTableInternalButtonBuilder(this, "showHideDetails", false);
|
|
539
588
|
};
|