@sap-ux/ui5-test-writer 1.4.1 → 1.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/ui5-test-writer",
3
3
  "description": "SAP UI5 tests writer",
4
- "version": "1.4.1",
4
+ "version": "1.4.2",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -88,11 +88,15 @@ sap.ui.define([
88
88
  });
89
89
  <% } -%>
90
90
 
91
- <% if (bodySections?.length > 0) { -%>
92
- <% const usesWhenInBody = bodySections.length > 1 || bodySections.some(function(section) { return section.subSections && section.subSections.length > 0; }); -%>
93
- opaTest("Check body sections of the Object Page", function (_Given, <% if (usesWhenInBody) { %>When<% } else { %>_When<% } %>, Then) {
91
+ <% if (bodySections?.length > 1) { -%>
92
+ opaTest("Check the number of sections of the Object Page", function (_Given, _When, Then) {
94
93
  Then.onThe<%- name%>Generated.iCheckNumberOfSections(<%- bodySections.length %>);
94
+ });
95
+
96
+ <% } -%>
97
+ <% if (bodySections?.length > 0) { -%>
95
98
  <% bodySections.forEach(function(section) { -%>
99
+ opaTest("Check the <%- section.id %> section of the Object Page", function (_Given, <% if (bodySections.length > 1 || (section.subSections && section.subSections.length > 0)) { %>When<% } else { %>_When<% } %>, Then) {
96
100
  <% if (bodySections.length > 1) { -%>
97
101
  When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>" });
98
102
  <% } -%>
@@ -151,10 +155,10 @@ sap.ui.define([
151
155
  Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(section.tableColumns) %>);
152
156
  <% } -%>
153
157
  <% } -%>
158
+ });
159
+
154
160
  <% }) -%>
155
- });
156
161
  <% } -%>
157
-
158
162
  opaTest("Teardown", function (Given, When, Then) {
159
163
  // Cleanup
160
164
  Given.iTearDownMyApp();
@@ -110,10 +110,15 @@ function journey() {
110
110
  });
111
111
  <% } -%>
112
112
 
113
- <% if (bodySections?.length > 0) { -%>
114
- opaTest("Check body sections of the Object Page", function (_Given: Given, <% if (usesWhenInBody) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
113
+ <% if (bodySections?.length > 1) { -%>
114
+ opaTest("Check the number of sections of the Object Page", function (_Given: Given, _When: When, Then: Then) {
115
115
  Then.onThe<%- name%>Generated.iCheckNumberOfSections(<%- bodySections.length %>);
116
+ });
117
+
118
+ <% } -%>
119
+ <% if (bodySections?.length > 0) { -%>
116
120
  <% bodySections.forEach(function(section) { -%>
121
+ opaTest("Check the <%- section.id %> section of the Object Page", function (_Given: Given, <% if (usesWhenInBody) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
117
122
  <% if (bodySections.length > 1) { -%>
118
123
  When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>" });
119
124
  <% } -%>
@@ -172,10 +177,10 @@ function journey() {
172
177
  Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(section.tableColumns) %>);
173
178
  <% } -%>
174
179
  <% } -%>
180
+ });
181
+
175
182
  <% }) -%>
176
- });
177
183
  <% } -%>
178
-
179
184
  opaTest("Teardown", function (Given: Given) {
180
185
  // Cleanup
181
186
  Given.iTearDownMyApp();
@@ -88,12 +88,15 @@ sap.ui.define([
88
88
  });
89
89
  <% } -%>
90
90
 
91
- <% if (bodySections?.length > 0) { -%>
92
- opaTest("Check body sections of the Object Page", function (Given, When, Then) {
93
91
  <% if (bodySections?.length > 1) { -%>
92
+ opaTest("Check the number of sections of the Object Page", function (_Given, _When, Then) {
94
93
  Then.onThe<%- name%>Generated.iCheckNumberOfSections(<%- bodySections.length %>);
94
+ });
95
+
95
96
  <% } -%>
97
+ <% if (bodySections?.length > 0) { -%>
96
98
  <% bodySections.forEach(function(section) { -%>
99
+ opaTest("Check the <%- section.id %> section of the Object Page", function (_Given, <% if (bodySections.length > 1) { %>When<% } else { %>_When<% } %>, Then) {
97
100
  <% if (bodySections.length > 1) { -%>
98
101
  When.onThe<%- name%>Generated.iPressSectionIconTabFilterButton("<%- section.id %>");
99
102
  <% } -%>
@@ -152,10 +155,10 @@ sap.ui.define([
152
155
  Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(section.tableColumns) %>);
153
156
  <% } -%>
154
157
  <% } -%>
158
+ });
159
+
155
160
  <% }) -%>
156
- });
157
161
  <% } -%>
158
-
159
162
  opaTest("Teardown", function (Given, When, Then) {
160
163
  // Cleanup
161
164
  Given.iTearDownMyApp();
@@ -107,12 +107,15 @@ function journey() {
107
107
  });
108
108
  <% } -%>
109
109
 
110
- <% if (bodySections?.length > 0) { -%>
111
- opaTest("Check body sections of the Object Page", function (_Given: Given, <% if (bodySections?.length > 1) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
112
110
  <% if (bodySections?.length > 1) { -%>
111
+ opaTest("Check the number of sections of the Object Page", function (_Given: Given, _When: When, Then: Then) {
113
112
  Then.onThe<%- name%>Generated.iCheckNumberOfSections(<%- bodySections.length %>);
113
+ });
114
+
114
115
  <% } -%>
116
+ <% if (bodySections?.length > 0) { -%>
115
117
  <% bodySections.forEach(function(section) { -%>
118
+ opaTest("Check the <%- section.id %> section of the Object Page", function (_Given: Given, <% if (bodySections?.length > 1) { %>When: When<% } else { %>_When: When<% } %>, Then: Then) {
116
119
  <% if (bodySections.length > 1) { -%>
117
120
  When.onThe<%- name%>Generated.iPressSectionIconTabFilterButton("<%- section.id %>");
118
121
  <% } -%>
@@ -171,10 +174,10 @@ function journey() {
171
174
  Then.onThe<%- name%>Generated.onTable({ property: "<%- section.navigationProperty %>" }).iCheckColumns(undefined, <%- JSON.stringify(section.tableColumns) %>);
172
175
  <% } -%>
173
176
  <% } -%>
177
+ });
178
+
174
179
  <% }) -%>
175
- });
176
180
  <% } -%>
177
-
178
181
  opaTest("Teardown", function (Given: Given) {
179
182
  // Cleanup
180
183
  Given.iTearDownMyApp();