@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
package/package.json
CHANGED
package/src/sap/fe/test/.library
CHANGED
|
@@ -21,7 +21,7 @@ sap.ui.define(
|
|
|
21
21
|
*
|
|
22
22
|
* NOTE: This function ensures that a certain UI state is maintained in some exceptional cases.
|
|
23
23
|
* This function isn't usually called directly in a journey.
|
|
24
|
-
* @returns {sap
|
|
24
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
25
25
|
* @function
|
|
26
26
|
* @name sap.fe.test.BaseActions#iClosePopover
|
|
27
27
|
* @public
|
|
@@ -31,7 +31,7 @@ sap.ui.define(
|
|
|
31
31
|
},
|
|
32
32
|
/**
|
|
33
33
|
* Simulates the pressing of the Esc key for the element in focus.
|
|
34
|
-
* @returns {sap
|
|
34
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
35
35
|
* @function
|
|
36
36
|
* @name sap.fe.test.BaseActions#iPressEscape
|
|
37
37
|
* @public
|
|
@@ -48,7 +48,7 @@ sap.ui.define(
|
|
|
48
48
|
*
|
|
49
49
|
* NOTE: Use this function with care, as waiting for a specified timeframe only makes sense in exceptional cases.
|
|
50
50
|
* @param {number} iMilliseconds The amount of milliseconds to wait before proceeding
|
|
51
|
-
* @returns {sap
|
|
51
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
52
52
|
* @function
|
|
53
53
|
* @name sap.fe.test.BaseActions#iWait
|
|
54
54
|
* @private
|
|
@@ -73,7 +73,7 @@ sap.ui.define(
|
|
|
73
73
|
* Emulates a browser back navigation.
|
|
74
74
|
*
|
|
75
75
|
* NOTE: If the application is executed within the FLP, use {@link sap.fe.test.Shell#iNavigateBack} instead.
|
|
76
|
-
* @returns {sap
|
|
76
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
77
77
|
* @function
|
|
78
78
|
* @name sap.fe.test.BaseActions#iNavigateBack
|
|
79
79
|
* @private
|
|
@@ -89,7 +89,7 @@ sap.ui.define(
|
|
|
89
89
|
},
|
|
90
90
|
/**
|
|
91
91
|
* Emulates a browser forward navigation.
|
|
92
|
-
* @returns {sap
|
|
92
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
93
93
|
* @function
|
|
94
94
|
* @name sap.fe.test.BaseActions#iNavigateForward
|
|
95
95
|
* @private
|
|
@@ -107,7 +107,7 @@ sap.ui.define(
|
|
|
107
107
|
* Changes the timeout to the specified amount of seconds.
|
|
108
108
|
* The new timeout will be active for all waitFor calls to follow until a new timeout is set.
|
|
109
109
|
* @param {number} iSeconds The amount of seconds to be set for the timeout
|
|
110
|
-
* @returns {sap
|
|
110
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
111
111
|
* @function
|
|
112
112
|
* @name sap.fe.test.BaseActions#iChangeTimeout
|
|
113
113
|
* @private
|
|
@@ -42,7 +42,7 @@ sap.ui.define(
|
|
|
42
42
|
* Starts the app in an IFrame, using the <code>launchUrl</code> and <code>launchParameters</code> provided via the settings object of the {@link sap.fe.test.BaseArrangements#constructor}.
|
|
43
43
|
* @param {string} [sAppHash] The app hash
|
|
44
44
|
* @param {object} [mInUrlParameters] A map with additional URL parameters
|
|
45
|
-
* @returns {sap
|
|
45
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
46
46
|
* @function
|
|
47
47
|
* @name sap.fe.test.BaseArrangements#iStartMyApp
|
|
48
48
|
* @public
|
|
@@ -115,19 +115,29 @@ sap.ui.define(
|
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
117
|
* Resets the test data.
|
|
118
|
-
* @
|
|
118
|
+
* @param {boolean} [bIgnoreRedeploy] Ignore the redeploy
|
|
119
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
119
120
|
* @function
|
|
120
121
|
* @name sap.fe.test.BaseArrangements#iResetTestData
|
|
121
122
|
* @public
|
|
122
123
|
*/
|
|
123
|
-
iResetTestData: function () {
|
|
124
|
+
iResetTestData: function (bIgnoreRedeploy) {
|
|
124
125
|
var that = this,
|
|
126
|
+
oUriParams = new URLSearchParams(window.location.search),
|
|
127
|
+
sBackendUrl = oUriParams.get("useBackendUrl"),
|
|
128
|
+
sProxyPrefix = sBackendUrl ? "/databinding/proxy/" + sBackendUrl.replace("://", "/") : "",
|
|
125
129
|
bSuccess = false;
|
|
130
|
+
var sTenantID = window.location.href.includes("sap-client")
|
|
131
|
+
? new URL(window.location.href).searchParams.get("sap-client")
|
|
132
|
+
: "default";
|
|
126
133
|
|
|
127
134
|
return OpaBuilder.create(this)
|
|
128
135
|
.success(function () {
|
|
129
|
-
|
|
130
|
-
|
|
136
|
+
var oResetData = that.resetTestData(),
|
|
137
|
+
oRedeploy =
|
|
138
|
+
bIgnoreRedeploy ?? false ? Promise.resolve() : jQuery.post(sProxyPrefix + "/redeploy?tenant=" + sTenantID);
|
|
139
|
+
|
|
140
|
+
Promise.all([oResetData, oRedeploy])
|
|
131
141
|
.finally(function () {
|
|
132
142
|
bSuccess = true;
|
|
133
143
|
})
|
|
@@ -136,12 +146,13 @@ sap.ui.define(
|
|
|
136
146
|
});
|
|
137
147
|
|
|
138
148
|
return OpaBuilder.create(this)
|
|
149
|
+
.timeout(60) // allow some time (redeployment on the Java stack is slow)
|
|
139
150
|
.check(function () {
|
|
140
151
|
return bSuccess;
|
|
141
152
|
})
|
|
142
153
|
.execute();
|
|
143
154
|
})
|
|
144
|
-
.description(Utils.formatMessage("
|
|
155
|
+
.description(Utils.formatMessage("Reset test data on tenant '{0}'", sTenantID))
|
|
145
156
|
.execute();
|
|
146
157
|
},
|
|
147
158
|
|
|
@@ -155,7 +166,7 @@ sap.ui.define(
|
|
|
155
166
|
* }
|
|
156
167
|
* </pre></code>
|
|
157
168
|
* NOTE: When passing the AppId, the application needs to be running already. Calling the function before the application is started can be done by passing the ServiceUri.
|
|
158
|
-
* @returns {sap
|
|
169
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
159
170
|
* @function
|
|
160
171
|
* @name sap.fe.test.BaseArrangements#iResetMockData
|
|
161
172
|
* @public
|
|
@@ -191,7 +202,7 @@ sap.ui.define(
|
|
|
191
202
|
|
|
192
203
|
/**
|
|
193
204
|
* Tears down the current application.
|
|
194
|
-
* @returns {sap
|
|
205
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
195
206
|
* @function
|
|
196
207
|
* @name sap.fe.test.BaseArrangements#iTearDownMyApp
|
|
197
208
|
* @public
|
|
@@ -209,7 +220,7 @@ sap.ui.define(
|
|
|
209
220
|
|
|
210
221
|
/**
|
|
211
222
|
* Simulates a refresh of the page by tearing it down and then restarting it with the very same hash.
|
|
212
|
-
* @returns {sap
|
|
223
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
213
224
|
* @function
|
|
214
225
|
* @name sap.fe.test.BaseArrangements#iRestartMyApp
|
|
215
226
|
* @public
|
|
@@ -19,7 +19,7 @@ sap.ui.define(
|
|
|
19
19
|
/**
|
|
20
20
|
* Checks whether a {@link sap.m.MessagePage} with given message is shown.
|
|
21
21
|
* @param {string} sMessage The message shown on the message page
|
|
22
|
-
* @returns {sap
|
|
22
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
23
23
|
* @function
|
|
24
24
|
* @name sap.fe.test.BaseAssertions#iSeeMessagePage
|
|
25
25
|
* @public
|
|
@@ -34,7 +34,7 @@ sap.ui.define(
|
|
|
34
34
|
},
|
|
35
35
|
/**
|
|
36
36
|
* Checks whether a {@link sap.m.Page} is shown.
|
|
37
|
-
* @returns {sap
|
|
37
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
38
38
|
* @function
|
|
39
39
|
* @alias sap.fe.test.BaseAssertions#iSeePage
|
|
40
40
|
* @public
|
|
@@ -45,7 +45,7 @@ sap.ui.define(
|
|
|
45
45
|
/**
|
|
46
46
|
* Checks whether a {@link sap.m.IllustratedMessage} with given message is shown.
|
|
47
47
|
* @param {string} sMessage The message shown on the page
|
|
48
|
-
* @returns {sap
|
|
48
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
49
49
|
* @function
|
|
50
50
|
* @alias sap.fe.test.BaseAssertions#iSeeIllustratedMessage
|
|
51
51
|
* @public
|
|
@@ -56,7 +56,7 @@ sap.ui.define(
|
|
|
56
56
|
/**
|
|
57
57
|
* Checks whether a {@link sap.m.MessageToast} with the given text is shown.
|
|
58
58
|
* @param {string} sText The text shown in the MessageToast
|
|
59
|
-
* @returns {sap
|
|
59
|
+
* @returns {module:sap/ui/test/OpaBuilder} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
60
60
|
* @function
|
|
61
61
|
* @name sap.fe.test.BaseAssertions#iSeeMessageToast
|
|
62
62
|
* @public
|