@sap-ux/ui5-test-writer 1.9.6 → 1.10.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/types.d.ts CHANGED
@@ -129,6 +129,14 @@ export type TableColumnFeatureData = Record<string, TableColumn>;
129
129
  export type ContactCardField = {
130
130
  property: string;
131
131
  };
132
+ /**
133
+ * A table column whose bound property carries both a `Common.Text` annotation and a
134
+ * `UI.TextArrangement` annotation. `textProperty` is the text/description property the
135
+ * column can be sorted by (the `Common.Text` target, e.g. "CustomerName").
136
+ */
137
+ export type TextAnnotationColumn = {
138
+ textProperty: string;
139
+ };
132
140
  export type BodySubSectionFeatureData = {
133
141
  id: string;
134
142
  navigationProperty?: string;
@@ -190,6 +198,11 @@ export type ListReportFeatures = {
190
198
  tableColumns?: Record<string, Record<string, string | number | boolean>>;
191
199
  contactCardColumns: ContactCardField[];
192
200
  toolBarActions?: ActionButtonState[];
201
+ /**
202
+ * Columns whose bound property has both a `Common.Text` and a `UI.TextArrangement`
203
+ * annotation; used to generate sort-order tests against the text/description property.
204
+ */
205
+ textAnnotationColumns?: TextAnnotationColumn[];
193
206
  isALP?: boolean;
194
207
  /**
195
208
  * Non-custom tab keys (`views.paths[].key`) for multi-tab List Reports; empty for
@@ -63,9 +63,10 @@ export declare function isALPFromManifest(manifest: Manifest, targetKey?: string
63
63
  * @param metadata - optional metadata for the OPA test generation
64
64
  * @param manifest - optional application manifest, used to detect ALP configuration
65
65
  * @param resolveLabel - resolver for i18n placeholder labels (`{i18n>key}` → translated text)
66
+ * @param annotationFiles - optional local annotation XML files merged with the metadata
66
67
  * @returns feature data extracted from the List Report page model
67
68
  */
68
- export declare function getListReportFeatures(listReportPage: PageWithModelV4, log?: Logger, metadata?: string, manifest?: Manifest, resolveLabel?: I18nLabelResolver): ListReportFeatures;
69
+ export declare function getListReportFeatures(listReportPage: PageWithModelV4, log?: Logger, metadata?: string, manifest?: Manifest, resolveLabel?: I18nLabelResolver, annotationFiles?: string[]): ListReportFeatures;
69
70
  /**
70
71
  * Retrieves toolbar action definitions from the given tree model.
71
72
  *
@@ -166,6 +167,27 @@ export declare function getPropertyLabelFromMetadata(convertedMetadata: Converte
166
167
  * @returns true if the property is hidden from the filter adaptation dialog
167
168
  */
168
169
  export declare function isHiddenFilter(convertedMetadata: ConvertedMetadata, entitySetName: string | undefined, propertyName: string): boolean;
170
+ /**
171
+ * Returns true if the property carries a `@com.sap.vocabularies.UI.v1.TextArrangement`
172
+ * annotation nested on its `@com.sap.vocabularies.Common.v1.Text` annotation.
173
+ *
174
+ * @param convertedMetadata - already-converted OData metadata (metadata merged with local annotations)
175
+ * @param entitySetName - name of the entity set that owns the property (undefined → false)
176
+ * @param propertyName - name of the property to inspect
177
+ * @returns true if the property has a text arrangement annotation
178
+ */
179
+ export declare function hasTextArrangement(convertedMetadata: ConvertedMetadata, entitySetName: string | undefined, propertyName: string): boolean;
180
+ /**
181
+ * Returns true if the property carries a `@com.sap.vocabularies.UI.v1.Hidden` annotation.
182
+ * A hidden property is not exposed as a sortable column in the sort dialog, so it cannot be
183
+ * used as a sort target.
184
+ *
185
+ * @param convertedMetadata - already-converted OData metadata (metadata merged with local annotations)
186
+ * @param entitySetName - name of the entity set that owns the property (undefined → false)
187
+ * @param propertyName - name of the property to inspect
188
+ * @returns true if the property is hidden
189
+ */
190
+ export declare function isHiddenProperty(convertedMetadata: ConvertedMetadata, entitySetName: string | undefined, propertyName: string): boolean;
169
191
  /**
170
192
  * Checks the state of action buttons defined in UI.LineItem annotations for a given entity set.
171
193
  *
@@ -1,7 +1,7 @@
1
1
  import { getFilterFields, getSelectionFieldItems, getSelectionFieldItemsWithLabels, getTableColumnData, getAggregations } from './modelUtils.js';
2
2
  import { passthroughLabelResolver } from './i18nUtils.js';
3
- import { extractContactCardColumnsFromNode, resolvePrimaryTableNode } from './tableUtils.js';
4
- import { parse } from '@sap-ux/edmx-parser';
3
+ import { extractContactCardColumnsFromNode, extractTextAnnotationColumnsFromNode, resolvePrimaryTableNode } from './tableUtils.js';
4
+ import { parse, merge } from '@sap-ux/edmx-parser';
5
5
  import { convert } from '@sap-ux/annotation-converter';
6
6
  import { extractActionMethodName, buildActionButtonState, safeCheckButtonVisibility, safeCheckButtonVisibilityFromMetadata } from './actionUtils.js';
7
7
  import { t } from '../i18n.js';
@@ -92,9 +92,10 @@ export function isALPFromManifest(manifest, targetKey) {
92
92
  * @param metadata - optional metadata for the OPA test generation
93
93
  * @param manifest - optional application manifest, used to detect ALP configuration
94
94
  * @param resolveLabel - resolver for i18n placeholder labels (`{i18n>key}` → translated text)
95
+ * @param annotationFiles - optional local annotation XML files merged with the metadata
95
96
  * @returns feature data extracted from the List Report page model
96
97
  */
97
- export function getListReportFeatures(listReportPage, log, metadata, manifest, resolveLabel = passthroughLabelResolver) {
98
+ export function getListReportFeatures(listReportPage, log, metadata, manifest, resolveLabel = passthroughLabelResolver, annotationFiles = []) {
98
99
  const toolbarActions = getToolBarActionNames(listReportPage.model, log);
99
100
  const filterFieldEntries = getFilterFieldItems(listReportPage.model, log);
100
101
  const customFilterFieldProperties = getCustomFilterFieldProperties(manifest, listReportPage.name);
@@ -105,7 +106,15 @@ export function getListReportFeatures(listReportPage, log, metadata, manifest, r
105
106
  if (metadata && listReportPage.entitySet) {
106
107
  const entitySetName = listReportPage.entitySet;
107
108
  try {
108
- convertedMetadata = convert(parse(metadata));
109
+ // Merge local annotation files (e.g. UI.TextArrangement defined only in annotation.xml)
110
+ // with the service metadata before converting. Each source must be parsed with a distinct
111
+ // fileId; otherwise merge treats them as the same file and later `Annotations` blocks
112
+ // overwrite (rather than complement) the metadata's property-level annotations.
113
+ const parsedAnnotations = annotationFiles.map((xml, index) => parse(xml, `annotationFile${index}`));
114
+ const rawMetadata = parsedAnnotations.length
115
+ ? merge(parse(metadata, 'metadata'), ...parsedAnnotations)
116
+ : parse(metadata);
117
+ convertedMetadata = convert(rawMetadata);
109
118
  buttonVisibility = safeCheckButtonVisibilityFromMetadata(convertedMetadata, entitySetName, log);
110
119
  semanticKeyProperties = safeGetSemanticKeyProperties(convertedMetadata, entitySetName, log);
111
120
  toolBarActions = safeCheckActionButtonStates(convertedMetadata, entitySetName, toolbarActions, log);
@@ -142,6 +151,16 @@ export function getListReportFeatures(listReportPage, log, metadata, manifest, r
142
151
  // `@UI.HiddenFilter` properties cannot be added via the adaptation dialog; skip the check when metadata is missing.
143
152
  .filter((key) => !convertedMetadata || !isHiddenFilter(convertedMetadata, listReportPage.entitySet, key))
144
153
  : undefined;
154
+ // Columns with a text annotation only get a sort-order test when their bound property also
155
+ // carries a UI.TextArrangement annotation (checked against the merged metadata), and the text
156
+ // (sort target) property is not hidden — a hidden property is not a sortable column.
157
+ const meta = convertedMetadata;
158
+ const textAnnotationColumns = meta
159
+ ? extractTextAnnotationColumnsFromNode(listReportPage.model.root)
160
+ .filter((candidate) => hasTextArrangement(meta, listReportPage.entitySet, candidate.columnProperty) &&
161
+ !isHiddenProperty(meta, listReportPage.entitySet, candidate.textProperty))
162
+ .map((candidate) => ({ textProperty: candidate.textProperty }))
163
+ : [];
145
164
  return {
146
165
  name: listReportPage.name,
147
166
  createButton: buildButtonState(buttonVisibility?.create),
@@ -150,6 +169,7 @@ export function getListReportFeatures(listReportPage, log, metadata, manifest, r
150
169
  tableColumns: getTableColumnData(listReportPage.model, log),
151
170
  contactCardColumns: extractContactCardColumnsFromNode(listReportPage.model.root),
152
171
  toolBarActions,
172
+ textAnnotationColumns,
153
173
  isALP: manifest ? isALPFromManifest(manifest, listReportPage.name) : false,
154
174
  tableIdentifiers: getTableIdentifiers(manifest, listReportPage.name),
155
175
  semanticKey: {
@@ -388,6 +408,45 @@ export function isHiddenFilter(convertedMetadata, entitySetName, propertyName) {
388
408
  // `HiddenFilter: false` as hidden. Coerce via `valueOf()` to read the underlying boolean.
389
409
  return property?.annotations?.UI?.HiddenFilter?.valueOf() === true;
390
410
  }
411
+ /**
412
+ * Returns true if the property carries a `@com.sap.vocabularies.UI.v1.TextArrangement`
413
+ * annotation nested on its `@com.sap.vocabularies.Common.v1.Text` annotation.
414
+ *
415
+ * @param convertedMetadata - already-converted OData metadata (metadata merged with local annotations)
416
+ * @param entitySetName - name of the entity set that owns the property (undefined → false)
417
+ * @param propertyName - name of the property to inspect
418
+ * @returns true if the property has a text arrangement annotation
419
+ */
420
+ export function hasTextArrangement(convertedMetadata, entitySetName, propertyName) {
421
+ if (!entitySetName) {
422
+ return false;
423
+ }
424
+ const entitySet = convertedMetadata.entitySets.find((es) => es.name === entitySetName);
425
+ const property = entitySet?.entityType?.entityProperties?.find((p) => p.name === propertyName);
426
+ // TextArrangement is a nested annotation on the Common.Text term (see vocabularies-types Common.Text).
427
+ return property?.annotations?.Common?.Text?.annotations?.UI?.TextArrangement !== undefined;
428
+ }
429
+ /**
430
+ * Returns true if the property carries a `@com.sap.vocabularies.UI.v1.Hidden` annotation.
431
+ * A hidden property is not exposed as a sortable column in the sort dialog, so it cannot be
432
+ * used as a sort target.
433
+ *
434
+ * @param convertedMetadata - already-converted OData metadata (metadata merged with local annotations)
435
+ * @param entitySetName - name of the entity set that owns the property (undefined → false)
436
+ * @param propertyName - name of the property to inspect
437
+ * @returns true if the property is hidden
438
+ */
439
+ export function isHiddenProperty(convertedMetadata, entitySetName, propertyName) {
440
+ if (!entitySetName) {
441
+ return false;
442
+ }
443
+ const entitySet = convertedMetadata.entitySets.find((es) => es.name === entitySetName);
444
+ const property = entitySet?.entityType?.entityProperties?.find((p) => p.name === propertyName);
445
+ // The converted `@UI.Hidden` value is a Boolean wrapper object (it carries annotation metadata),
446
+ // so it is always truthy — coerce via `valueOf()` to read the underlying boolean and treat an
447
+ // explicit `Hidden: false` as not hidden.
448
+ return property?.annotations?.UI?.Hidden?.valueOf() === true;
449
+ }
391
450
  /**
392
451
  * Checks the state of action buttons defined in UI.LineItem annotations for a given entity set.
393
452
  *
@@ -37,7 +37,8 @@ export async function getAppFeatures(basePath, fs, log, metadata, manifest) {
37
37
  let objectPages = null;
38
38
  let fpmPage = null;
39
39
  let projectMetadata = metadata;
40
- let resolveLabel;
40
+ let annotationFiles = [];
41
+ let resolveLabel = passthroughLabelResolver;
41
42
  // Read application model to extract control information needed for test generation
42
43
  // specification and readApp might not be available due to specification version, fail gracefully
43
44
  try {
@@ -59,6 +60,15 @@ export async function getAppFeatures(basePath, fs, log, metadata, manifest) {
59
60
  projectMetadata = fs?.read(metadataPath);
60
61
  }
61
62
  }
63
+ // Local annotation files (e.g. webapp/annotations/annotation.xml) are not part of the
64
+ // service $metadata; read them so annotations defined only locally (e.g. UI.TextArrangement)
65
+ // are available when the metadata is converted.
66
+ const annotationRefs = appAccess.project?.apps['']?.services?.mainService?.annotations ?? [];
67
+ annotationFiles = annotationRefs
68
+ .map((annotation) => annotation.local)
69
+ .filter((path) => !!path)
70
+ .map((path) => fs?.read(path))
71
+ .filter((content) => !!content);
62
72
  resolveLabel = await buildLabelResolver(appAccess, log);
63
73
  listReportPage = appModel?.applicationModel ? getListReportPage(appModel.applicationModel) : listReportPage;
64
74
  objectPages = appModel?.applicationModel ? getObjectPages(appModel.applicationModel) : objectPages;
@@ -76,7 +86,7 @@ export async function getAppFeatures(basePath, fs, log, metadata, manifest) {
76
86
  // attempt to get individual feature data
77
87
  try {
78
88
  if (listReportPage) {
79
- featureData.listReport = getListReportFeatures(listReportPage, log, projectMetadata, manifest, resolveLabel);
89
+ featureData.listReport = getListReportFeatures(listReportPage, log, projectMetadata, manifest, resolveLabel, annotationFiles);
80
90
  }
81
91
  if (objectPages) {
82
92
  featureData.objectPages = await getObjectPageFeatures(objectPages, listReportPage?.name, log, projectMetadata, manifest, listReportPage?.entitySet, resolveLabel);
@@ -13,8 +13,21 @@ type ColumnModelItem = {
13
13
  availability?: {
14
14
  value?: string;
15
15
  };
16
+ text?: {
17
+ value?: string;
18
+ artifactType?: string;
19
+ };
16
20
  };
17
21
  };
22
+ /**
23
+ * A column that carries a text annotation in the spec model. `columnProperty` is the
24
+ * column's own bound property (used to look up the `UI.TextArrangement` annotation in the
25
+ * OData metadata); `textProperty` is the `Common.Text` target property (used as the sort name).
26
+ */
27
+ export type TextAnnotationColumnCandidate = {
28
+ columnProperty: string;
29
+ textProperty: string;
30
+ };
18
31
  export type ColumnAggregations = TreeAggregations & {
19
32
  [key: string]: ColumnModelItem;
20
33
  };
@@ -62,5 +75,15 @@ export declare function extractTableColumnsFromNode(node: TreeAggregation): Tabl
62
75
  * @returns array of Contact-card field descriptors for use with iClickLink/iCheckLink
63
76
  */
64
77
  export declare function extractContactCardColumnsFromNode(node: TreeAggregation): ContactCardField[];
78
+ /**
79
+ * Extracts columns that carry a text annotation (`properties.text.artifactType === 'Annotation'`
80
+ * with a real value) from a spec model node that contains a 'table' aggregation. The
81
+ * `UI.TextArrangement` gate is applied later by the caller, as it requires OData metadata not
82
+ * present in the spec model.
83
+ *
84
+ * @param node - tree aggregation node that exposes a 'table' aggregation
85
+ * @returns candidate columns with their bound property and the text annotation target property
86
+ */
87
+ export declare function extractTextAnnotationColumnsFromNode(node: TreeAggregation): TextAnnotationColumnCandidate[];
65
88
  export {};
66
89
  //# sourceMappingURL=tableUtils.d.ts.map
@@ -127,4 +127,47 @@ export function extractContactCardColumnsFromNode(node) {
127
127
  });
128
128
  return contactColumns;
129
129
  }
130
+ /**
131
+ * Extracts columns that carry a text annotation (`properties.text.artifactType === 'Annotation'`
132
+ * with a real value) from a spec model node that contains a 'table' aggregation. The
133
+ * `UI.TextArrangement` gate is applied later by the caller, as it requires OData metadata not
134
+ * present in the spec model.
135
+ *
136
+ * @param node - tree aggregation node that exposes a 'table' aggregation
137
+ * @returns candidate columns with their bound property and the text annotation target property
138
+ */
139
+ export function extractTextAnnotationColumnsFromNode(node) {
140
+ const tableNode = resolvePrimaryTableNode(node);
141
+ if (!tableNode) {
142
+ return [];
143
+ }
144
+ const columnsAggregation = getAggregations(tableNode)['columns'];
145
+ if (!columnsAggregation) {
146
+ return [];
147
+ }
148
+ const columnItems = getAggregations(columnsAggregation);
149
+ const candidates = [];
150
+ const seenTextProperties = new Set();
151
+ Object.entries(columnItems).forEach(([columnKey, column]) => {
152
+ if (!isDefaultAvailableColumn(column)) {
153
+ return;
154
+ }
155
+ const text = column.properties?.text;
156
+ if (text?.artifactType !== 'Annotation' || !text.value || text.value === 'none') {
157
+ return;
158
+ }
159
+ // A text target reached through a navigation property (e.g. "_DunningProcedure/DunningProcedure_Text")
160
+ // is not exposed as a sortable column in the sort dialog, so it cannot be used as a sort name.
161
+ if (text.value.includes('/')) {
162
+ return;
163
+ }
164
+ const columnProperty = getColumnIdentifier(column, columnKey);
165
+ if (!columnProperty || seenTextProperties.has(text.value)) {
166
+ return;
167
+ }
168
+ seenTextProperties.add(text.value);
169
+ candidates.push({ columnProperty, textProperty: text.value });
170
+ });
171
+ return candidates;
172
+ }
130
173
  //# sourceMappingURL=tableUtils.js.map
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.9.6",
4
+ "version": "1.10.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -30,8 +30,8 @@
30
30
  "@sap-ux/annotation-converter": "0.10.22",
31
31
  "@sap-ux/ui5-application-writer": "2.1.5",
32
32
  "@sap-ux/logger": "1.0.3",
33
- "@sap-ux/project-access": "2.1.13",
34
33
  "@sap-ux/fiori-generator-shared": "1.2.13",
34
+ "@sap-ux/project-access": "2.1.13",
35
35
  "@sap-ux/preview-middleware": "1.2.9"
36
36
  },
37
37
  "devDependencies": {
@@ -17,8 +17,9 @@
17
17
 
18
18
  sap.ui.define([
19
19
  "sap/ui/test/opaQunit",
20
- "./pages/JourneyRunner"
21
- ], function (opaTest, runner) {
20
+ "./pages/JourneyRunner"<% if (textAnnotationColumns && textAnnotationColumns.length > 0) { %>,
21
+ "sap/ui/core/library"<% } %>
22
+ ], function (opaTest, runner<% if (textAnnotationColumns && textAnnotationColumns.length > 0) { %>, coreLibrary<% } %>) {
22
23
  "use strict";
23
24
 
24
25
  function journey() {
@@ -96,6 +97,14 @@ sap.ui.define([
96
97
  <%_ } -%>
97
98
  });
98
99
  <%_ } -%>
100
+ <%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
101
+ opaTest("Check text annotation for columns", function (Given, When, Then) {
102
+ <%_ textAnnotationColumns.forEach(function(column) { _%>
103
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending);
104
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending, true);
105
+ <%_ }); -%>
106
+ });
107
+ <%_ } -%>
99
108
 
100
109
  <%_ if (startLR) { -%>
101
110
  opaTest("Navigate to ObjectPage", function (Given, When, Then) {
@@ -25,6 +25,9 @@ const usesFilterFieldIdentifier =
25
25
  import type { FilterFieldIdentifier } from "sap/fe/test/api/FilterBarAPI";
26
26
  <% } -%>
27
27
  import runner from "./pages/JourneyRunner";
28
+ <%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
29
+ import { SortOrder } from "sap/ui/core/library";
30
+ <%_ } -%>
28
31
 
29
32
  function journey() {
30
33
  QUnit.module("<%- name%>ListReport journey");
@@ -101,6 +104,14 @@ function journey() {
101
104
  <%_ } -%>
102
105
  });
103
106
  <%_ } -%>
107
+ <%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
108
+ opaTest("Check text annotation for columns", function (_Given: Given, When: When, Then: Then) {
109
+ <%_ textAnnotationColumns.forEach(function(column) { _%>
110
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending);
111
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending, true);
112
+ <%_ }); -%>
113
+ });
114
+ <%_ } -%>
104
115
 
105
116
  <%_ if (startLR) { -%>
106
117
  opaTest("Navigate to ObjectPage", function (_Given: Given, When: When, Then: Then) {
@@ -17,8 +17,9 @@
17
17
 
18
18
  sap.ui.define([
19
19
  "sap/ui/test/opaQunit",
20
- "./pages/JourneyRunner"
21
- ], function (opaTest, runner) {
20
+ "./pages/JourneyRunner"<% if (textAnnotationColumns && textAnnotationColumns.length > 0) { %>,
21
+ "sap/ui/core/library"<% } %>
22
+ ], function (opaTest, runner<% if (textAnnotationColumns && textAnnotationColumns.length > 0) { %>, coreLibrary<% } %>) {
22
23
  "use strict";
23
24
 
24
25
  function journey() {
@@ -96,6 +97,14 @@ sap.ui.define([
96
97
  <%_ } -%>
97
98
  });
98
99
  <%_ } -%>
100
+ <%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
101
+ opaTest("Check text annotation for columns", function (Given, When, Then) {
102
+ <%_ textAnnotationColumns.forEach(function(column) { _%>
103
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending);
104
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending, true);
105
+ <%_ }); -%>
106
+ });
107
+ <%_ } -%>
99
108
 
100
109
  <%_ if (startLR) { -%>
101
110
  opaTest("Navigate to ObjectPage", function (Given, When, Then) {
@@ -25,6 +25,9 @@ const usesFilterFieldIdentifier =
25
25
  import type { FilterFieldIdentifier } from "sap/fe/test/api/FilterBarAPI";
26
26
  <% } -%>
27
27
  import runner from "./pages/JourneyRunner";
28
+ <%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
29
+ import { SortOrder } from "sap/ui/core/library";
30
+ <%_ } -%>
28
31
 
29
32
  function journey() {
30
33
  QUnit.module("<%- name%>ListReport journey");
@@ -101,6 +104,14 @@ function journey() {
101
104
  <%_ } -%>
102
105
  });
103
106
  <%_ } -%>
107
+ <%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
108
+ opaTest("Check text annotation for columns", function (_Given: Given, When: When, Then: Then) {
109
+ <%_ textAnnotationColumns.forEach(function(column) { _%>
110
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending);
111
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending, true);
112
+ <%_ }); -%>
113
+ });
114
+ <%_ } -%>
104
115
 
