@sapui5/sap.fe.test 1.142.2 → 1.144.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 +1 -1
- package/src/sap/fe/test/.library +1 -1
- package/src/sap/fe/test/BaseActions.js +6 -6
- package/src/sap/fe/test/BaseArrangements.js +20 -9
- package/src/sap/fe/test/BaseAssertions.js +4 -4
- package/src/sap/fe/test/JestTemplatingHelper.js +97 -14
- package/src/sap/fe/test/JestTemplatingHelper.tsx +141 -15
- package/src/sap/fe/test/UI5MockHelper.js +6 -2
- package/src/sap/fe/test/UI5MockHelper.ts +10 -1
- package/src/sap/fe/test/api/APIHelper.js +38 -21
- package/src/sap/fe/test/api/BaseAPI.js +1 -1
- package/src/sap/fe/test/api/TableAPI.js +2 -2
- package/src/sap/fe/test/builder/FEBuilder.js +1 -1
- package/src/sap/fe/test/builder/MdcTableBuilder.js +1 -1
- package/src/sap/fe/test/builder/OverflowToolbarBuilder.js +1 -1
- package/src/sap/fe/test/internal/FEArrangements.js +0 -40
- package/src/sap/fe/test/library.js +1 -1
|
@@ -47,28 +47,45 @@ sap.ui.define(["sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/build
|
|
|
47
47
|
createMenuAndListActionMatcher: function (vAction, bReturnAction) {
|
|
48
48
|
var vActionMatcher;
|
|
49
49
|
if (Utils.isOfType(vAction, String)) {
|
|
50
|
-
vAction = { text: vAction };
|
|
50
|
+
vAction = { text: vAction, title: vAction };
|
|
51
51
|
}
|
|
52
|
-
if (Utils.isOfType(vAction, Object)) {
|
|
53
|
-
if (vAction.visible === false) {
|
|
54
|
-
var mStatesWOVisible = Object.assign(vAction);
|
|
55
|
-
delete mStatesWOVisible.visible;
|
|
56
|
-
vActionMatcher = OpaBuilder.Matchers.some(
|
|
57
|
-
// either button is visible=false ...
|
|
58
|
-
OpaBuilder.Matchers.aggregationMatcher("items", FEBuilder.Matchers.states(vAction)),
|
|
59
|
-
// ... or it wasn't rendered at all (no match in the aggregation)
|
|
60
|
-
OpaBuilder.Matchers.not(
|
|
61
|
-
OpaBuilder.Matchers.aggregationMatcher("items", FEBuilder.Matchers.states(mStatesWOVisible))
|
|
62
|
-
)
|
|
63
|
-
);
|
|
64
|
-
} else {
|
|
65
|
-
vActionMatcher = bReturnAction
|
|
66
|
-
? [OpaBuilder.Matchers.aggregation("items", FEBuilder.Matchers.states(vAction)), FEBuilder.Matchers.atIndex(0)]
|
|
67
|
-
: OpaBuilder.Matchers.aggregationMatcher("items", FEBuilder.Matchers.states(vAction));
|
|
68
|
-
}
|
|
69
|
-
} else {
|
|
52
|
+
if (!Utils.isOfType(vAction, Object)) {
|
|
70
53
|
throw new Error("vAction parameter must be a string or object");
|
|
71
54
|
}
|
|
55
|
+
if (vAction.text && !vAction.title) {
|
|
56
|
+
vAction = Object.assign({}, vAction, { title: vAction.text });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var mText = Object.assign({}, vAction);
|
|
60
|
+
var mTitle = Object.assign({}, vAction);
|
|
61
|
+
|
|
62
|
+
delete mText.title;
|
|
63
|
+
delete mTitle.text;
|
|
64
|
+
|
|
65
|
+
var itemStateMatcher = OpaBuilder.Matchers.some(FEBuilder.Matchers.states(mText), FEBuilder.Matchers.states(mTitle));
|
|
66
|
+
|
|
67
|
+
if (vAction.visible === false) {
|
|
68
|
+
var mTextNoVis = Object.assign({}, mText);
|
|
69
|
+
delete mTextNoVis.visible;
|
|
70
|
+
|
|
71
|
+
var mTitleNoVis = Object.assign({}, mTitle);
|
|
72
|
+
delete mTitleNoVis.visible;
|
|
73
|
+
|
|
74
|
+
var itemStateMatcherNoVis = OpaBuilder.Matchers.some(
|
|
75
|
+
FEBuilder.Matchers.states(mTextNoVis),
|
|
76
|
+
FEBuilder.Matchers.states(mTitleNoVis)
|
|
77
|
+
);
|
|
78
|
+
vActionMatcher = OpaBuilder.Matchers.some(
|
|
79
|
+
// either it is visible=false...
|
|
80
|
+
OpaBuilder.Matchers.aggregationMatcher("items", itemStateMatcher),
|
|
81
|
+
// ...or it wasn't rendered at all
|
|
82
|
+
OpaBuilder.Matchers.not(OpaBuilder.Matchers.aggregationMatcher("items", itemStateMatcherNoVis))
|
|
83
|
+
);
|
|
84
|
+
} else {
|
|
85
|
+
vActionMatcher = bReturnAction
|
|
86
|
+
? [OpaBuilder.Matchers.aggregation("items", itemStateMatcher), FEBuilder.Matchers.atIndex(0)]
|
|
87
|
+
: OpaBuilder.Matchers.aggregationMatcher("items", itemStateMatcher);
|
|
88
|
+
}
|
|
72
89
|
return vActionMatcher;
|
|
73
90
|
},
|
|
74
91
|
|
|
@@ -103,11 +120,11 @@ sap.ui.define(["sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/build
|
|
|
103
120
|
}
|
|
104
121
|
|
|
105
122
|
return FEBuilder.create()
|
|
106
|
-
.hasType("sap.m.
|
|
123
|
+
.hasType("sap.m.List")
|
|
107
124
|
.isDialogElement(true)
|
|
108
125
|
.has(APIHelper.createMenuAndListActionMatcher(vAction, true))
|
|
109
126
|
.doPress()
|
|
110
|
-
.description(Utils.formatMessage("Executing action '{0}' from currently open
|
|
127
|
+
.description(Utils.formatMessage("Executing action '{0}' from currently open list", vAction));
|
|
111
128
|
}
|
|
112
129
|
};
|
|
113
130
|
|
|
@@ -117,7 +117,7 @@ sap.ui.define(
|
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
119
|
* Gets a new builder instance based on the given one.
|
|
120
|
-
* @returns {sap
|
|
120
|
+
* @returns {module:sap/ui/test/OpaBuilder} An OpaBuilder instance
|
|
121
121
|
* @public
|
|
122
122
|
* @ui5-restricted
|
|
123
123
|
*/
|
|
@@ -255,7 +255,7 @@ sap.ui.define(
|
|
|
255
255
|
* </pre></code>
|
|
256
256
|
* @param {Function|Array|sap.ui.test.actions.Action} [vActions] The actions to be executed on found field
|
|
257
257
|
* @param {string} sDescription The description of the check or adaptation
|
|
258
|
-
* @param {sap
|
|
258
|
+
* @param {module:sap/ui/test/OpaBuilder} oDialogBuilder The dialog builder
|
|
259
259
|
* @param {Function} fnOpenDialog A callback for opening the dialog
|
|
260
260
|
* @param {Function} fnCloseDialog A callback for closing the dialog
|
|
261
261
|
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
@@ -344,7 +344,7 @@ sap.ui.define(
|
|
|
344
344
|
* </pre></code>
|
|
345
345
|
* @param {Function|Array|sap.ui.test.actions.Action} [vActions] The actions to be executed on found field
|
|
346
346
|
* @param {string} sDescription The description of the check or adaptation
|
|
347
|
-
* @param {sap
|
|
347
|
+
* @param {module:sap/ui/test/OpaBuilder} oDialogBuilder The dialog builder
|
|
348
348
|
* @param {Function} fnOpenDialog A callback for opening the dialog
|
|
349
349
|
* @param {Function} fnCloseDialog A callback for closing the dialog
|
|
350
350
|
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
@@ -117,7 +117,7 @@ sap.ui.define(
|
|
|
117
117
|
* Remark: Currently there is no official API to retrieve this button; an alternative way to achieve the same
|
|
118
118
|
* result might be to check oMenuButton.getButtonMode() === "Split" && oMenuButton.getUseDefaultActionOnly()
|
|
119
119
|
* first, and then call oMenuButton.fireDefaultAction(), but the interface parameter vContentAction expects
|
|
120
|
-
* a sap.m.
|
|
120
|
+
* a sap.m.Button nonetheless. Hence, we currently use the internal aggregation names as a workaround.
|
|
121
121
|
*/
|
|
122
122
|
return oMenuButton.getAggregation("_button")
|
|
123
123
|
? oMenuButton.getAggregation("_button").getAggregation("_textButton")
|
|
@@ -709,7 +709,7 @@ sap.ui.define(
|
|
|
709
709
|
* Remark: Currently there is no official API to retrieve this button; an alternative way to achieve the same
|
|
710
710
|
* result might be to check oMenuButton.getButtonMode() === "Split" && oMenuButton.getUseDefaultActionOnly()
|
|
711
711
|
* first, and then call oMenuButton.fireDefaultAction(), but the interface parameter vAction expects
|
|
712
|
-
* a sap.m.
|
|
712
|
+
* a sap.m.Button nonetheless. Hence, we currently use the internal aggregation names as a workaround.
|
|
713
713
|
*/
|
|
714
714
|
return oMenuButton.getAggregation("_button")
|
|
715
715
|
? oMenuButton.getAggregation("_button").getAggregation("_textButton")
|
|
@@ -80,7 +80,7 @@ sap.ui.define(
|
|
|
80
80
|
* Remark: Currently there is no official API to retrieve this button; an alternative way to achieve the same
|
|
81
81
|
* result might be to check oMenuButton.getButtonMode() === "Split" && oMenuButton.getUseDefaultActionOnly()
|
|
82
82
|
* first, and then call oMenuButton.fireDefaultAction(), but the interface parameter vContentAction expects
|
|
83
|
-
* a sap.m.
|
|
83
|
+
* a sap.m.Button nonetheless. Hence, we currently use the internal aggregation names as a workaround.
|
|
84
84
|
*/
|
|
85
85
|
return oMenuButton.getAggregation("_button")
|
|
86
86
|
? oMenuButton.getAggregation("_button").getAggregation("_textButton")
|
|
@@ -29,46 +29,6 @@ sap.ui.define(
|
|
|
29
29
|
)
|
|
30
30
|
);
|
|
31
31
|
},
|
|
32
|
-
|
|
33
|
-
iResetTestData: function (bIgnoreRedeploy) {
|
|
34
|
-
var that = this,
|
|
35
|
-
oUriParams = new URLSearchParams(window.location.search),
|
|
36
|
-
sBackendUrl = oUriParams.get("useBackendUrl"),
|
|
37
|
-
sProxyPrefix = sBackendUrl ? "/databinding/proxy/" + sBackendUrl.replace("://", "/") : "",
|
|
38
|
-
bSuccess = false;
|
|
39
|
-
var sTenantID = "";
|
|
40
|
-
if (window.__karma__ && window.__karma__.config && window.__karma__.config.ui5) {
|
|
41
|
-
sTenantID = window.__karma__.config.ui5.shardIndex;
|
|
42
|
-
} else {
|
|
43
|
-
sTenantID = window.location.href.includes("sap-client")
|
|
44
|
-
? new URL(window.location.href).searchParams.get("sap-client")
|
|
45
|
-
: "default";
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
return OpaBuilder.create(this)
|
|
49
|
-
.success(function () {
|
|
50
|
-
var oResetData = that.resetTestData(),
|
|
51
|
-
oRedeploy = bIgnoreRedeploy ? Promise.resolve() : jQuery.post(sProxyPrefix + "/redeploy?tenant=" + sTenantID);
|
|
52
|
-
|
|
53
|
-
Promise.all([oResetData, oRedeploy])
|
|
54
|
-
.finally(function () {
|
|
55
|
-
bSuccess = true;
|
|
56
|
-
})
|
|
57
|
-
.catch(function (oError) {
|
|
58
|
-
throw oError;
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
return OpaBuilder.create(this)
|
|
62
|
-
.timeout(60) // allow some time (redeployment on the Java stack is slow)
|
|
63
|
-
.check(function () {
|
|
64
|
-
return bSuccess;
|
|
65
|
-
})
|
|
66
|
-
.execute();
|
|
67
|
-
})
|
|
68
|
-
.description(Utils.formatMessage("Reset test data on tenant '{0}'", sTenantID))
|
|
69
|
-
.execute();
|
|
70
|
-
},
|
|
71
|
-
|
|
72
32
|
/**
|
|
73
33
|
* Fail the test if there are errors logged to the browser console.
|
|
74
34
|
* @param {Array<RegExp|string>} [aErrors] The allowed error messages. Either use regular expressions or strings. Pass undefined or an empty array to reject all error messages.
|
|
@@ -22,7 +22,7 @@ sap.ui.define(["sap/ui/core/Lib", "sap/ui/core/library"], function (Library, _li
|
|
|
22
22
|
controls: [],
|
|
23
23
|
elements: [],
|
|
24
24
|
// eslint-disable-next-line no-template-curly-in-string
|
|
25
|
-
version: "1.
|
|
25
|
+
version: "1.144.0",
|
|
26
26
|
noLibraryCSS: true
|
|
27
27
|
});
|
|
28
28
|
return thisLib;
|