@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.
- package/package.json +2 -2
- package/src/sap/fe/test/.library +1 -1
- package/src/sap/fe/test/Flexibility.js +33 -8
- package/src/sap/fe/test/JestTemplatingHelper.js +32 -7
- package/src/sap/fe/test/JestTemplatingHelper.ts +23 -6
- package/src/sap/fe/test/ListReport.js +20 -3
- package/src/sap/fe/test/ObjectPage.js +52 -0
- package/src/sap/fe/test/Shell.js +16 -11
- package/src/sap/fe/test/TemplatePage.js +48 -0
- package/src/sap/fe/test/UI5MockHelper.js +218 -0
- package/src/sap/fe/test/UI5MockHelper.ts +137 -0
- package/src/sap/fe/test/Utils.js +5 -1
- package/src/sap/fe/test/api/BaseAPI.js +10 -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 +82 -37
- package/src/sap/fe/test/api/DialogActions.js +27 -0
- package/src/sap/fe/test/api/DialogAssertions.js +33 -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/FilterBarActions.js +21 -15
- 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/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 +49 -0
- 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 +63 -0
- package/src/sap/fe/test/library.js +1 -1
- package/src/sap/fe/test/massEdit.js +33 -16
|
@@ -85,5 +85,38 @@ sap.ui.define(["./DialogAPI", "sap/fe/test/Utils"], function(DialogAPI, Utils) {
|
|
|
85
85
|
);
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Checks the content and state of a field in an action parameter dialog.
|
|
90
|
+
*
|
|
91
|
+
* @param {sap.fe.test.api.ActionDialogFieldIdentifier} vFieldIdentifier The identifier of the field
|
|
92
|
+
* @param {string | Array | object} [vValue] Expected value(s) of the field.
|
|
93
|
+
* if passed as an object, the following pattern will be considered:
|
|
94
|
+
* <code><pre>
|
|
95
|
+
* {
|
|
96
|
+
* value: <string>, // optional
|
|
97
|
+
* }
|
|
98
|
+
* </pre></code>
|
|
99
|
+
* @param {object} [mState] Defines the expected state of the field
|
|
100
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
101
|
+
* @public
|
|
102
|
+
*/
|
|
103
|
+
DialogAssertions.prototype.iCheckActionParameterDialogField = function(vFieldIdentifier, vValue, mState) {
|
|
104
|
+
var aArguments = Utils.parseArguments([Object, [String, Array, Object], Object], arguments);
|
|
105
|
+
return this.prepareResult(
|
|
106
|
+
this._createFieldBuilder(vFieldIdentifier)
|
|
107
|
+
.hasValue(aArguments[1])
|
|
108
|
+
.hasState(aArguments[2])
|
|
109
|
+
.description(
|
|
110
|
+
Utils.formatMessage(
|
|
111
|
+
"Checking field '{0}' with content '{1}' and state '{2}'",
|
|
112
|
+
aArguments[0],
|
|
113
|
+
aArguments[1],
|
|
114
|
+
aArguments[2]
|
|
115
|
+
)
|
|
116
|
+
)
|
|
117
|
+
.execute()
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
|
|
88
121
|
return DialogAssertions;
|
|
89
122
|
});
|
|
@@ -33,7 +33,9 @@ sap.ui.define(["./DialogActions", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"]
|
|
|
33
33
|
DialogCreateActions.prototype.iExecuteCreate = function() {
|
|
34
34
|
return this.prepareResult(
|
|
35
35
|
this.getBuilder()
|
|
36
|
-
.doPressFooterButton(
|
|
36
|
+
.doPressFooterButton(
|
|
37
|
+
OpaBuilder.Matchers.resourceBundle("text", "sap.fe.core", "C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON")
|
|
38
|
+
)
|
|
37
39
|
.description(Utils.formatMessage("Pressing create button on dialog '{0}'", this.getIdentifier()))
|
|
38
40
|
.execute()
|
|
39
41
|
);
|
|
@@ -40,7 +40,7 @@ sap.ui.define(["./DialogAssertions", "sap/ui/test/OpaBuilder", "sap/fe/test/buil
|
|
|
40
40
|
return this.prepareResult(
|
|
41
41
|
this.getBuilder()
|
|
42
42
|
.hasFooterButton(
|
|
43
|
-
OpaBuilder.Matchers.resourceBundle("text", "sap.fe.core", "
|
|
43
|
+
OpaBuilder.Matchers.resourceBundle("text", "sap.fe.core", "C_TRANSACTION_HELPER_SAPFE_ACTION_CREATE_BUTTON"),
|
|
44
44
|
mState
|
|
45
45
|
)
|
|
46
46
|
.description(
|
|
@@ -268,19 +268,9 @@ sap.ui.define(
|
|
|
268
268
|
return this.prepareResult(
|
|
269
269
|
OpaBuilder.create(this)
|
|
270
270
|
.hasType("sap.fe.core.controls.filterbar.VisualFilter")
|
|
271
|
-
.
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
if (
|
|
275
|
-
aVisualFilters[i]
|
|
276
|
-
.getParent()
|
|
277
|
-
.getId()
|
|
278
|
-
.indexOf("FilterField::" + sVisualFilterIdentifier) > -1
|
|
279
|
-
) {
|
|
280
|
-
oVisualFilter = aVisualFilters[i];
|
|
281
|
-
break;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
271
|
+
.hasId(new RegExp(sVisualFilterIdentifier, "i"))
|
|
272
|
+
.success(function(aVisualFilter) {
|
|
273
|
+
var oVisualFilter = aVisualFilter[0];
|
|
284
274
|
var selectItem;
|
|
285
275
|
var oInteractiveChart = oVisualFilter.getItems()[1].getItems()[0];
|
|
286
276
|
var aItems =
|
|
@@ -309,12 +299,28 @@ sap.ui.define(
|
|
|
309
299
|
selected: bIsSelected
|
|
310
300
|
});
|
|
311
301
|
}
|
|
312
|
-
}
|
|
302
|
+
})
|
|
313
303
|
.description("Selecting an item in " + sVisualFilterIdentifier + " VisualFilter")
|
|
314
304
|
.execute()
|
|
315
305
|
);
|
|
316
306
|
};
|
|
317
|
-
|
|
307
|
+
FilterBarActions.prototype.iOpenVisualFilterValueHelp = function(sVisualFilterIdentifier) {
|
|
308
|
+
return this.prepareResult(
|
|
309
|
+
OpaBuilder.create(this)
|
|
310
|
+
.hasType("sap.fe.core.controls.filterbar.VisualFilter")
|
|
311
|
+
.hasId(new RegExp(sVisualFilterIdentifier, "i"))
|
|
312
|
+
.success(function(aVisualFilter) {
|
|
313
|
+
var sVFId = aVisualFilter[0].getId();
|
|
314
|
+
OpaBuilder.create(this)
|
|
315
|
+
.hasType("sap.m.Button")
|
|
316
|
+
.hasId(sVFId + "::VisualFilterValueHelpButton")
|
|
317
|
+
.doPress()
|
|
318
|
+
.execute();
|
|
319
|
+
})
|
|
320
|
+
.description("Open ValueHelp Dialog " + sVisualFilterIdentifier + " VisualFilter")
|
|
321
|
+
.execute()
|
|
322
|
+
);
|
|
323
|
+
};
|
|
318
324
|
return FilterBarActions;
|
|
319
325
|
}
|
|
320
326
|
);
|
|
@@ -270,9 +270,11 @@ sap.ui.define(
|
|
|
270
270
|
.getItems()[0]
|
|
271
271
|
.getItems()[0]
|
|
272
272
|
.getContent()[1];
|
|
273
|
+
var sScaleUOMTitleText = sScaleUOMTitle ? sScaleUOMTitle.getText() : " | ";
|
|
273
274
|
return (
|
|
274
275
|
sTitle ===
|
|
275
|
-
sMeasureDimensionTitle.getText() +
|
|
276
|
+
sMeasureDimensionTitle.getText() +
|
|
277
|
+
(sScaleUOMTitleText === " " || sScaleUOMTitleText === " | " ? "" : sScaleUOMTitle.getText()) &&
|
|
276
278
|
sToolTip === sMeasureDimensionTitle.getTooltip()
|
|
277
279
|
);
|
|
278
280
|
})
|
|
@@ -281,6 +283,35 @@ sap.ui.define(
|
|
|
281
283
|
);
|
|
282
284
|
};
|
|
283
285
|
|
|
286
|
+
FilterBarAssertions.prototype.iCheckVisualFilterValueHelp = function(sVisualFilterIdentifier, iCount) {
|
|
287
|
+
return this.prepareResult(
|
|
288
|
+
OpaBuilder.create(this)
|
|
289
|
+
.hasType("sap.fe.core.controls.filterbar.VisualFilter")
|
|
290
|
+
.check(function(aVisualFilters) {
|
|
291
|
+
var oVisualFilter;
|
|
292
|
+
for (var i = 0; i < aVisualFilters.length; i++) {
|
|
293
|
+
if (
|
|
294
|
+
aVisualFilters[i]
|
|
295
|
+
.getParent()
|
|
296
|
+
.getId()
|
|
297
|
+
.indexOf("FilterField::" + sVisualFilterIdentifier) > -1
|
|
298
|
+
) {
|
|
299
|
+
oVisualFilter = aVisualFilters[i];
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
var sValueHelp = oVisualFilter
|
|
304
|
+
.getItems()[0]
|
|
305
|
+
.getItems()[0]
|
|
306
|
+
.getContent()[3];
|
|
307
|
+
var sValueHelpCount = sValueHelp ? sValueHelp.getText() : undefined;
|
|
308
|
+
return sValueHelp && sValueHelpCount === iCount;
|
|
309
|
+
})
|
|
310
|
+
.description("Checking Value Help and its count of " + sVisualFilterIdentifier + " VisualFilter")
|
|
311
|
+
.execute()
|
|
312
|
+
);
|
|
313
|
+
};
|
|
314
|
+
|
|
284
315
|
FilterBarAssertions.prototype.iCheckVisualFilterCriticality = function(sVisualFilterIdentifier, sLabelValue, sCriticality) {
|
|
285
316
|
return this.prepareResult(
|
|
286
317
|
OpaBuilder.create(this)
|
|
@@ -350,7 +381,7 @@ sap.ui.define(
|
|
|
350
381
|
);
|
|
351
382
|
};
|
|
352
383
|
|
|
353
|
-
FilterBarAssertions.prototype.
|
|
384
|
+
FilterBarAssertions.prototype.iCheckErrorMessageAndTitle = function(sVisualFilterIdentifier, sErrorMessage, sErrorMessageTitle) {
|
|
354
385
|
return this.prepareResult(
|
|
355
386
|
OpaBuilder.create(this)
|
|
356
387
|
.hasType("sap.fe.core.controls.filterbar.VisualFilter")
|
|
@@ -367,11 +398,12 @@ sap.ui.define(
|
|
|
367
398
|
break;
|
|
368
399
|
}
|
|
369
400
|
}
|
|
370
|
-
var
|
|
371
|
-
var sText =
|
|
372
|
-
|
|
401
|
+
var oInteractiveChart = oVisualFilter.getItems()[1].getItems()[0];
|
|
402
|
+
var sText = oInteractiveChart.getErrorMessage();
|
|
403
|
+
var sTitle = oInteractiveChart.getErrorMessageTitle();
|
|
404
|
+
return sText === sErrorMessage && sTitle === sErrorMessageTitle;
|
|
373
405
|
})
|
|
374
|
-
.description("Checking
|
|
406
|
+
.description("Checking error message and title of " + sVisualFilterIdentifier + " VisualFilter")
|
|
375
407
|
.execute()
|
|
376
408
|
);
|
|
377
409
|
};
|
|
@@ -3,8 +3,15 @@
|
|
|
3
3
|
* (c) Copyright 2009-2021 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
sap.ui.define(
|
|
6
|
-
[
|
|
7
|
-
|
|
6
|
+
[
|
|
7
|
+
"./FormAPI",
|
|
8
|
+
"sap/fe/test/Utils",
|
|
9
|
+
"sap/ui/test/OpaBuilder",
|
|
10
|
+
"sap/fe/test/builder/FEBuilder",
|
|
11
|
+
"sap/fe/test/builder/MacroFieldBuilder",
|
|
12
|
+
"sap/fe/test/builder/OverflowToolbarBuilder"
|
|
13
|
+
],
|
|
14
|
+
function(FormAPI, Utils, OpaBuilder, FEBuilder, MacroFieldBuilder, OverflowToolbarBuilder) {
|
|
8
15
|
"use strict";
|
|
9
16
|
|
|
10
17
|
/**
|
|
@@ -59,13 +66,30 @@ sap.ui.define(
|
|
|
59
66
|
* @public
|
|
60
67
|
*/
|
|
61
68
|
FormActions.prototype.iExecuteAction = function(vActionIdentifier) {
|
|
62
|
-
var oFormBuilder = this.getBuilder()
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
var oFormBuilder = this.getBuilder(),
|
|
70
|
+
vFormDescription = this.getIdentifier(),
|
|
71
|
+
sFormContainerId;
|
|
72
|
+
if (vFormDescription.fieldGroupId === undefined) {
|
|
73
|
+
// Action Button in Section Header
|
|
74
|
+
return this.prepareResult(
|
|
75
|
+
oFormBuilder
|
|
76
|
+
.doOnAggregation("actions", this.createActionMatcher(vActionIdentifier), OpaBuilder.Actions.press())
|
|
77
|
+
.description(Utils.formatMessage("Pressing action '{1}' on form '{0}'", this.getIdentifier(), vActionIdentifier))
|
|
78
|
+
.execute()
|
|
79
|
+
);
|
|
80
|
+
} else {
|
|
81
|
+
// Action Button in Form Container Toolbar ("Inline Action")
|
|
82
|
+
sFormContainerId =
|
|
83
|
+
vFormDescription.fullSubSectionId.substring(0, vFormDescription.fullSubSectionId.indexOf("--")) +
|
|
84
|
+
"--" +
|
|
85
|
+
vFormDescription.fieldGroupId;
|
|
86
|
+
return this.prepareResult(
|
|
87
|
+
OverflowToolbarBuilder.create(this)
|
|
88
|
+
.hasId(sFormContainerId + "::FormActionsToolbar")
|
|
89
|
+
.doOnContent(this.createActionMatcher(vActionIdentifier))
|
|
90
|
+
.execute()
|
|
91
|
+
);
|
|
92
|
+
}
|
|
69
93
|
};
|
|
70
94
|
|
|
71
95
|
/**
|
|
@@ -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
|
+
});
|
|
@@ -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
|
*
|