@sapui5/sap.fe.test 1.97.0 → 1.100.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 +6 -2
- package/src/sap/fe/test/.library +1 -1
- package/src/sap/fe/test/BaseActions.js +3 -2
- package/src/sap/fe/test/BaseArrangements.js +3 -2
- package/src/sap/fe/test/BaseAssertions.js +3 -2
- package/src/sap/fe/test/ConfirmDialog.js +3 -2
- package/src/sap/fe/test/FCLView.js +3 -2
- package/src/sap/fe/test/FeMocks.js +66 -0
- package/src/sap/fe/test/FeMocks.ts +77 -0
- package/src/sap/fe/test/Flexibility.js +3 -2
- package/src/sap/fe/test/FlexibleColumnLayout.js +3 -2
- package/src/sap/fe/test/JestTemplatingHelper.js +83 -25
- package/src/sap/fe/test/JestTemplatingHelper.ts +74 -26
- package/src/sap/fe/test/JourneyRunner.js +11 -5
- package/src/sap/fe/test/ListReport.js +11 -5
- package/src/sap/fe/test/LocationUtil.js +3 -2
- package/src/sap/fe/test/ObjectPage.js +28 -17
- package/src/sap/fe/test/Shell.js +3 -2
- package/src/sap/fe/test/Stubs.js +3 -2
- package/src/sap/fe/test/TemplatePage.js +3 -2
- package/src/sap/fe/test/TemplatingTestUtils.js +4 -3
- package/src/sap/fe/test/UI5MockHelper.js +249 -137
- package/src/sap/fe/test/UI5MockHelper.ts +143 -13
- package/src/sap/fe/test/Utils.js +3 -14
- package/src/sap/fe/test/api/APIHelper.js +3 -2
- package/src/sap/fe/test/api/BaseAPI.js +5 -9
- package/src/sap/fe/test/api/ChartActions.js +3 -2
- package/src/sap/fe/test/api/ChartAssertions.js +7 -6
- package/src/sap/fe/test/api/DialogAPI.js +17 -4
- package/src/sap/fe/test/api/DialogActions.js +3 -2
- package/src/sap/fe/test/api/DialogAssertions.js +3 -2
- package/src/sap/fe/test/api/DialogCreateActions.js +4 -3
- package/src/sap/fe/test/api/DialogCreateAssertions.js +4 -3
- package/src/sap/fe/test/api/DialogMessageActions.js +19 -3
- package/src/sap/fe/test/api/DialogMessageAssertions.js +4 -3
- package/src/sap/fe/test/api/DialogType.js +3 -2
- package/src/sap/fe/test/api/DialogValueHelpActions.js +4 -3
- package/src/sap/fe/test/api/DialogValueHelpAssertions.js +4 -3
- package/src/sap/fe/test/api/EditState.js +3 -2
- package/src/sap/fe/test/api/FilterBarAPI.js +12 -3
- package/src/sap/fe/test/api/FilterBarActions.js +3 -2
- package/src/sap/fe/test/api/FilterBarAssertions.js +3 -2
- package/src/sap/fe/test/api/FooterAPI.js +3 -2
- package/src/sap/fe/test/api/FooterActionsBase.js +3 -2
- package/src/sap/fe/test/api/FooterActionsOP.js +3 -2
- package/src/sap/fe/test/api/FooterAssertionsBase.js +3 -2
- package/src/sap/fe/test/api/FooterAssertionsOP.js +3 -2
- package/src/sap/fe/test/api/FormAPI.js +3 -2
- package/src/sap/fe/test/api/FormActions.js +3 -2
- package/src/sap/fe/test/api/FormAssertions.js +3 -2
- package/src/sap/fe/test/api/HeaderAPI.js +3 -2
- package/src/sap/fe/test/api/HeaderActions.js +3 -2
- package/src/sap/fe/test/api/HeaderActionsLR.js +3 -2
- package/src/sap/fe/test/api/HeaderAssertions.js +3 -2
- package/src/sap/fe/test/api/HeaderAssertionsLR.js +3 -2
- package/src/sap/fe/test/api/HeaderLR.js +3 -2
- package/src/sap/fe/test/api/KPICardAPI.js +3 -2
- package/src/sap/fe/test/api/KPICardActions.js +43 -0
- package/src/sap/fe/test/api/KPICardAssertions.js +22 -17
- package/src/sap/fe/test/api/TableAPI.js +3 -2
- package/src/sap/fe/test/api/TableActions.js +3 -21
- package/src/sap/fe/test/api/TableAssertions.js +17 -6
- package/src/sap/fe/test/builder/DialogBuilder.js +3 -2
- package/src/sap/fe/test/builder/FEBuilder.js +3 -2
- package/src/sap/fe/test/builder/KPIBuilder.js +14 -4
- package/src/sap/fe/test/builder/MacroFieldBuilder.js +3 -2
- package/src/sap/fe/test/builder/MdcFieldBuilder.js +3 -2
- package/src/sap/fe/test/builder/MdcFilterBarBuilder.js +3 -2
- package/src/sap/fe/test/builder/MdcFilterFieldBuilder.js +3 -2
- package/src/sap/fe/test/builder/MdcTableBuilder.js +29 -2
- package/src/sap/fe/test/builder/OverflowToolbarBuilder.js +3 -2
- package/src/sap/fe/test/builder/VMBuilder.js +3 -2
- package/src/sap/fe/test/internal/FEArrangements.js +3 -2
- package/src/sap/fe/test/internal/FEJourneyRunner.js +9 -5
- package/src/sap/fe/test/library.js +4 -3
- package/src/sap/fe/test/massEdit.js +3 -2
- package/ui5.yaml +0 -3
|
@@ -1,22 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Mock class for a V4 Context
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
import
|
|
4
|
+
import Event from "sap/ui/base/Event";
|
|
5
|
+
import Control from "sap/ui/core/Control";
|
|
6
|
+
import UI5Element from "sap/ui/core/Element";
|
|
7
|
+
import Controller from "sap/ui/core/mvc/Controller";
|
|
8
|
+
import View from "sap/ui/core/mvc/View";
|
|
9
|
+
import Context from "sap/ui/model/odata/v4/Context";
|
|
10
|
+
import ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
|
|
11
|
+
import ODataContextBinding from "sap/ui/model/odata/v4/ODataContextBinding";
|
|
12
|
+
import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
|
|
13
|
+
import ODataModel from "sap/ui/model/odata/v4/ODataModel";
|
|
6
14
|
|
|
7
15
|
export class MockContext implements Partial<Context> {
|
|
8
|
-
public constructor(private oValues
|
|
16
|
+
public constructor(private oValues?: any, private oBinding?: any) {}
|
|
17
|
+
|
|
18
|
+
public isA(sClassName: string): boolean {
|
|
19
|
+
return sClassName === "sap.ui.model.odata.v4.Context";
|
|
20
|
+
}
|
|
9
21
|
|
|
10
22
|
public getProperty = jest.fn((key: string) => {
|
|
11
23
|
return this.oValues[key];
|
|
12
24
|
});
|
|
25
|
+
public requestProperty = jest.fn((key: string) => {
|
|
26
|
+
return Promise.resolve(this.oValues[key]);
|
|
27
|
+
});
|
|
13
28
|
public setProperty = jest.fn((key: string, value: any) => {
|
|
14
29
|
this.oValues[key] = value;
|
|
15
30
|
return this.oValues[key];
|
|
16
31
|
});
|
|
17
32
|
|
|
18
|
-
public getObject = jest.fn((
|
|
19
|
-
|
|
33
|
+
public getObject = jest.fn((path: string) => {
|
|
34
|
+
const that = this as any;
|
|
35
|
+
let result = path ? that.oValues[path] : that.oValues;
|
|
36
|
+
|
|
37
|
+
if (!result && path && path.indexOf("/") > -1) {
|
|
38
|
+
const parts = path.split("/");
|
|
39
|
+
result = parts.reduce((sum, part: any) => {
|
|
40
|
+
sum = part ? sum[part] : sum;
|
|
41
|
+
return sum;
|
|
42
|
+
}, that.oValues);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return result;
|
|
20
46
|
});
|
|
21
47
|
public getPath = jest.fn(() => {
|
|
22
48
|
return this.oValues["$path"];
|
|
@@ -25,14 +51,33 @@ export class MockContext implements Partial<Context> {
|
|
|
25
51
|
public getBinding = jest.fn(() => {
|
|
26
52
|
return this.oBinding;
|
|
27
53
|
});
|
|
28
|
-
public getModel = jest.fn()
|
|
54
|
+
public getModel = jest.fn(() => {
|
|
55
|
+
return (this.oBinding?.getModel() as any) as ODataModel;
|
|
56
|
+
});
|
|
57
|
+
public isTransient = jest.fn();
|
|
29
58
|
}
|
|
30
59
|
|
|
31
|
-
export class
|
|
32
|
-
|
|
60
|
+
export class MockUI5Element implements Partial<UI5Element> {
|
|
61
|
+
[key: string]: any;
|
|
62
|
+
public bindingContext = new MockContext({});
|
|
33
63
|
public getBinding = jest.fn();
|
|
64
|
+
public getBindingContext = jest.fn().mockReturnValue(this.bindingContext);
|
|
65
|
+
public getBindingInfo = jest.fn();
|
|
34
66
|
public data = jest.fn();
|
|
35
67
|
public getModel = jest.fn();
|
|
68
|
+
public getParent = jest.fn();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export class MockControl extends MockUI5Element implements Partial<Control> {
|
|
72
|
+
public getBindingContext: jest.Mock<any, any> = jest.fn();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export class MockEvent implements Partial<Event> {
|
|
76
|
+
public constructor(public params: { [key: string]: any } = {}, public source: MockUI5Element = new MockUI5Element()) {}
|
|
77
|
+
|
|
78
|
+
public getParameter = jest.fn(name => this.params[name]);
|
|
79
|
+
|
|
80
|
+
public getSource = jest.fn(() => this.source as any);
|
|
36
81
|
}
|
|
37
82
|
|
|
38
83
|
/**
|
|
@@ -41,7 +86,7 @@ export class MockControl {
|
|
|
41
86
|
export class MockListBinding implements Partial<ODataListBinding> {
|
|
42
87
|
private aMockContexts: MockContext[];
|
|
43
88
|
|
|
44
|
-
public constructor(aContexts?: any[]) {
|
|
89
|
+
public constructor(aContexts?: any[], private mockModel?: MockModel) {
|
|
45
90
|
aContexts = aContexts || [];
|
|
46
91
|
|
|
47
92
|
this.aMockContexts = aContexts.map(context => {
|
|
@@ -53,6 +98,10 @@ export class MockListBinding implements Partial<ODataListBinding> {
|
|
|
53
98
|
return sClassName === "sap.ui.model.odata.v4.ODataListBinding";
|
|
54
99
|
}
|
|
55
100
|
|
|
101
|
+
public setModel(oModel: MockModel) {
|
|
102
|
+
this.mockModel = oModel;
|
|
103
|
+
}
|
|
104
|
+
|
|
56
105
|
// Mocked API
|
|
57
106
|
public setAggregation = jest.fn();
|
|
58
107
|
public filter = jest.fn();
|
|
@@ -66,12 +115,15 @@ export class MockListBinding implements Partial<ODataListBinding> {
|
|
|
66
115
|
public getCurrentContexts = jest.fn((...args) => {
|
|
67
116
|
return (this.aMockContexts as any) as Context[];
|
|
68
117
|
});
|
|
118
|
+
public getModel = jest.fn(() => {
|
|
119
|
+
return (this.mockModel as any) as ODataModel;
|
|
120
|
+
});
|
|
69
121
|
}
|
|
70
122
|
|
|
71
123
|
export class MockContextBinding implements Partial<ODataContextBinding> {
|
|
72
124
|
private oMockContext: MockContext;
|
|
73
125
|
|
|
74
|
-
public constructor(oContext?: any) {
|
|
126
|
+
public constructor(oContext?: any, private mockModel?: MockModel) {
|
|
75
127
|
this.oMockContext = new MockContext(oContext || {}, this);
|
|
76
128
|
}
|
|
77
129
|
|
|
@@ -81,12 +133,18 @@ export class MockContextBinding implements Partial<ODataContextBinding> {
|
|
|
81
133
|
public getInternalMockContext(): MockContext {
|
|
82
134
|
return this.oMockContext;
|
|
83
135
|
}
|
|
136
|
+
public setModel(oModel: MockModel) {
|
|
137
|
+
this.mockModel = oModel;
|
|
138
|
+
}
|
|
84
139
|
|
|
85
140
|
// Mocked API
|
|
86
141
|
public getBoundContext = jest.fn(() => {
|
|
87
142
|
return (this.oMockContext as any) as Context;
|
|
88
143
|
});
|
|
89
144
|
public attachEventOnce = jest.fn();
|
|
145
|
+
public getModel = jest.fn(() => {
|
|
146
|
+
return (this.mockModel as any) as ODataModel;
|
|
147
|
+
});
|
|
90
148
|
}
|
|
91
149
|
|
|
92
150
|
/**
|
|
@@ -94,6 +152,7 @@ export class MockContextBinding implements Partial<ODataContextBinding> {
|
|
|
94
152
|
*/
|
|
95
153
|
export class MockMetaModel implements Partial<ODataMetaModel> {
|
|
96
154
|
private oMetaContext: MockContext;
|
|
155
|
+
requestValueListInfo!: jest.Mock<any, any>;
|
|
97
156
|
|
|
98
157
|
public constructor(oMetaData?: any) {
|
|
99
158
|
this.oMetaContext = new MockContext(oMetaData || {});
|
|
@@ -108,8 +167,13 @@ export class MockMetaModel implements Partial<ODataMetaModel> {
|
|
|
108
167
|
return this.oMetaContext.getProperty(sPath);
|
|
109
168
|
});
|
|
110
169
|
public requestObject = jest.fn();
|
|
111
|
-
public createBindingContext = jest.fn()
|
|
112
|
-
|
|
170
|
+
public createBindingContext = jest.fn((sPath: string) => {
|
|
171
|
+
return (new MockContext({ $path: sPath }) as any) as Context;
|
|
172
|
+
});
|
|
173
|
+
public getMetaPath = jest.fn((sPath: string) => {
|
|
174
|
+
return sPath;
|
|
175
|
+
});
|
|
176
|
+
public getContext = jest.fn();
|
|
113
177
|
}
|
|
114
178
|
|
|
115
179
|
/**
|
|
@@ -119,7 +183,14 @@ export class MockMetaModel implements Partial<ODataMetaModel> {
|
|
|
119
183
|
export class MockModel implements Partial<ODataModel> {
|
|
120
184
|
private oMetaModel?: MockMetaModel;
|
|
121
185
|
|
|
122
|
-
public constructor(private mockListBinding?: MockListBinding, private mockContextBinding?: MockContextBinding) {
|
|
186
|
+
public constructor(private mockListBinding?: MockListBinding, private mockContextBinding?: MockContextBinding) {
|
|
187
|
+
if (mockListBinding) {
|
|
188
|
+
mockListBinding.setModel(this);
|
|
189
|
+
}
|
|
190
|
+
if (mockContextBinding) {
|
|
191
|
+
mockContextBinding.setModel(this);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
123
194
|
|
|
124
195
|
// Factories
|
|
125
196
|
static modelFromListBinding(mockListBinding: MockListBinding): MockModel {
|
|
@@ -148,4 +219,63 @@ export class MockModel implements Partial<ODataModel> {
|
|
|
148
219
|
|
|
149
220
|
public getProperty = jest.fn();
|
|
150
221
|
public setProperty = jest.fn();
|
|
222
|
+
public requestObject = jest.fn();
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export class MockView implements Partial<View> {
|
|
226
|
+
public getController = jest.fn();
|
|
227
|
+
|
|
228
|
+
public getBindingContext = jest.fn();
|
|
229
|
+
|
|
230
|
+
public getModel = jest.fn();
|
|
231
|
+
|
|
232
|
+
public getViewData = jest.fn();
|
|
233
|
+
|
|
234
|
+
public isA(sClassName: string): boolean {
|
|
235
|
+
return sClassName === "sap.ui.core.mvc.View";
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
public getId = jest.fn();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export class MockController implements Partial<Controller> {
|
|
242
|
+
public getView = jest.fn().mockReturnValue(new MockView());
|
|
243
|
+
|
|
244
|
+
public _routing = {
|
|
245
|
+
navigateToTarget: jest.fn()
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
public _editFlow = {
|
|
249
|
+
syncTask: jest.fn()
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
public _sideEffects = {
|
|
253
|
+
handleFieldChange: jest.fn()
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
isA = jest.fn().mockReturnValue(false);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface MVCMock {
|
|
260
|
+
model: MockModel;
|
|
261
|
+
view: MockView;
|
|
262
|
+
controller: MockController;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Generate model, view and controller mocks that refer to each other.
|
|
267
|
+
*
|
|
268
|
+
* @param existing Optional existing mocked instances that should be used
|
|
269
|
+
* @returns Mocked model, view and controller instances
|
|
270
|
+
*/
|
|
271
|
+
export function mockMVC(existing?: Partial<MVCMock>): MVCMock {
|
|
272
|
+
const model = existing?.model || new MockModel();
|
|
273
|
+
const view = existing?.view || new MockView();
|
|
274
|
+
const controller = existing?.controller || new MockController();
|
|
275
|
+
|
|
276
|
+
view.getController.mockReturnValue(controller);
|
|
277
|
+
view.getModel.mockReturnValue(model);
|
|
278
|
+
controller.getView.mockReturnValue(view);
|
|
279
|
+
|
|
280
|
+
return { model, view, controller };
|
|
151
281
|
}
|
package/src/sap/fe/test/Utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(
|
|
6
7
|
[
|
|
@@ -287,18 +288,6 @@ sap.ui.define(
|
|
|
287
288
|
return vTarget;
|
|
288
289
|
};
|
|
289
290
|
|
|
290
|
-
Utils.getParametersArray = function(iStartIndex, aArguments) {
|
|
291
|
-
var aArguments = Array.prototype.slice.call(arguments, 1);
|
|
292
|
-
if (aArguments.length === 1 && Utils.isArguments(aArguments[0])) {
|
|
293
|
-
aArguments = Array.prototype.slice.call(aArguments[0], 0);
|
|
294
|
-
}
|
|
295
|
-
var aParameters = aArguments[iStartIndex];
|
|
296
|
-
if (aArguments.length > iStartIndex || (aParameters && !Array.isArray(aParameters))) {
|
|
297
|
-
aParameters = Array.prototype.slice.call(aArguments, iStartIndex);
|
|
298
|
-
}
|
|
299
|
-
return aParameters;
|
|
300
|
-
};
|
|
301
|
-
|
|
302
291
|
return Utils;
|
|
303
292
|
}
|
|
304
293
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(["sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/builder/FEBuilder"], function(Utils, OpaBuilder, FEBuilder) {
|
|
6
7
|
"use strict";
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(
|
|
6
|
-
[
|
|
7
|
-
"sap/fe/test/Utils",
|
|
8
|
-
"sap/ui/test/Opa5",
|
|
9
|
-
"sap/ui/test/OpaBuilder",
|
|
10
|
-
"sap/fe/test/builder/FEBuilder",
|
|
11
|
-
"sap/ui/mdc/p13n/panels/BasePanel"
|
|
12
|
-
],
|
|
7
|
+
["sap/fe/test/Utils", "sap/ui/test/Opa5", "sap/ui/test/OpaBuilder", "sap/fe/test/builder/FEBuilder", "sap/m/p13n/BasePanel"],
|
|
13
8
|
function(Utils, Opa5, OpaBuilder, FEBuilder, MdcP13nBasePanel) {
|
|
14
9
|
"use strict";
|
|
15
10
|
|
|
@@ -18,6 +13,7 @@ sap.ui.define(
|
|
|
18
13
|
*
|
|
19
14
|
* @typedef {object} TableIdentifier
|
|
20
15
|
* @property {string} property The name of the navigation property used for the table
|
|
16
|
+
* @property {string} [qualifier] The name of a qualifier for the table
|
|
21
17
|
*
|
|
22
18
|
* @name sap.fe.test.api.TableIdentifier
|
|
23
19
|
* @public
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(["./BaseAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/builder/FEBuilder"], function(
|
|
6
7
|
BaseAPI,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(
|
|
6
7
|
["./BaseAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder", "sap/fe/test/builder/FEBuilder", "sap/ui/core/SortOrder"],
|
|
@@ -27,7 +28,7 @@ sap.ui.define(
|
|
|
27
28
|
|
|
28
29
|
ChartAssertions.prototype.iCheckItems = function(iNumberOfItems, sTab) {
|
|
29
30
|
return OpaBuilder.create(this)
|
|
30
|
-
.hasType("sap.ui.mdc.
|
|
31
|
+
.hasType("sap.ui.mdc.Chart")
|
|
31
32
|
.check(function(aCharts) {
|
|
32
33
|
var oChart;
|
|
33
34
|
if (sTab && aCharts && aCharts.length > 1) {
|
|
@@ -56,7 +57,7 @@ sap.ui.define(
|
|
|
56
57
|
|
|
57
58
|
ChartAssertions.prototype.iSeeChartType = function(sChartType) {
|
|
58
59
|
return OpaBuilder.create(this)
|
|
59
|
-
.hasType("sap.ui.mdc.
|
|
60
|
+
.hasType("sap.ui.mdc.Chart")
|
|
60
61
|
.check(function(oChart) {
|
|
61
62
|
return sChartType === oChart[0].getChartType();
|
|
62
63
|
}, true)
|
|
@@ -66,7 +67,7 @@ sap.ui.define(
|
|
|
66
67
|
|
|
67
68
|
ChartAssertions.prototype.iSeeChartVisible = function() {
|
|
68
69
|
return OpaBuilder.create(this)
|
|
69
|
-
.hasType("sap.ui.mdc.
|
|
70
|
+
.hasType("sap.ui.mdc.Chart")
|
|
70
71
|
.check(function(oChart) {
|
|
71
72
|
return oChart[0].getVisible() === true;
|
|
72
73
|
}, true)
|
|
@@ -103,7 +104,7 @@ sap.ui.define(
|
|
|
103
104
|
|
|
104
105
|
ChartAssertions.prototype.iCheckChartNoDataText = function(sNoDataText) {
|
|
105
106
|
return OpaBuilder.create(this)
|
|
106
|
-
.hasType("sap.ui.mdc.
|
|
107
|
+
.hasType("sap.ui.mdc.Chart")
|
|
107
108
|
.check(function(oChart) {
|
|
108
109
|
return sNoDataText === oChart[0].getNoDataText();
|
|
109
110
|
})
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(
|
|
6
7
|
[
|
|
@@ -28,6 +29,7 @@ sap.ui.define(
|
|
|
28
29
|
throw new Error("oDialogBuilder parameter must be a DialogBuilder instance");
|
|
29
30
|
}
|
|
30
31
|
this._iConfirmButtonIndex = iConfirmButtonIndex || 0;
|
|
32
|
+
this._iConfirmDiscardDraftButtonIndex = this._iConfirmButtonIndex + 1; // second button in the list
|
|
31
33
|
return BaseAPI.call(this, oDialogBuilder, vDialogDescription);
|
|
32
34
|
};
|
|
33
35
|
DialogAPI.prototype = Object.create(BaseAPI.prototype);
|
|
@@ -86,8 +88,19 @@ sap.ui.define(
|
|
|
86
88
|
var iConfirmButtonIndex = this._iConfirmButtonIndex;
|
|
87
89
|
return function(oButton) {
|
|
88
90
|
var aButtons = oButton.getParent().getButtons();
|
|
89
|
-
// Cancel is (usually) right next to the first (confirm) button
|
|
90
|
-
return aButtons.
|
|
91
|
+
// Cancel is (usually) right next to the first (confirm) button and (usually) the last one in the list
|
|
92
|
+
return aButtons.length > 2
|
|
93
|
+
? aButtons.indexOf(oButton) === aButtons.length - 1
|
|
94
|
+
: aButtons.indexOf(oButton) === Math.min(aButtons.length - 1, iConfirmButtonIndex + 1);
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
DialogAPI.prototype._getConfirmDiscardDraftButtonMatcher = function() {
|
|
99
|
+
var iConfirmDiscardDraftButtonIndex = this._iConfirmDiscardDraftButtonIndex;
|
|
100
|
+
return function(oButton) {
|
|
101
|
+
var aButtons = oButton.getParent().getButtons();
|
|
102
|
+
// for the KeepDraft/DiscardDraft message, the DiscardDraft button is the second in the list
|
|
103
|
+
return aButtons.indexOf(oButton) === iConfirmDiscardDraftButtonIndex;
|
|
91
104
|
};
|
|
92
105
|
};
|
|
93
106
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
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
7
|
"use strict";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
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
7
|
"use strict";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(["./DialogActions", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"], function(DialogActions, Utils, OpaBuilder) {
|
|
6
7
|
"use strict";
|
|
@@ -18,7 +19,7 @@ sap.ui.define(["./DialogActions", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"]
|
|
|
18
19
|
* @public
|
|
19
20
|
*/
|
|
20
21
|
var DialogCreateActions = function(oDialogBuilder, vDialogDescription) {
|
|
21
|
-
return DialogActions.call(this, oDialogBuilder, vDialogDescription,
|
|
22
|
+
return DialogActions.call(this, oDialogBuilder, vDialogDescription, 0);
|
|
22
23
|
};
|
|
23
24
|
DialogCreateActions.prototype = Object.create(DialogActions.prototype);
|
|
24
25
|
DialogCreateActions.prototype.constructor = DialogCreateActions;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(["./DialogAssertions", "sap/ui/test/OpaBuilder", "sap/fe/test/builder/FEBuilder", "sap/fe/test/Utils"], function(
|
|
6
7
|
DialogAssertions,
|
|
@@ -23,7 +24,7 @@ sap.ui.define(["./DialogAssertions", "sap/ui/test/OpaBuilder", "sap/fe/test/buil
|
|
|
23
24
|
* @public
|
|
24
25
|
*/
|
|
25
26
|
var DialogCreateAssertions = function(oDialogBuilder, vDialogDescription) {
|
|
26
|
-
return DialogAssertions.call(this, oDialogBuilder, vDialogDescription,
|
|
27
|
+
return DialogAssertions.call(this, oDialogBuilder, vDialogDescription, 0);
|
|
27
28
|
};
|
|
28
29
|
DialogCreateAssertions.prototype = Object.create(DialogAssertions.prototype);
|
|
29
30
|
DialogCreateAssertions.prototype.constructor = DialogCreateAssertions;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(["./DialogActions", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"], function(DialogActions, Utils, OpaBuilder) {
|
|
6
7
|
"use strict";
|
|
@@ -18,7 +19,7 @@ sap.ui.define(["./DialogActions", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"]
|
|
|
18
19
|
* @public
|
|
19
20
|
*/
|
|
20
21
|
var DialogMessageActions = function(oDialogBuilder, vDialogDescription) {
|
|
21
|
-
return DialogActions.call(this, oDialogBuilder, vDialogDescription,
|
|
22
|
+
return DialogActions.call(this, oDialogBuilder, vDialogDescription, 0);
|
|
22
23
|
};
|
|
23
24
|
DialogMessageActions.prototype = Object.create(DialogActions.prototype);
|
|
24
25
|
DialogMessageActions.prototype.constructor = DialogMessageActions;
|
|
@@ -54,5 +55,20 @@ sap.ui.define(["./DialogActions", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"]
|
|
|
54
55
|
);
|
|
55
56
|
};
|
|
56
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Confirms the draft message with Discard Draft when navigating back to the list-report.
|
|
60
|
+
*
|
|
61
|
+
* @returns {object} The result of the {@link sap.ui.test.Opa5#waitFor} function, to be used for chained statements
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
DialogMessageActions.prototype.iConfirmDiscardDraft = function() {
|
|
65
|
+
return this.prepareResult(
|
|
66
|
+
this.getBuilder()
|
|
67
|
+
.doPressFooterButton(this._getConfirmDiscardDraftButtonMatcher())
|
|
68
|
+
.description(Utils.formatMessage("Confirming dialog '{0}' with Discard Draft", this.getIdentifier()))
|
|
69
|
+
.execute()
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
57
73
|
return DialogMessageActions;
|
|
58
74
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(["./DialogAssertions", "sap/ui/test/OpaBuilder", "sap/fe/test/builder/FEBuilder", "sap/fe/test/Utils"], function(
|
|
6
7
|
DialogAssertions,
|
|
@@ -23,7 +24,7 @@ sap.ui.define(["./DialogAssertions", "sap/ui/test/OpaBuilder", "sap/fe/test/buil
|
|
|
23
24
|
* @public
|
|
24
25
|
*/
|
|
25
26
|
var DialogMessageAssertions = function(oDialogBuilder, vDialogDescription) {
|
|
26
|
-
return DialogAssertions.call(this, oDialogBuilder, vDialogDescription,
|
|
27
|
+
return DialogAssertions.call(this, oDialogBuilder, vDialogDescription, 0);
|
|
27
28
|
};
|
|
28
29
|
DialogMessageAssertions.prototype = Object.create(DialogAssertions.prototype);
|
|
29
30
|
DialogMessageAssertions.prototype.constructor = DialogMessageAssertions;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(
|
|
6
7
|
[
|
|
@@ -31,7 +32,7 @@ sap.ui.define(
|
|
|
31
32
|
* @public
|
|
32
33
|
*/
|
|
33
34
|
var DialogValueHelpActions = function(oDialogBuilder, vDialogDescription) {
|
|
34
|
-
return DialogActions.call(this, oDialogBuilder, vDialogDescription);
|
|
35
|
+
return DialogActions.call(this, oDialogBuilder, vDialogDescription, 0);
|
|
35
36
|
};
|
|
36
37
|
DialogValueHelpActions.prototype = Object.create(DialogActions.prototype);
|
|
37
38
|
DialogValueHelpActions.prototype.constructor = DialogValueHelpActions;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(
|
|
6
7
|
[
|
|
@@ -30,7 +31,7 @@ sap.ui.define(
|
|
|
30
31
|
* @public
|
|
31
32
|
*/
|
|
32
33
|
var DialogValueHelpAssertions = function(oDialogBuilder, vDialogDescription) {
|
|
33
|
-
return DialogAssertions.call(this, oDialogBuilder, vDialogDescription,
|
|
34
|
+
return DialogAssertions.call(this, oDialogBuilder, vDialogDescription, 0);
|
|
34
35
|
};
|
|
35
36
|
DialogValueHelpAssertions.prototype = Object.create(DialogAssertions.prototype);
|
|
36
37
|
DialogValueHelpAssertions.prototype.constructor = DialogValueHelpAssertions;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(
|
|
6
7
|
[
|
|
@@ -150,7 +151,15 @@ sap.ui.define(
|
|
|
150
151
|
}
|
|
151
152
|
|
|
152
153
|
mState = aArguments[1];
|
|
153
|
-
|
|
154
|
+
if (mState.visible !== undefined) {
|
|
155
|
+
mState.exists = mState.visible;
|
|
156
|
+
delete mState.visible;
|
|
157
|
+
}
|
|
158
|
+
if (mState.selected !== undefined) {
|
|
159
|
+
mState.visible = mState.selected;
|
|
160
|
+
delete mState.selected;
|
|
161
|
+
}
|
|
162
|
+
var bCheckForNotVisible = mState && mState.exists === false;
|
|
154
163
|
if (!bCheckForNotVisible && !Utils.isOfType(mState, [null, undefined])) {
|
|
155
164
|
oAdaptColumnBuilder.has(OpaBuilder.Matchers.bindingProperties(BaseAPI.MDC_P13N_MODEL, mState));
|
|
156
165
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* ! SAPUI5
|
|
3
|
-
|
|
2
|
+
* ! SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(["./FooterAPI", "sap/fe/test/Utils", "sap/ui/test/OpaBuilder"], function(FooterAPI, Utils, OpaBuilder) {
|
|
6
7
|
"use strict";
|