@sap-ux/ui5-test-writer 1.2.19 → 1.2.20
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/types.d.ts
CHANGED
|
@@ -101,10 +101,13 @@ export interface FFOPAConfig {
|
|
|
101
101
|
ui5Theme?: string;
|
|
102
102
|
useVirtualPreviewEndpoints?: boolean;
|
|
103
103
|
}
|
|
104
|
+
export type ObjectPageNavigationParent = {
|
|
105
|
+
name: string;
|
|
106
|
+
navigationProperty: string;
|
|
107
|
+
};
|
|
104
108
|
export type ObjectPageNavigationParents = {
|
|
105
109
|
parentLRName?: string;
|
|
106
|
-
|
|
107
|
-
parentOPTableSection?: string;
|
|
110
|
+
parentOPs: ObjectPageNavigationParent[];
|
|
108
111
|
};
|
|
109
112
|
export type SectionFormField = {
|
|
110
113
|
property: string;
|
|
@@ -60,26 +60,40 @@ export function getObjectPages(applicationModel) {
|
|
|
60
60
|
return objectPages;
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
* Finds parent
|
|
63
|
+
* Finds the chain of parent Object Pages leading from the List Report down to the target page.
|
|
64
64
|
*
|
|
65
65
|
* @param targetObjectPageKey - key of the target object page
|
|
66
66
|
* @param objectPages - the array of object pages extracted from the application model
|
|
67
67
|
* @param listReportPageKey - the key of the List Report page in the application model, used to find navigation routes to object pages
|
|
68
|
-
* @returns navigation data including
|
|
68
|
+
* @returns navigation data including the ordered ancestor Object Page chain
|
|
69
69
|
*/
|
|
70
70
|
function getObjectPageNavigationParents(targetObjectPageKey, objectPages, listReportPageKey) {
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
const parentOPs = [];
|
|
72
|
+
const visited = new Set([targetObjectPageKey]); // guard against infinite loop in case of invalid manifest entries
|
|
73
|
+
let cursor = targetObjectPageKey;
|
|
74
|
+
while (true) {
|
|
75
|
+
const childKey = cursor;
|
|
76
|
+
let parent;
|
|
77
|
+
let parentNavigationProperty;
|
|
78
|
+
for (const objectPage of objectPages) {
|
|
79
|
+
const route = getNavigationRoutes(objectPage).find((navigation) => navigation.route === childKey);
|
|
80
|
+
if (route) {
|
|
81
|
+
parent = objectPage;
|
|
82
|
+
parentNavigationProperty = route.identifier;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
80
85
|
}
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
if (!parent?.name || !parentNavigationProperty || visited.has(parent.name)) {
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
visited.add(parent.name);
|
|
90
|
+
parentOPs.unshift({ name: parent.name, navigationProperty: parentNavigationProperty });
|
|
91
|
+
cursor = parent.name;
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
parentLRName: listReportPageKey ?? '', // app is possibly malformed if no LR found
|
|
95
|
+
parentOPs
|
|
96
|
+
};
|
|
83
97
|
}
|
|
84
98
|
/**
|
|
85
99
|
* Extracts header sections data from an object page model.
|
package/package.json
CHANGED
|
@@ -33,11 +33,11 @@ sap.ui.define([
|
|
|
33
33
|
Then.onThe<%- navigationParents.parentLRName%>Generated.onTable().iCheckRows();
|
|
34
34
|
When.onThe<%- navigationParents.parentLRName%>Generated.onTable().iPressRow(0);
|
|
35
35
|
<% } -%>
|
|
36
|
-
<%
|
|
37
|
-
Then.onThe<%-
|
|
38
|
-
Then.onThe<%-
|
|
39
|
-
When.onThe<%-
|
|
40
|
-
<% } %>
|
|
36
|
+
<% navigationParents.parentOPs.forEach(function(parent) { %>
|
|
37
|
+
Then.onThe<%- parent.name %>Generated.iSeeThisPage();
|
|
38
|
+
Then.onThe<%- parent.name %>Generated.onTable({ property: "<%- parent.navigationProperty %>" }).iCheckRows();
|
|
39
|
+
When.onThe<%- parent.name %>Generated.onTable({ property: "<%- parent.navigationProperty %>" }).iPressRow(0);
|
|
40
|
+
<% }); %>
|
|
41
41
|
Then.onThe<%- name%>Generated.iSeeThisPage();
|
|
42
42
|
});
|
|
43
43
|
|
|
@@ -52,11 +52,11 @@ function journey() {
|
|
|
52
52
|
Then.onThe<%- navigationParents.parentLRName%>Generated.onTable("").iCheckRows();
|
|
53
53
|
When.onThe<%- navigationParents.parentLRName%>Generated.onTable("").iPressRow(0);
|
|
54
54
|
<% } -%>
|
|
55
|
-
<%
|
|
56
|
-
Then.onThe<%-
|
|
57
|
-
Then.onThe<%-
|
|
58
|
-
When.onThe<%-
|
|
59
|
-
<% } %>
|
|
55
|
+
<% navigationParents.parentOPs.forEach(function(parent) { %>
|
|
56
|
+
Then.onThe<%- parent.name %>Generated.iSeeThisPage();
|
|
57
|
+
Then.onThe<%- parent.name %>Generated.onTable({ property: "<%- parent.navigationProperty %>" }).iCheckRows();
|
|
58
|
+
When.onThe<%- parent.name %>Generated.onTable({ property: "<%- parent.navigationProperty %>" }).iPressRow(0);
|
|
59
|
+
<% }); %>
|
|
60
60
|
Then.onThe<%- name%>Generated.iSeeThisPage();
|
|
61
61
|
});
|
|
62
62
|
|