105
116
  <%_ if (startLR) { -%>
106
117
  opaTest("Navigate to ObjectPage", function (_Given: Given, When: When, Then: Then) {
@@ -17,8 +17,9 @@
17
17
 
18
18
  sap.ui.define([
19
19
  "sap/ui/test/opaQunit",
20
- "./pages/JourneyRunner"
21
- ], function (opaTest, runner) {
20
+ "./pages/JourneyRunner"<% if (textAnnotationColumns && textAnnotationColumns.length > 0) { %>,
21
+ "sap/ui/core/library"<% } %>
22
+ ], function (opaTest, runner<% if (textAnnotationColumns && textAnnotationColumns.length > 0) { %>, coreLibrary<% } %>) {
22
23
  "use strict";
23
24
 
24
25
  function journey() {
@@ -104,6 +105,14 @@ sap.ui.define([
104
105
  <%_ } -%>
105
106
  });
106
107
  <%_ } -%>
108
+ <%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
109
+ opaTest("Check text annotation for columns", function (Given, When, Then) {
110
+ <%_ textAnnotationColumns.forEach(function(column) { _%>
111
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending);
112
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, coreLibrary.SortOrder.Ascending, true);
113
+ <%_ }); -%>
114
+ });
115
+ <%_ } -%>
107
116
 
108
117
  <%_ if (contactCardColumns.length > 0) { -%>
109
118
  opaTest("Check contact card links", function (Given, When, Then) {
@@ -25,6 +25,9 @@ const usesFilterFieldIdentifier =
25
25
  import type { FilterFieldIdentifier } from "sap/fe/test/api/FilterBarAPI";
26
26
  <% } -%>
27
27
  import runner from "./pages/JourneyRunner";
28
+ <%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
29
+ import { SortOrder } from "sap/ui/core/library";
30
+ <%_ } -%>
28
31
 
29
32
  function journey() {
30
33
  QUnit.module("<%- name%>ListReport journey");
@@ -109,6 +112,14 @@ function journey() {
109
112
  <%_ } -%>
110
113
  });
111
114
  <%_ } -%>
115
+ <%_ if (startLR && textAnnotationColumns && textAnnotationColumns.length > 0) { -%>
116
+ opaTest("Check text annotation for columns", function (_Given: Given, When: When, Then: Then) {
117
+ <%_ textAnnotationColumns.forEach(function(column) { _%>
118
+ When.onThe<%- startLR%>Generated.onTable(defaultTableId).iChangeSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending);
119
+ Then.onThe<%- startLR%>Generated.onTable(defaultTableId).iCheckSortOrder({ name: "<%- column.textProperty %>" }, SortOrder.Ascending, true);
120
+ <%_ }); -%>
121
+ });
122
+ <%_ } -%>
112
123
 
113
124
  <%_ if (contactCardColumns.length > 0) { -%>
114
125
  opaTest("Check contact card links", function (_Given: Given, When: When, Then: Then) {