@sap-ux/ui5-test-writer 1.7.2 → 1.8.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/dist/fiori-elements-opa-writer.js +6 -17
- package/dist/types.d.ts +5 -1
- package/dist/utils/journeyRunnerUtils.js +18 -4
- package/dist/utils/listReportUtils.d.ts +13 -0
- package/dist/utils/listReportUtils.js +35 -4
- package/dist/utils/modelUtils.js +1 -1
- package/dist/utils/objectPageUtils.d.ts +20 -1
- package/dist/utils/objectPageUtils.js +31 -9
- package/dist/utils/opaJourneyTypesUtils.d.ts +4 -4
- package/dist/utils/opaJourneyTypesUtils.js +48 -10
- package/dist/utils/tableUtils.d.ts +10 -0
- package/dist/utils/tableUtils.js +43 -6
- package/package.json +4 -4
- package/templates/v4/1.148/integration/FPMJourney.js +0 -8
- package/templates/v4/1.148/integration/FPMJourney.ts +38 -0
- package/templates/v4/1.148/integration/ListReportJourney.js +2 -0
- package/templates/v4/1.148/integration/ListReportJourney.ts +2 -0
- package/templates/v4/1.148/integration/ObjectPageJourney.js +6 -2
- package/templates/v4/1.148/integration/ObjectPageJourney.ts +6 -2
- package/templates/v4/1.148/integration/pages/FPM.ts +25 -0
- package/templates/v4/1.148/integration/pages/JourneyRunner.ts +9 -1
- package/templates/v4/1.148/integration/types/OpaJourneyTypes.d.ts +27 -6
- package/templates/v4/1.84/integration/FPMJourney.js +0 -8
- package/templates/v4/1.84/integration/FPMJourney.ts +38 -0
- package/templates/v4/1.84/integration/ListReportJourney.js +2 -0
- package/templates/v4/1.84/integration/ListReportJourney.ts +2 -0
- package/templates/v4/1.84/integration/ObjectPageJourney.js +6 -2
- package/templates/v4/1.84/integration/ObjectPageJourney.ts +6 -2
- package/templates/v4/1.84/integration/pages/FPM.ts +25 -0
- package/templates/v4/1.84/integration/pages/JourneyRunner.ts +9 -1
- package/templates/v4/1.84/integration/types/OpaJourneyTypes.d.ts +27 -6
- package/templates/v4/latest/integration/FPMJourney.js +0 -8
- package/templates/v4/latest/integration/FPMJourney.ts +38 -0
- package/templates/v4/latest/integration/ListReportJourney.js +2 -0
- package/templates/v4/latest/integration/ListReportJourney.ts +2 -0
- package/templates/v4/latest/integration/ObjectPageJourney.js +6 -2
- package/templates/v4/latest/integration/ObjectPageJourney.ts +6 -2
- package/templates/v4/latest/integration/pages/FPM.ts +25 -0
- package/templates/v4/latest/integration/pages/JourneyRunner.ts +9 -1
- package/templates/v4/latest/integration/types/OpaJourneyTypes.d.ts +27 -6
|
@@ -18,15 +18,32 @@ import type { actions as ListReportActions, assertions as ListReportAssertions }
|
|
|
18
18
|
<% if (pages.some(p => p.template === 'ObjectPage')) { -%>
|
|
19
19
|
import type { actions as ObjectPageActions, assertions as ObjectPageAssertions } from "sap/fe/test/ObjectPage";
|
|
20
20
|
<% } -%>
|
|
21
|
-
<% if (pages.some(p => p.template === 'ListReport' || p.template === 'ObjectPage')) { -%>
|
|
21
|
+
<% if (pages.some(p => p.template === 'ListReport' || p.template === 'ObjectPage' || p.template === 'FPM')) { -%>
|
|
22
22
|
import type { actions as TemplatePageActions, assertions as TemplatePageAssertions } from "sap/fe/test/TemplatePage";
|
|
23
23
|
<% } -%>
|
|
24
24
|
import type Shell from "sap/fe/test/Shell";
|
|
25
25
|
import type BaseArrangements from "sap/fe/test/BaseArrangements";
|
|
26
|
-
<% pages.filter((p) => p.template === 'ListReport' || p.template === 'ObjectPage').forEach(function(page) { -%>
|
|
26
|
+
<% pages.filter((p) => p.template === 'ListReport' || p.template === 'ObjectPage' || p.template === 'FPM').forEach(function(page) { -%>
|
|
27
27
|
import type { actions as <%- page.targetKey %>GeneratedCustomActions, assertions as <%- page.targetKey %>GeneratedCustomAssertions } from "../pages/<%- page.targetKey %>.gen";
|
|
28
28
|
<% }); -%>
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Enables OPA5 fluent `.and` chaining on page objects and their sub-objects.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* Then.onTheObjectPageGenerated.iCheckSection({ section: "A" }).and.iCheckSection({ section: "B" });
|
|
35
|
+
* When.onTheListReportGenerated.onFilterBar().iExecuteSearch().and.iClearFilterBar();
|
|
36
|
+
*/
|
|
37
|
+
type WithAnd<T> = {
|
|
38
|
+
[K in keyof T | 'and']: K extends 'and'
|
|
39
|
+
? WithAnd<T>
|
|
40
|
+
: K extends keyof T
|
|
41
|
+
? T[K] extends (...args: infer A) => infer R
|
|
42
|
+
? (...args: A) => (R extends Opa5 | object ? (keyof R extends never ? WithAnd<T> : [R] extends [Opa5] ? WithAnd<T> : WithAnd<R>) : WithAnd<T>)
|
|
43
|
+
: T[K]
|
|
44
|
+
: never;
|
|
45
|
+
};
|
|
46
|
+
|
|
30
47
|
export type Given = Opa5 & BaseArrangements & {
|
|
31
48
|
iTearDownMyApp: () => Given;
|
|
32
49
|
iStartMyApp: (sAppHash?: string, mInUrlParameters?: object) => Given;
|
|
@@ -36,9 +53,11 @@ export type Given = Opa5 & BaseArrangements & {
|
|
|
36
53
|
export type When = Opa5 & BaseArrangements & {
|
|
37
54
|
<% pages.forEach(function(page) { -%>
|
|
38
55
|
<% if (page.template === 'ListReport') { -%>
|
|
39
|
-
onThe<%- page.targetKey %>Generated: Opa5 & ListReportActions & TemplatePageActions & typeof <%- page.targetKey %>GeneratedCustomActions
|
|
56
|
+
onThe<%- page.targetKey %>Generated: WithAnd<Opa5 & ListReportActions & TemplatePageActions & typeof <%- page.targetKey %>GeneratedCustomActions>;
|
|
40
57
|
<% } else if (page.template === 'ObjectPage') { -%>
|
|
41
|
-
onThe<%- page.targetKey %>Generated: Opa5 & ObjectPageActions & TemplatePageActions & typeof <%- page.targetKey %>GeneratedCustomActions
|
|
58
|
+
onThe<%- page.targetKey %>Generated: WithAnd<Opa5 & ObjectPageActions & TemplatePageActions & typeof <%- page.targetKey %>GeneratedCustomActions>;
|
|
59
|
+
<% } else if (page.template === 'FPM') { -%>
|
|
60
|
+
onThe<%- page.targetKey %>Generated: WithAnd<Opa5 & TemplatePageActions & typeof <%- page.targetKey %>GeneratedCustomActions>;
|
|
42
61
|
<% } -%>
|
|
43
62
|
<% }); -%>
|
|
44
63
|
onTheShell: Shell;
|
|
@@ -47,9 +66,11 @@ export type When = Opa5 & BaseArrangements & {
|
|
|
47
66
|
export type Then = Opa5 & BaseArrangements & {
|
|
48
67
|
<% pages.forEach(function(page) { -%>
|
|
49
68
|
<% if (page.template === 'ListReport') { -%>
|
|
50
|
-
onThe<%- page.targetKey %>Generated: Opa5 & ListReportAssertions & TemplatePageAssertions & typeof <%- page.targetKey %>GeneratedCustomAssertions
|
|
69
|
+
onThe<%- page.targetKey %>Generated: WithAnd<Opa5 & ListReportAssertions & TemplatePageAssertions & typeof <%- page.targetKey %>GeneratedCustomAssertions>;
|
|
51
70
|
<% } else if (page.template === 'ObjectPage') { -%>
|
|
52
|
-
onThe<%- page.targetKey %>Generated: Opa5 & ObjectPageAssertions & TemplatePageAssertions & typeof <%- page.targetKey %>GeneratedCustomAssertions
|
|
71
|
+
onThe<%- page.targetKey %>Generated: WithAnd<Opa5 & ObjectPageAssertions & TemplatePageAssertions & typeof <%- page.targetKey %>GeneratedCustomAssertions>;
|
|
72
|
+
<% } else if (page.template === 'FPM') { -%>
|
|
73
|
+
onThe<%- page.targetKey %>Generated: WithAnd<Opa5 & TemplatePageAssertions & typeof <%- page.targetKey %>GeneratedCustomAssertions>;
|
|
53
74
|
<% } -%>
|
|
54
75
|
<% }); -%>
|
|
55
76
|
onTheShell: Shell;
|