@sap-ux/ui5-test-writer 1.8.0 → 1.8.1

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.8.0",
4
+ "version": "1.8.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -132,8 +132,10 @@ sap.ui.define([
132
132
  <% } -%>
133
133
  <% if (section?.subSections?.length > 0) { -%>
134
134
  <% section.subSections.forEach(function(subSection) { -%>
135
+ <% if (section.subSections.length > 1) { -%>
135
136
  //When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>", subSection: "<%- subSection.id %>" });
136
137
  Then.onThe<%- name%>Generated.iCheckSubSection({ section: "<%- subSection.id %>" });
138
+ <% } -%>
137
139
  <% if (subSection.fields && subSection.fields.length > 0) { -%>
138
140
  <% subSection.fields.forEach(function(field) { -%>
139
141
  Then.onThe<%- name%>Generated.onForm({ section: "<%- subSection.id %>" }).iCheckField({ property: "<%- field.property %>"<% if (field.connectedFields) { %>, connectedFields: "<%- field.connectedFields %>"<% } %><% if (field.fieldGroup) { %>, fieldGroup: "<%- field.fieldGroup %>"<% } %> });
@@ -151,8 +151,10 @@ function journey() {
151
151
  <% } -%>
152
152
  <% if (section?.subSections?.length > 0) { -%>
153
153
  <% section.subSections.forEach(function(subSection) { -%>
154
+ <% if (section.subSections.length > 1) { -%>
154
155
  //When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>", subSection: "<%- subSection.id %>" });
155
156
  Then.onThe<%- name%>Generated.iCheckSubSection({ section: "<%- subSection.id %>" }, {});
157
+ <% } -%>
156
158
  <% if (subSection.fields && subSection.fields.length > 0) { -%>
157
159
  <% subSection.fields.forEach(function(field) { -%>
158
160
  Then.onThe<%- name%>Generated.onForm({ section: "<%- subSection.id %>" } as unknown as FormIdentifier).iCheckField({ property: "<%- field.property %>"<% if (field.connectedFields) { %>, connectedFields: "<%- field.connectedFields %>"<% } %><% if (field.fieldGroup) { %>, fieldGroup: "<%- field.fieldGroup %>"<% } %> });
@@ -132,8 +132,10 @@ sap.ui.define([
132
132
  <% } -%>
133
133
  <% if (section?.subSections?.length > 0) { -%>
134
134
  <% section.subSections.forEach(function(subSection) { -%>
135
+ <% if (section.subSections.length > 1) { -%>
135
136
  //When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>", subSection: "<%- subSection.id %>" });
136
137
  Then.onThe<%- name%>Generated.iCheckSubSection({ section: "<%- subSection.id %>" });
138
+ <% } -%>
137
139
  <% if (subSection.fields && subSection.fields.length > 0) { -%>
138
140
  <% subSection.fields.forEach(function(field) { -%>
139
141
  Then.onThe<%- name%>Generated.onForm({ section: "<%- subSection.id %>" }).iCheckField({ property: "<%- field.property %>"<% if (field.connectedFields) { %>, connectedFields: "<%- field.connectedFields %>"<% } %><% if (field.fieldGroup) { %>, fieldGroup: "<%- field.fieldGroup %>"<% } %> });
@@ -151,8 +151,10 @@ function journey() {
151
151
  <% } -%>
152
152
  <% if (section?.subSections?.length > 0) { -%>
153
153
  <% section.subSections.forEach(function(subSection) { -%>
154
+ <% if (section.subSections.length > 1) { -%>
154
155
  //When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>", subSection: "<%- subSection.id %>" });
155
156
  Then.onThe<%- name%>Generated.iCheckSubSection({ section: "<%- subSection.id %>" }, {});
157
+ <% } -%>
156
158
  <% if (subSection.fields && subSection.fields.length > 0) { -%>
157
159
  <% subSection.fields.forEach(function(field) { -%>
158
160
  Then.onThe<%- name%>Generated.onForm({ section: "<%- subSection.id %>" } as unknown as FormIdentifier).iCheckField({ property: "<%- field.property %>"<% if (field.connectedFields) { %>, connectedFields: "<%- field.connectedFields %>"<% } %><% if (field.fieldGroup) { %>, fieldGroup: "<%- field.fieldGroup %>"<% } %> });
@@ -104,7 +104,7 @@ sap.ui.define([
104
104
  <% } -%>
105
105
  <% if (bodySections?.length > 0) { -%>
106
106
  <% bodySections.forEach(function(section) { -%>
107
- 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) {
107
+ opaTest("Check the <%- section.id %> section of the Object Page", function (_Given, <% if (bodySections.length > 1 || (section.subSections && section.subSections.length > 1) || (section.contactCardFields && section.contactCardFields.length > 0) || (section.contactCardColumns && section.contactCardColumns.length > 0) || (section.subSections || []).some(function(sub){ return (sub.contactCardFields && sub.contactCardFields.length > 0) || (sub.contactCardColumns && sub.contactCardColumns.length > 0); })) { %>When<% } else { %>_When<% } %>, Then) {
108
108
  <% if (bodySections.length > 1) { -%>
109
109
  When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>" });
110
110
  <% } -%>
@@ -146,8 +146,10 @@ sap.ui.define([
146
146
  <% } -%>
147
147
  <% if (section?.subSections?.length > 0) { -%>
148
148
  <% section.subSections.forEach(function(subSection) { -%>
149
+ <% if (section.subSections.length > 1) { -%>
149
150
  When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>", subSection: "<%- subSection.id %>" });
150
151
  Then.onThe<%- name%>Generated.iCheckSubSection({ section: "<%- subSection.id %>" });
152
+ <% } -%>
151
153
  <% if (subSection.fields && subSection.fields.length > 0) { -%>
152
154
  <% subSection.fields.forEach(function(field) { -%>
153
155
  Then.onThe<%- name%>Generated.onForm({ section: "<%- subSection.id %>" }).iCheckField({ property: "<%- field.property %>"<% if (field.connectedFields) { %>, connectedFields: "<%- field.connectedFields %>"<% } %><% if (field.fieldGroup) { %>, fieldGroup: "<%- field.fieldGroup %>"<% } %> });
@@ -32,7 +32,10 @@ const usesFormIdentifier = (bodySections || []).some(function(section) {
32
32
  return subSectionsHaveForm || sectionHasFormFields || hasFormAction;
33
33
  });
34
34
  const usesWhenInBody = (bodySections || []).length > 1 || (bodySections || []).some(function(section) {
35
- return section.subSections && section.subSections.length > 0;
35
+ return (section.subSections && section.subSections.length > 1)
36
+ || (section.contactCardFields && section.contactCardFields.length > 0)
37
+ || (section.contactCardColumns && section.contactCardColumns.length > 0)
38
+ || (section.subSections || []).some(function(sub) { return (sub.contactCardFields && sub.contactCardFields.length > 0) || (sub.contactCardColumns && sub.contactCardColumns.length > 0); });
36
39
  });
37
40
  -%>
38
41
  <% if (usesFieldIdentifier) { -%>
@@ -168,8 +171,10 @@ function journey() {
168
171
  <% } -%>
169
172
  <% if (section?.subSections?.length > 0) { -%>
170
173
  <% section.subSections.forEach(function(subSection) { -%>
174
+ <% if (section.subSections.length > 1) { -%>
171
175
  When.onThe<%- name%>Generated.iGoToSection({ section: "<%- section.id %>", subSection: "<%- subSection.id %>" });
172
176
  Then.onThe<%- name%>Generated.iCheckSubSection({ section: "<%- subSection.id %>" }, {});
177
+ <% } -%>
173
178
  <% if (subSection.fields && subSection.fields.length > 0) { -%>
174
179
  <% subSection.fields.forEach(function(field) { -%>
175
180
  Then.onThe<%- name%>Generated.onForm({ section: "<%- subSection.id %>" } as unknown as FormIdentifier).iCheckField({ property: "<%- field.property %>"<% if (field.connectedFields) { %>, connectedFields: "<%- field.connectedFields %>"<% } %><% if (field.fieldGroup) { %>, fieldGroup: "<%- field.fieldGroup %>"<% } %> });