@umbraco/playwright-testhelpers 17.0.18 → 17.1.0-beta

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.
Files changed (85) hide show
  1. package/README.md +139 -29
  2. package/dist/lib/helpers/BasePage.d.ts +447 -0
  3. package/dist/lib/helpers/BasePage.js +543 -0
  4. package/dist/lib/helpers/BasePage.js.map +1 -0
  5. package/dist/lib/helpers/ConstantHelper.d.ts +17 -0
  6. package/dist/lib/helpers/ConstantHelper.js +17 -0
  7. package/dist/lib/helpers/ConstantHelper.js.map +1 -1
  8. package/dist/lib/helpers/ContentRenderUiHelper.js +3 -3
  9. package/dist/lib/helpers/ContentRenderUiHelper.js.map +1 -1
  10. package/dist/lib/helpers/ContentUiHelper.js +312 -442
  11. package/dist/lib/helpers/ContentUiHelper.js.map +1 -1
  12. package/dist/lib/helpers/CurrentUserProfileUiHelper.js +4 -10
  13. package/dist/lib/helpers/CurrentUserProfileUiHelper.js.map +1 -1
  14. package/dist/lib/helpers/DataTypeUiHelper.js +189 -328
  15. package/dist/lib/helpers/DataTypeUiHelper.js.map +1 -1
  16. package/dist/lib/helpers/DictionaryUiHelper.js +16 -21
  17. package/dist/lib/helpers/DictionaryUiHelper.js.map +1 -1
  18. package/dist/lib/helpers/DocumentBlueprintUiHelper.js +7 -8
  19. package/dist/lib/helpers/DocumentBlueprintUiHelper.js.map +1 -1
  20. package/dist/lib/helpers/DocumentTypeUiHelper.js +18 -33
  21. package/dist/lib/helpers/DocumentTypeUiHelper.js.map +1 -1
  22. package/dist/lib/helpers/ExamineManagementUiHelper.js +4 -4
  23. package/dist/lib/helpers/ExamineManagementUiHelper.js.map +1 -1
  24. package/dist/lib/helpers/FormsUiHelper.js +119 -158
  25. package/dist/lib/helpers/FormsUiHelper.js.map +1 -1
  26. package/dist/lib/helpers/HealthCheckUiHelper.js +3 -3
  27. package/dist/lib/helpers/HealthCheckUiHelper.js.map +1 -1
  28. package/dist/lib/helpers/LanguageUiHelper.js +15 -17
  29. package/dist/lib/helpers/LanguageUiHelper.js.map +1 -1
  30. package/dist/lib/helpers/LogViewerUiHelper.js +20 -29
  31. package/dist/lib/helpers/LogViewerUiHelper.js.map +1 -1
  32. package/dist/lib/helpers/LoginUiHelper.js +5 -7
  33. package/dist/lib/helpers/LoginUiHelper.js.map +1 -1
  34. package/dist/lib/helpers/MediaTypeUiHelper.js +11 -17
  35. package/dist/lib/helpers/MediaTypeUiHelper.js.map +1 -1
  36. package/dist/lib/helpers/MediaUiHelper.js +34 -43
  37. package/dist/lib/helpers/MediaUiHelper.js.map +1 -1
  38. package/dist/lib/helpers/MemberGroupUiHelper.js +12 -15
  39. package/dist/lib/helpers/MemberGroupUiHelper.js.map +1 -1
  40. package/dist/lib/helpers/MemberTypeUiHelper.js +2 -3
  41. package/dist/lib/helpers/MemberTypeUiHelper.js.map +1 -1
  42. package/dist/lib/helpers/MemberUiHelper.js +24 -42
  43. package/dist/lib/helpers/MemberUiHelper.js.map +1 -1
  44. package/dist/lib/helpers/ModelsBuilderUiHelper.js +2 -3
  45. package/dist/lib/helpers/ModelsBuilderUiHelper.js.map +1 -1
  46. package/dist/lib/helpers/PackageUiHelper.js +29 -34
  47. package/dist/lib/helpers/PackageUiHelper.js.map +1 -1
  48. package/dist/lib/helpers/PartialViewUiHelper.js +13 -15
  49. package/dist/lib/helpers/PartialViewUiHelper.js.map +1 -1
  50. package/dist/lib/helpers/ProfilingUiHelper.js +2 -4
  51. package/dist/lib/helpers/ProfilingUiHelper.js.map +1 -1
  52. package/dist/lib/helpers/PublishedStatusUiHelper.js +6 -6
  53. package/dist/lib/helpers/PublishedStatusUiHelper.js.map +1 -1
  54. package/dist/lib/helpers/RedirectManagementUiHelper.js +7 -12
  55. package/dist/lib/helpers/RedirectManagementUiHelper.js.map +1 -1
  56. package/dist/lib/helpers/RelationTypeUiHelper.js +12 -14
  57. package/dist/lib/helpers/RelationTypeUiHelper.js.map +1 -1
  58. package/dist/lib/helpers/ScriptUiHelper.js +8 -11
  59. package/dist/lib/helpers/ScriptUiHelper.js.map +1 -1
  60. package/dist/lib/helpers/StylesheetUiHelper.js +8 -12
  61. package/dist/lib/helpers/StylesheetUiHelper.js.map +1 -1
  62. package/dist/lib/helpers/TelemetryDataUiHelper.js +2 -3
  63. package/dist/lib/helpers/TelemetryDataUiHelper.js.map +1 -1
  64. package/dist/lib/helpers/TemplateUiHelper.js +17 -22
  65. package/dist/lib/helpers/TemplateUiHelper.js.map +1 -1
  66. package/dist/lib/helpers/UiBaseLocators.d.ts +230 -228
  67. package/dist/lib/helpers/UiBaseLocators.js +832 -869
  68. package/dist/lib/helpers/UiBaseLocators.js.map +1 -1
  69. package/dist/lib/helpers/UserGroupUiHelper.js +27 -44
  70. package/dist/lib/helpers/UserGroupUiHelper.js.map +1 -1
  71. package/dist/lib/helpers/UserUiHelper.js +42 -45
  72. package/dist/lib/helpers/UserUiHelper.js.map +1 -1
  73. package/dist/lib/helpers/WebhookUiHelper.js +11 -27
  74. package/dist/lib/helpers/WebhookUiHelper.js.map +1 -1
  75. package/dist/lib/helpers/WelcomeDashboardUiHelper.js +1 -1
  76. package/dist/lib/helpers/WelcomeDashboardUiHelper.js.map +1 -1
  77. package/dist/lib/helpers/differentAppSettingsHelpers/ExternalLoginUiHelpers.js +4 -9
  78. package/dist/lib/helpers/differentAppSettingsHelpers/ExternalLoginUiHelpers.js.map +1 -1
  79. package/dist/lib/helpers/differentAppSettingsHelpers/InstallUiHelper.js +6 -11
  80. package/dist/lib/helpers/differentAppSettingsHelpers/InstallUiHelper.js.map +1 -1
  81. package/dist/lib/helpers/index.d.ts +1 -0
  82. package/dist/lib/helpers/index.js +3 -1
  83. package/dist/lib/helpers/index.js.map +1 -1
  84. package/dist/tsconfig.tsbuildinfo +1 -1
  85. package/package.json +1 -3
@@ -3,586 +3,563 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UiBaseLocators = void 0;
4
4
  const test_1 = require("@playwright/test");
5
5
  const ConstantHelper_1 = require("./ConstantHelper");
6
- class UiBaseLocators {
7
- page;
6
+ const BasePage_1 = require("./BasePage");
7
+ class UiBaseLocators extends BasePage_1.BasePage {
8
+ // Core Action Buttons
8
9
  saveBtn;
9
- chooseBtn;
10
10
  submitBtn;
11
- createFolderBtn;
12
- breadcrumbBtn;
13
- confirmToDeleteBtn;
11
+ confirmBtn;
12
+ chooseBtn;
13
+ chooseModalBtn;
14
+ createBtn;
15
+ addBtn;
16
+ updateBtn;
17
+ changeBtn;
18
+ deleteBtn;
14
19
  deleteExactBtn;
15
- confirmCreateFolderBtn;
20
+ removeExactBtn;
16
21
  insertBtn;
17
- modalCaretBtn;
18
- queryBuilderBtn;
19
- queryBuilderOrderedBy;
20
- queryBuilderCreateDate;
22
+ renameBtn;
23
+ reloadBtn;
24
+ reloadChildrenBtn;
25
+ restoreBtn;
26
+ disableBtn;
27
+ enableBtn;
28
+ actionBtn;
29
+ nextBtn;
30
+ // Confirmation Buttons
31
+ confirmToDeleteBtn;
32
+ confirmCreateFolderBtn;
33
+ confirmToRemoveBtn;
34
+ confirmToSubmitBtn;
35
+ confirmDisableBtn;
36
+ confirmEnableBtn;
37
+ confirmRenameBtn;
38
+ confirmTrashBtn;
39
+ // Folder Management
40
+ createFolderBtn;
21
41
  folderNameTxt;
22
- textAreaInputArea;
23
- wherePropertyAliasBtn;
24
- whereOperatorBtn;
25
- whereConstrainValueTxt;
26
- orderByPropertyAliasBtn;
27
- ascendingBtn;
28
- queryBuilderShowCode;
29
- createThreeDotsBtn;
42
+ folderBtn;
30
43
  newFolderThreeDotsBtn;
31
- renameThreeDotsBtn;
32
- newNameTxt;
33
- renameModalBtn;
34
- createBtn;
35
- successState;
36
- chooseModalBtn;
37
- addBtn;
38
44
  renameFolderThreeDotsBtn;
39
45
  renameFolderBtn;
40
46
  updateFolderBtn;
41
- filterChooseBtn;
42
- updateBtn;
43
- changeBtn;
47
+ deleteFolderThreeDotsBtn;
48
+ // Navigation & Menu
49
+ breadcrumbBtn;
50
+ leftArrowBtn;
51
+ caretBtn;
52
+ modalCaretBtn;
53
+ backOfficeHeader;
54
+ backOfficeMain;
55
+ sectionLinks;
56
+ sectionSidebar;
57
+ menuItem;
58
+ actionsMenuContainer;
59
+ treeItem;
60
+ // Three Dots Menu Buttons
61
+ createThreeDotsBtn;
62
+ renameThreeDotsBtn;
63
+ deleteThreeDotsBtn;
64
+ // Modal & Container
65
+ sidebarModal;
66
+ openedModal;
67
+ container;
68
+ containerChooseBtn;
69
+ containerSaveAndPublishBtn;
70
+ createModalBtn;
71
+ // Document Type & Property Editor
72
+ documentTypeNode;
44
73
  propertyNameTxt;
45
74
  selectPropertyEditorBtn;
75
+ editorSettingsBtn;
76
+ enterPropertyEditorDescriptionTxt;
77
+ property;
78
+ addPropertyBtn;
79
+ labelAboveBtn;
80
+ // Group & Tab Management
46
81
  addGroupBtn;
47
- iAmDoneReorderingBtn;
48
- reorderBtn;
49
- compositionsBtn;
82
+ groupLabel;
83
+ typeGroups;
50
84
  addTabBtn;
51
- descriptionBtn;
52
- enterDescriptionTxt;
85
+ unnamedTabTxt;
86
+ structureTabBtn;
87
+ // Validation & Mandatory
53
88
  mandatoryToggle;
54
89
  validation;
55
90
  regexTxt;
56
91
  regexMessageTxt;
57
- structureTabBtn;
92
+ validationMessage;
93
+ // Composition & Structure
94
+ compositionsBtn;
58
95
  allowAtRootBtn;
59
- addPropertyBtn;
60
- typeToFilterSearchTxt;
61
- editorSettingsBtn;
62
- labelAboveBtn;
63
- unnamedTabTxt;
64
- deleteThreeDotsBtn;
65
- removeExactBtn;
66
- confirmBtn;
67
- disableBtn;
68
- confirmDisableBtn;
69
- enableBtn;
70
- confirmEnableBtn;
71
- iconBtn;
72
- aliasLockBtn;
73
- aliasNameTxt;
74
- deleteFolderThreeDotsBtn;
75
- createLink;
96
+ allowedChildNodesModal;
97
+ addCollectionBtn;
98
+ // Reorder
99
+ iAmDoneReorderingBtn;
100
+ reorderBtn;
101
+ // Query Builder
102
+ queryBuilderBtn;
103
+ queryBuilderOrderedBy;
104
+ queryBuilderCreateDate;
105
+ queryBuilderShowCode;
106
+ wherePropertyAliasBtn;
107
+ whereOperatorBtn;
108
+ whereConstrainValueTxt;
109
+ orderByPropertyAliasBtn;
110
+ ascendingBtn;
111
+ chooseRootContentBtn;
112
+ returnedItemsCount;
113
+ queryResults;
114
+ // Insert & Template
76
115
  insertValueBtn;
77
116
  insertPartialViewBtn;
78
117
  insertDictionaryItemBtn;
79
118
  chooseFieldDropDown;
80
119
  systemFieldsOption;
81
120
  chooseFieldValueDropDown;
82
- renameBtn;
83
- returnedItemsCount;
84
- chooseRootContentBtn;
85
- queryResults;
86
- reloadBtn;
87
- confirmToRemoveBtn;
88
- confirmToSubmitBtn;
89
- typeGroups;
90
- allowedChildNodesModal;
91
- addCollectionBtn;
92
- errorNotification;
93
- confirmRenameBtn;
94
- successNotification;
95
- leftArrowBtn;
96
- clickToUploadBtn;
97
- backOfficeHeader;
121
+ breadcrumbsTemplateModal;
122
+ // Rename
123
+ newNameTxt;
124
+ renameModalBtn;
125
+ // State & Notification
126
+ successState;
127
+ successStateIcon;
98
128
  failedStateButton;
99
- sidebarModal;
129
+ successNotification;
130
+ errorNotification;
131
+ // Search & Filter
132
+ typeToFilterSearchTxt;
133
+ filterChooseBtn;
134
+ // Text Input
135
+ textAreaInputArea;
100
136
  enterAName;
101
- mediaCardItems;
102
- enterPropertyEditorDescriptionTxt;
103
- breadcrumbsTemplateModal;
104
- containerChooseBtn;
105
- documentTypeNode;
106
- groupLabel;
107
- containerSaveAndPublishBtn;
108
- confirmTrashBtn;
137
+ descriptionBtn;
138
+ enterDescriptionTxt;
139
+ aliasLockBtn;
140
+ aliasNameTxt;
141
+ // Icon
142
+ iconBtn;
143
+ // Create Link
144
+ createLink;
145
+ // Recycle Bin
109
146
  recycleBinBtn;
110
- recycleBinMenuItemCaretBtn;
111
147
  recycleBinMenuItem;
148
+ recycleBinMenuItemCaretBtn;
149
+ // View Options
112
150
  gridBtn;
113
151
  listBtn;
114
152
  viewBundleBtn;
115
- chooseDocumentInputBtn;
116
- chooseMediaInputBtn;
117
- container;
118
- createDocumentBlueprintBtn;
119
- actionBtn;
153
+ // Media
154
+ mediaCardItems;
120
155
  mediaPickerModalSubmitBtn;
121
- deleteBtn;
122
- createModalBtn;
123
156
  mediaCaptionAltTextModalSubmitBtn;
157
+ clickToUploadBtn;
158
+ inputDropzone;
159
+ imageCropperField;
160
+ inputUploadField;
161
+ chooseMediaInputBtn;
162
+ // Embedded Media
124
163
  embeddedMediaModal;
125
164
  embeddedURLTxt;
126
165
  embeddedRetrieveBtn;
127
166
  embeddedMediaModalConfirmBtn;
128
167
  embeddedPreview;
129
- sectionSidebar;
130
- actionsMenuContainer;
131
- menuItem;
132
- property;
168
+ // Document & Content
169
+ chooseDocumentInputBtn;
170
+ createDocumentBlueprintBtn;
171
+ createDocumentBlueprintModal;
172
+ createNewDocumentBlueprintBtn;
173
+ // User
133
174
  currentUserAvatarBtn;
134
175
  newPasswordTxt;
135
176
  confirmPasswordTxt;
136
177
  currentPasswordTxt;
137
- createOptionActionListModal;
178
+ // Collection & Table
179
+ collectionTreeItemTableRow;
138
180
  createActionButtonCollection;
139
181
  createActionBtn;
140
- collectionTreeItemTableRow;
141
- folderBtn;
142
- reloadChildrenBtn;
182
+ createOptionActionListModal;
183
+ // Reference & Entity
143
184
  confirmActionModalEntityReferences;
144
185
  referenceHeadline;
145
186
  entityItemRef;
146
- validationMessage;
147
- successStateIcon;
187
+ entityItem;
188
+ // Workspace & Action
148
189
  workspaceAction;
190
+ workspaceActionMenuBtn;
149
191
  entityAction;
150
192
  openEntityAction;
151
- caretBtn;
152
- workspaceActionMenuBtn;
153
- monacoEditor;
154
- createNewDocumentBlueprintBtn;
155
- openedModal;
156
- uiLoader;
157
- createDocumentBlueprintModal;
158
- inputDropzone;
159
- imageCropperField;
160
- inputUploadField;
161
- entityItem;
162
- sectionLinks;
163
- restoreBtn;
164
- backOfficeMain;
193
+ // Pagination
165
194
  firstPaginationBtn;
166
195
  nextPaginationBtn;
167
- nextBtn;
196
+ // Editor
197
+ monacoEditor;
198
+ // Loader
199
+ uiLoader;
168
200
  constructor(page) {
169
- this.page = page;
201
+ super(page);
202
+ // Core Action Buttons
170
203
  this.saveBtn = page.getByLabel('Save', { exact: true });
171
204
  this.submitBtn = page.getByLabel('Submit');
205
+ this.confirmBtn = page.getByLabel('Confirm');
206
+ this.chooseBtn = page.getByLabel('Choose', { exact: true });
207
+ this.chooseModalBtn = page.locator('uui-modal-sidebar').locator('[look="primary"]').getByLabel('Choose');
208
+ this.createBtn = page.getByRole('button', { name: /^Create(…)?$/ });
209
+ this.addBtn = page.getByRole('button', { name: 'Add', exact: true });
210
+ this.updateBtn = page.getByLabel('Update');
211
+ this.changeBtn = page.getByLabel('Change');
212
+ this.deleteBtn = page.getByRole('button', { name: /^Delete(…)?$/ });
172
213
  this.deleteExactBtn = page.getByRole('button', { name: 'Delete', exact: true });
214
+ this.removeExactBtn = page.getByLabel('Remove', { exact: true });
215
+ this.insertBtn = page.locator('uui-box uui-button').filter({ hasText: 'Insert' });
216
+ this.renameBtn = page.getByRole('button', { name: /^Rename(…)?$/ });
217
+ this.reloadBtn = page.getByRole('button', { name: 'Reload', exact: true });
218
+ this.reloadChildrenBtn = page.getByRole('button', { name: 'Reload children' });
219
+ this.restoreBtn = page.getByLabel('Restore', { exact: true });
220
+ this.disableBtn = page.getByLabel('Disable', { exact: true });
221
+ this.enableBtn = page.getByLabel('Enable');
222
+ this.actionBtn = page.getByTestId('workspace:action-menu-button');
223
+ this.nextBtn = page.getByLabel('Next');
224
+ // Confirmation Buttons
173
225
  this.confirmToDeleteBtn = page.locator('#confirm').getByLabel('Delete');
174
226
  this.confirmCreateFolderBtn = page.locator('#confirm').getByLabel('Create Folder');
175
- this.breadcrumbBtn = page.getByLabel('Breadcrumb');
227
+ this.confirmToRemoveBtn = page.locator('#confirm').getByLabel('Remove');
228
+ this.confirmToSubmitBtn = page.locator('#confirm').getByLabel('Submit');
229
+ this.confirmDisableBtn = page.locator('#confirm').getByLabel('Disable');
230
+ this.confirmEnableBtn = page.locator('#confirm').getByLabel('Enable');
231
+ this.confirmRenameBtn = page.locator('#confirm').getByLabel('Rename');
232
+ this.confirmTrashBtn = page.locator('#confirm').getByLabel('Trash');
233
+ // Folder Management
176
234
  this.createFolderBtn = page.getByLabel('Create folder');
177
- this.insertBtn = page.locator('uui-box uui-button').filter({ hasText: 'Insert' });
178
- this.sidebarModal = page.locator('uui-modal-sidebar');
179
- this.modalCaretBtn = this.sidebarModal.locator('#caret-button');
180
- this.enterAName = page.getByLabel('Enter a name...', { exact: true });
181
- this.queryBuilderBtn = page.locator('#query-builder-button');
182
- this.queryBuilderOrderedBy = page.locator('#property-alias-dropdown').getByLabel('Property alias');
183
- this.queryBuilderCreateDate = page.locator('#property-alias-dropdown').getByText('CreateDate').locator("..");
184
235
  this.folderNameTxt = page.getByLabel('Enter a folder name');
185
- this.textAreaInputArea = page.locator('textarea.ime-text-area');
186
- this.wherePropertyAliasBtn = page.locator('#property-alias-dropdown');
187
- this.whereOperatorBtn = page.locator('#operator-dropdown');
188
- this.whereConstrainValueTxt = page.getByLabel('constrain value');
189
- this.orderByPropertyAliasBtn = page.locator('#sort-dropdown');
190
- this.ascendingBtn = page.locator('[key="template_ascending"]');
191
- this.queryBuilderShowCode = page.locator('umb-code-block');
192
- this.createThreeDotsBtn = page.getByText('Create…', { exact: true });
193
- this.chooseBtn = page.getByLabel('Choose', { exact: true });
194
- this.containerChooseBtn = page.locator('#container').getByLabel('Choose');
195
- this.containerSaveAndPublishBtn = page.locator('#container').getByLabel('Save and Publish');
236
+ this.folderBtn = page.locator('umb-entity-create-option-action-list-modal').locator('umb-ref-item', { hasText: 'Folder' });
196
237
  this.newFolderThreeDotsBtn = page.getByLabel('New Folder…');
197
- this.renameThreeDotsBtn = page.getByLabel('Rename…', { exact: true });
198
- this.newNameTxt = page.getByRole('textbox', { name: 'Enter new name...' });
199
- this.renameModalBtn = page.locator('umb-rename-modal').getByLabel('Rename');
200
- this.createBtn = page.getByRole('button', { name: /^Create(…)?$/ });
201
- this.actionsMenuContainer = page.locator('uui-scroll-container');
202
- this.successState = page.locator('[state="success"]');
203
- this.chooseModalBtn = this.sidebarModal.locator('[look="primary"]').getByLabel('Choose');
204
- this.addBtn = page.getByRole('button', { name: 'Add', exact: true });
205
238
  this.renameFolderThreeDotsBtn = page.getByRole('button', { name: 'Rename folder…' });
206
239
  this.renameFolderBtn = page.getByLabel('Rename folder');
207
- this.confirmRenameBtn = page.locator('#confirm').getByLabel('Rename');
208
240
  this.updateFolderBtn = page.getByLabel('Update folder');
209
- this.filterChooseBtn = page.locator('button').filter({ hasText: 'Choose' });
210
- this.updateBtn = page.getByLabel('Update');
211
- this.changeBtn = page.getByLabel('Change');
241
+ this.deleteFolderThreeDotsBtn = page.locator('#action-modal').getByLabel('Delete Folder...');
242
+ // Navigation & Menu
243
+ this.breadcrumbBtn = page.getByLabel('Breadcrumb');
244
+ this.leftArrowBtn = page.locator('[name="icon-arrow-left"] svg');
245
+ this.caretBtn = page.locator('#caret-button');
246
+ this.modalCaretBtn = page.locator('uui-modal-sidebar').locator('#caret-button');
247
+ this.backOfficeHeader = page.locator('umb-backoffice-header');
248
+ this.backOfficeMain = page.locator('umb-backoffice-main');
249
+ this.sectionLinks = page.getByTestId('section-links');
250
+ this.sectionSidebar = page.locator('umb-section-sidebar');
251
+ this.menuItem = page.locator('uui-menu-item');
252
+ this.actionsMenuContainer = page.locator('uui-scroll-container');
253
+ this.treeItem = page.locator('umb-tree-item');
254
+ // Three Dots Menu Buttons
255
+ this.createThreeDotsBtn = page.getByText('Create…', { exact: true });
256
+ this.renameThreeDotsBtn = page.getByLabel('Rename…', { exact: true });
257
+ this.deleteThreeDotsBtn = page.getByLabel('Delete…');
258
+ // Modal & Container
259
+ this.sidebarModal = page.locator('uui-modal-sidebar');
260
+ this.openedModal = page.locator('uui-modal-container[backdrop]');
261
+ this.container = page.locator('#container');
262
+ this.containerChooseBtn = page.locator('#container').getByLabel('Choose');
263
+ this.containerSaveAndPublishBtn = page.locator('#container').getByLabel('Save and Publish');
264
+ this.createModalBtn = page.locator('uui-modal-sidebar').getByLabel('Create', { exact: true });
265
+ // Document Type & Property Editor
266
+ this.documentTypeNode = page.locator('uui-ref-node-document-type');
212
267
  this.propertyNameTxt = page.getByTestId('input:entity-name').locator('#input').first();
213
268
  this.selectPropertyEditorBtn = page.getByLabel('Select Property Editor');
269
+ this.editorSettingsBtn = page.getByLabel('Editor settings');
270
+ this.enterPropertyEditorDescriptionTxt = page.locator('uui-modal-sidebar').getByTestId('input:entity-description').locator('#textarea');
271
+ this.property = page.locator('umb-property');
272
+ this.addPropertyBtn = page.getByLabel('Add property', { exact: true });
273
+ this.labelAboveBtn = page.locator('.appearance-option').filter({ hasText: 'Label above' });
274
+ // Group & Tab Management
214
275
  this.addGroupBtn = page.getByLabel('Add group', { exact: true });
215
- this.iAmDoneReorderingBtn = page.getByLabel('I am done reordering');
216
- this.reorderBtn = page.getByLabel('Reorder');
217
- this.compositionsBtn = page.getByLabel('Compositions');
276
+ this.groupLabel = page.getByLabel('Group', { exact: true });
277
+ this.typeGroups = page.locator('umb-content-type-design-editor-group');
218
278
  this.addTabBtn = page.getByLabel('Add tab');
219
- this.descriptionBtn = page.getByLabel('Description');
220
- this.enterDescriptionTxt = page.getByLabel('Enter a description...');
279
+ this.unnamedTabTxt = page.getByTestId('tab:').getByTestId('tab:name-input').locator('#input');
280
+ this.structureTabBtn = page.locator('uui-tab').filter({ hasText: 'Structure' }).locator('svg');
281
+ // Validation & Mandatory
221
282
  this.mandatoryToggle = page.locator('#mandatory #toggle');
222
283
  this.validation = page.locator('#native');
223
284
  this.regexTxt = page.locator('input[name="pattern"]');
224
285
  this.regexMessageTxt = page.locator('textarea[name="pattern-message"]');
225
- this.structureTabBtn = page.locator('uui-tab').filter({ hasText: 'Structure' }).locator('svg');
286
+ this.validationMessage = page.locator('umb-form-validation-message').locator('#messages');
287
+ // Composition & Structure
288
+ this.compositionsBtn = page.getByLabel('Compositions');
226
289
  this.allowAtRootBtn = page.locator('label').filter({ hasText: 'Allow at root' });
227
- this.addPropertyBtn = page.getByLabel('Add property', { exact: true });
228
- this.typeToFilterSearchTxt = page.locator('[type="search"] #input');
229
- this.editorSettingsBtn = page.getByLabel('Editor settings');
230
- this.labelAboveBtn = page.locator('.appearance-option').filter({ hasText: 'Label above' });
231
- this.firstPaginationBtn = this.page.locator('umb-collection-pagination').getByLabel('First');
232
- this.nextPaginationBtn = this.page.locator('umb-collection-pagination').getByLabel('Next');
233
- this.nextBtn = this.page.getByLabel('Next');
234
- // tab: means that the tab is unnamed
235
- this.unnamedTabTxt = page.getByTestId('tab:').getByTestId('tab:name-input').locator('#input');
236
- this.deleteThreeDotsBtn = page.getByLabel('Delete…');
237
- this.removeExactBtn = page.getByLabel('Remove', { exact: true });
238
- this.confirmBtn = page.getByLabel('Confirm');
239
- this.disableBtn = page.getByLabel('Disable', { exact: true });
240
- this.confirmDisableBtn = page.locator('#confirm').getByLabel('Disable');
241
- this.confirmToSubmitBtn = page.locator('#confirm').getByLabel('Submit');
242
- this.enableBtn = page.getByLabel('Enable');
243
- this.confirmEnableBtn = page.locator('#confirm').getByLabel('Enable');
244
- this.iconBtn = page.getByLabel('icon');
245
- this.aliasLockBtn = page.locator('#name').getByLabel('Unlock input');
246
- this.aliasNameTxt = page.locator('#name').getByLabel('alias');
247
- this.deleteFolderThreeDotsBtn = page.locator('#action-modal').getByLabel('Delete Folder...');
248
- this.createLink = page.getByRole('link', { name: 'Create', exact: true });
290
+ this.allowedChildNodesModal = page.locator('umb-tree-picker-modal');
291
+ this.addCollectionBtn = page.locator('umb-input-content-type-collection-configuration #create-button');
292
+ // Reorder
293
+ this.iAmDoneReorderingBtn = page.getByLabel('I am done reordering');
294
+ this.reorderBtn = page.getByLabel('Reorder');
295
+ // Query Builder
296
+ this.queryBuilderBtn = page.locator('#query-builder-button');
297
+ this.queryBuilderOrderedBy = page.locator('#property-alias-dropdown').getByLabel('Property alias');
298
+ this.queryBuilderCreateDate = page.locator('#property-alias-dropdown').getByText('CreateDate').locator("..");
299
+ this.queryBuilderShowCode = page.locator('umb-code-block');
300
+ this.wherePropertyAliasBtn = page.locator('#property-alias-dropdown');
301
+ this.whereOperatorBtn = page.locator('#operator-dropdown');
302
+ this.whereConstrainValueTxt = page.getByLabel('constrain value');
303
+ this.orderByPropertyAliasBtn = page.locator('#sort-dropdown');
304
+ this.ascendingBtn = page.locator('[key="template_ascending"]');
305
+ this.chooseRootContentBtn = page.getByLabel('Choose root document');
306
+ this.returnedItemsCount = page.locator('#results-count');
307
+ this.queryResults = page.locator('.query-results');
308
+ // Insert & Template
249
309
  this.insertValueBtn = page.locator('uui-button').filter({ has: page.locator('[key="template_insertPageField"]') });
250
310
  this.insertPartialViewBtn = page.locator('uui-button').filter({ has: page.locator('[key="template_insertPartialView"]') });
251
311
  this.insertDictionaryItemBtn = page.locator('uui-button').filter({ has: page.locator('[key="template_insertDictionaryItem"]') });
252
312
  this.chooseFieldDropDown = page.locator('#preview #expand-symbol-wrapper');
253
313
  this.systemFieldsOption = page.getByText('System fields');
254
314
  this.chooseFieldValueDropDown = page.locator('#value #expand-symbol-wrapper');
255
- this.renameBtn = page.getByRole('button', { name: /^Rename(…)?$/ });
256
- this.returnedItemsCount = page.locator('#results-count');
257
- this.chooseRootContentBtn = page.getByLabel('Choose root document');
258
- this.queryResults = page.locator('.query-results');
259
- this.reloadBtn = page.getByRole('button', { name: 'Reload', exact: true });
260
- this.confirmToRemoveBtn = page.locator('#confirm').getByLabel('Remove');
261
- this.typeGroups = page.locator('umb-content-type-design-editor-group');
262
- this.allowedChildNodesModal = page.locator('umb-tree-picker-modal');
263
- this.addCollectionBtn = page.locator('umb-input-content-type-collection-configuration #create-button');
264
- this.errorNotification = page.locator('uui-toast-notification[open][color="danger"]');
265
- this.successNotification = page.locator('uui-toast-notification[open][color="positive"]');
266
- this.leftArrowBtn = page.locator('[name="icon-arrow-left"] svg');
267
- this.clickToUploadBtn = page.locator('#splitViews').getByRole('button', { name: 'Click to upload' });
268
- this.backOfficeHeader = page.locator('umb-backoffice-header');
315
+ this.breadcrumbsTemplateModal = page.locator('uui-modal-sidebar').locator('umb-template-workspace-editor uui-breadcrumbs');
316
+ // Rename
317
+ this.newNameTxt = page.getByRole('textbox', { name: 'Enter new name...' });
318
+ this.renameModalBtn = page.locator('umb-rename-modal').getByLabel('Rename');
319
+ // State & Notification
320
+ this.successState = page.locator('[state="success"]');
321
+ this.successStateIcon = page.locator('[state="success"]').locator('#state');
269
322
  this.failedStateButton = page.locator('uui-button[state="failed"]');
270
- this.mediaCardItems = page.locator('uui-card-media');
271
- this.enterPropertyEditorDescriptionTxt = this.sidebarModal.getByTestId('input:entity-description').locator('#textarea');
272
- this.breadcrumbsTemplateModal = this.sidebarModal.locator('umb-template-workspace-editor uui-breadcrumbs');
273
- this.documentTypeNode = page.locator('uui-ref-node-document-type');
274
- this.groupLabel = page.getByLabel('Group', { exact: true });
275
- this.confirmTrashBtn = page.locator('#confirm').getByLabel('Trash');
323
+ this.successNotification = page.locator('uui-toast-notification[open][color="positive"]');
324
+ this.errorNotification = page.locator('uui-toast-notification[open][color="danger"]');
325
+ // Search & Filter
326
+ this.typeToFilterSearchTxt = page.locator('[type="search"] #input');
327
+ this.filterChooseBtn = page.locator('button').filter({ hasText: 'Choose' });
328
+ // Text Input
329
+ this.textAreaInputArea = page.locator('textarea.ime-text-area');
330
+ this.enterAName = page.getByLabel('Enter a name...', { exact: true });
331
+ this.descriptionBtn = page.getByLabel('Description');
332
+ this.enterDescriptionTxt = page.getByLabel('Enter a description...');
333
+ this.aliasLockBtn = page.locator('#name').getByLabel('Unlock input');
334
+ this.aliasNameTxt = page.locator('#name').getByLabel('alias');
335
+ // Icon
336
+ this.iconBtn = page.getByLabel('icon');
337
+ // Create Link
338
+ this.createLink = page.getByRole('link', { name: 'Create', exact: true });
339
+ // Recycle Bin
276
340
  this.recycleBinBtn = page.getByLabel('Recycle Bin', { exact: true });
277
341
  this.recycleBinMenuItem = page.locator('uui-menu-item[label="Recycle Bin"]');
278
- this.recycleBinMenuItemCaretBtn = this.recycleBinMenuItem.locator('#caret-button');
342
+ this.recycleBinMenuItemCaretBtn = page.locator('uui-menu-item[label="Recycle Bin"]').locator('#caret-button');
343
+ // View Options
279
344
  this.gridBtn = page.getByLabel('Grid');
280
345
  this.listBtn = page.getByLabel('List');
281
346
  this.viewBundleBtn = page.locator('umb-collection-view-bundle uui-button svg');
282
- this.createDocumentBlueprintModal = page.locator('umb-document-blueprint-options-create-modal');
283
- this.createDocumentBlueprintBtn = page.getByLabel(/^Create Document Blueprint(…)?$/);
284
- this.createNewDocumentBlueprintBtn = this.createDocumentBlueprintModal.locator('umb-ref-item', { hasText: 'Document Blueprint for' });
285
- this.chooseDocumentInputBtn = page.locator('umb-input-document').getByLabel('Choose');
286
- this.chooseMediaInputBtn = page.locator('umb-input-media').getByLabel('Choose');
287
- this.container = page.locator('#container');
288
- this.actionBtn = page.getByTestId('workspace:action-menu-button');
347
+ // Media
348
+ this.mediaCardItems = page.locator('uui-card-media');
289
349
  this.mediaPickerModalSubmitBtn = page.locator('umb-media-picker-modal').getByLabel('Submit');
290
- this.deleteBtn = page.getByRole('button', { name: /^Delete(…)?$/ });
291
- this.createModalBtn = this.sidebarModal.getByLabel('Create', { exact: true });
292
350
  this.mediaCaptionAltTextModalSubmitBtn = page.locator('umb-media-caption-alt-text-modal').getByLabel('Submit');
351
+ this.clickToUploadBtn = page.locator('#splitViews').getByRole('button', { name: 'Click to upload' });
352
+ this.inputDropzone = page.locator('umb-input-dropzone');
353
+ this.imageCropperField = page.locator('umb-image-cropper-field');
354
+ this.inputUploadField = page.locator('umb-input-upload-field').locator('#wrapperInner');
355
+ this.chooseMediaInputBtn = page.locator('umb-input-media').getByLabel('Choose');
356
+ // Embedded Media
293
357
  this.embeddedMediaModal = page.locator('umb-embedded-media-modal');
294
- this.embeddedURLTxt = this.embeddedMediaModal.locator('[label="URL"] #input');
295
- this.embeddedRetrieveBtn = this.embeddedMediaModal.locator('[label="Retrieve"]');
296
- this.embeddedMediaModalConfirmBtn = this.embeddedMediaModal.getByLabel('Confirm');
297
- this.embeddedPreview = this.embeddedMediaModal.locator('[label="Preview"]');
298
- this.sectionSidebar = page.locator('umb-section-sidebar');
299
- this.menuItem = page.locator('uui-menu-item');
300
- this.property = page.locator('umb-property');
358
+ this.embeddedURLTxt = page.locator('umb-embedded-media-modal').locator('[label="URL"] #input');
359
+ this.embeddedRetrieveBtn = page.locator('umb-embedded-media-modal').locator('[label="Retrieve"]');
360
+ this.embeddedMediaModalConfirmBtn = page.locator('umb-embedded-media-modal').getByLabel('Confirm');
361
+ this.embeddedPreview = page.locator('umb-embedded-media-modal').locator('[label="Preview"]');
362
+ // Document & Content
363
+ this.chooseDocumentInputBtn = page.locator('umb-input-document').getByLabel('Choose');
364
+ this.createDocumentBlueprintBtn = page.getByLabel(/^Create Document Blueprint(…)?$/);
365
+ this.createDocumentBlueprintModal = page.locator('umb-document-blueprint-options-create-modal');
366
+ this.createNewDocumentBlueprintBtn = page.locator('umb-document-blueprint-options-create-modal').locator('umb-ref-item', { hasText: 'Document Blueprint for' });
367
+ // User
301
368
  this.currentUserAvatarBtn = page.getByTestId('header-app:Umb.HeaderApp.CurrentUser').locator('uui-avatar');
302
369
  this.currentPasswordTxt = page.locator('input[name="oldPassword"]');
303
370
  this.newPasswordTxt = page.locator('input[name="newPassword"]');
304
371
  this.confirmPasswordTxt = page.locator('input[name="confirmPassword"]');
305
- this.createOptionActionListModal = page.locator('umb-entity-create-option-action-list-modal');
306
- this.createActionButtonCollection = page.locator('umb-collection-create-action-button');
307
- this.createActionBtn = this.createActionButtonCollection.locator('[label="Create"]');
372
+ // Collection & Table
308
373
  this.collectionTreeItemTableRow = page.locator('umb-collection-workspace-view umb-table uui-table-row');
309
- this.folderBtn = this.createOptionActionListModal.locator('umb-ref-item', { hasText: 'Folder' });
310
- this.reloadChildrenBtn = page.getByRole('button', { name: 'Reload children' });
374
+ this.createActionButtonCollection = page.locator('umb-collection-create-action-button');
375
+ this.createActionBtn = page.locator('umb-collection-create-action-button').locator('[label="Create"]');
376
+ this.createOptionActionListModal = page.locator('umb-entity-create-option-action-list-modal');
377
+ // Reference & Entity
311
378
  this.confirmActionModalEntityReferences = page.locator('umb-confirm-action-modal-entity-references,umb-confirm-bulk-action-modal-entity-references');
312
- this.referenceHeadline = this.confirmActionModalEntityReferences.locator('#reference-headline').first();
313
- this.entityItemRef = this.confirmActionModalEntityReferences.locator('uui-ref-list').first().getByTestId('entity-item-ref');
314
- this.validationMessage = page.locator('umb-form-validation-message').locator('#messages');
315
- this.successStateIcon = this.successState.locator('#state');
379
+ this.referenceHeadline = page.locator('umb-confirm-action-modal-entity-references,umb-confirm-bulk-action-modal-entity-references').locator('#reference-headline').first();
380
+ this.entityItemRef = page.locator('umb-confirm-action-modal-entity-references,umb-confirm-bulk-action-modal-entity-references').locator('uui-ref-list').first().getByTestId('entity-item-ref');
381
+ this.entityItem = page.locator('umb-entity-item-ref');
382
+ // Workspace & Action
316
383
  this.workspaceAction = page.locator('umb-workspace-action');
317
- this.caretBtn = page.locator('#caret-button');
318
- this.sectionLinks = page.getByTestId('section-links');
319
- // Entity Action
320
- this.entityAction = page.locator('umb-entity-action-list umb-entity-action');
321
- this.openEntityAction = page.locator('#action-modal[open]').locator(this.entityAction);
322
- // Workspace Entity Action
323
384
  this.workspaceActionMenuBtn = page.getByTestId('workspace:action-menu-button');
385
+ this.entityAction = page.locator('umb-entity-action-list umb-entity-action');
386
+ this.openEntityAction = page.locator('#action-modal[open]').locator(page.locator('umb-entity-action-list umb-entity-action'));
387
+ // Pagination
388
+ this.firstPaginationBtn = page.locator('umb-collection-pagination').getByLabel('First');
389
+ this.nextPaginationBtn = page.locator('umb-collection-pagination').getByLabel('Next');
390
+ // Editor
324
391
  this.monacoEditor = page.locator('.monaco-editor');
325
- this.openedModal = page.locator('uui-modal-container[backdrop]');
392
+ // Loader
326
393
  this.uiLoader = page.locator('uui-loader');
327
- this.inputDropzone = page.locator('umb-input-dropzone');
328
- this.imageCropperField = page.locator('umb-image-cropper-field');
329
- this.inputUploadField = page.locator('umb-input-upload-field').locator('#wrapperInner');
330
- this.entityItem = page.locator('umb-entity-item-ref');
331
- this.restoreBtn = page.getByLabel('Restore', { exact: true });
332
- this.backOfficeMain = page.locator('umb-backoffice-main');
333
394
  }
395
+ // Helper Methods
396
+ getMenuItemByLabel(name) {
397
+ return this.page.locator(`uui-menu-item[label="${name}"]`);
398
+ }
399
+ // Actions Menu Methods
334
400
  async clickActionsMenuForNameInSectionSidebar(name) {
335
401
  await this.sectionSidebar.locator('[label="' + name + '"]').hover();
336
- await this.sectionSidebar.locator('[label="' + name + '"] >> [label="Open actions menu"]').first().click();
402
+ await this.click(this.sectionSidebar.locator('[label="' + name + '"] >> [label="Open actions menu"]').first());
337
403
  }
338
404
  async clickActionsMenuForName(name) {
339
- await (0, test_1.expect)(this.page.locator('uui-menu-item[label="' + name + '"]').locator('#menu-item').first()).toBeVisible();
340
- // We need to wait for the load to be finished, otherwise we would run into flaky tests
341
- await this.page.waitForTimeout(1000);
342
- await this.page.locator('uui-menu-item[label="' + name + '"]').locator('#menu-item').first().hover({ force: true });
343
- await this.page.locator('uui-menu-item[label="' + name + '"] #action-modal').first().click({ force: true });
405
+ const menuItem = this.getMenuItemByLabel(name);
406
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.medium);
407
+ await menuItem.locator('#menu-item').first().hover({ force: true });
408
+ await this.click(menuItem.locator('#action-modal').first(), { force: true });
344
409
  }
345
410
  async isActionsMenuForNameVisible(name, isVisible = true) {
346
- await this.page.locator('uui-menu-item[label="' + name + '"]').click();
347
- await (0, test_1.expect)(this.page.locator('uui-menu-item[label="' + name + '"] #action-modal').first()).toBeVisible({ visible: isVisible });
411
+ const menuItem = this.getMenuItemByLabel(name);
412
+ await this.click(menuItem);
413
+ await (0, test_1.expect)(menuItem.locator('#action-modal').first()).toBeVisible({ visible: isVisible });
348
414
  }
415
+ // Caret Button Methods
349
416
  async clickCaretButtonForName(name) {
350
417
  await this.isCaretButtonWithNameVisible(name);
351
- await this.page.locator('uui-menu-item[label="' + name + '"]').locator('#caret-button').first().click();
418
+ await this.click(this.getMenuItemByLabel(name).locator('#caret-button').first());
352
419
  }
353
420
  async isCaretButtonWithNameVisible(name, isVisible = true) {
354
- await (0, test_1.expect)(this.page.locator('uui-menu-item[label="' + name + '"]').locator('#caret-button').first()).toBeVisible({ visible: isVisible });
421
+ await (0, test_1.expect)(this.getMenuItemByLabel(name).locator('#caret-button').first()).toBeVisible({ visible: isVisible });
355
422
  }
356
423
  async clickCaretButton() {
357
- await this.page.locator('#caret-button').click();
424
+ await this.click(this.caretBtn);
358
425
  }
359
426
  async openCaretButtonForName(name, isInModal = false) {
360
427
  let menuItem;
361
428
  if (isInModal) {
362
- menuItem = this.sidebarModal.locator('uui-menu-item[label="' + name + '"]');
429
+ menuItem = this.sidebarModal.locator(`uui-menu-item[label="${name}"]`);
363
430
  }
364
431
  else {
365
- menuItem = this.page.locator('uui-menu-item[label="' + name + '"]');
432
+ menuItem = this.getMenuItemByLabel(name);
366
433
  }
367
434
  const isCaretButtonOpen = await menuItem.getAttribute('show-children');
368
435
  if (isCaretButtonOpen === null) {
369
436
  await this.clickCaretButtonForName(name);
370
437
  }
371
438
  }
439
+ // Tree Methods
372
440
  async reloadTree(treeName) {
373
- // Waits until the tree item is visible
374
- await (0, test_1.expect)(this.page.getByLabel(treeName, { exact: true })).toBeVisible();
375
- await this.page.waitForTimeout(500);
441
+ await this.isVisible(this.page.getByLabel(treeName, { exact: true }));
442
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
376
443
  await this.clickActionsMenuForName(treeName);
377
444
  await this.clickReloadChildrenActionMenuOption();
378
445
  await this.openCaretButtonForName(treeName);
379
446
  }
447
+ async isTreeItemVisible(name, isVisible = true) {
448
+ await this.isVisible(this.treeItem.locator('[label="' + name + '"]'), isVisible);
449
+ }
450
+ async doesTreeItemHaveTheCorrectIcon(name, icon) {
451
+ return await this.isVisible(this.treeItem.filter({ hasText: name }).locator('umb-icon').locator('[name="' + icon + '"]'));
452
+ }
453
+ // Core Button Click Methods
380
454
  async clickReloadButton() {
381
- await (0, test_1.expect)(this.reloadBtn).toBeVisible();
382
- await this.reloadBtn.click();
455
+ await this.click(this.reloadBtn);
383
456
  }
384
457
  async clickReloadChildrenButton() {
385
- await (0, test_1.expect)(this.reloadChildrenBtn).toBeVisible();
386
- await this.reloadChildrenBtn.click({ force: true });
387
- }
388
- async isSuccessStateVisibleForSaveButton(isVisible = true) {
389
- const regex = new RegExp(`^workspace-action:.*Save$`);
390
- const saveButtonLocator = this.page.getByTestId(regex);
391
- const saveBtn = this.workspaceAction.filter({ has: saveButtonLocator });
392
- await (0, test_1.expect)(saveBtn.locator(this.successState)).toBeVisible({ visible: isVisible, timeout: 10000 });
458
+ await this.click(this.reloadChildrenBtn, { force: true });
393
459
  }
394
460
  async clickSaveButton() {
395
- await (0, test_1.expect)(this.saveBtn).toBeVisible();
396
- await this.saveBtn.click();
397
- await this.page.waitForTimeout(500);
461
+ await this.click(this.saveBtn);
462
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
398
463
  }
399
464
  async clickChooseButton() {
400
- await (0, test_1.expect)(this.chooseBtn).toBeVisible();
401
- await this.chooseBtn.click();
465
+ await this.click(this.chooseBtn);
402
466
  }
403
467
  async clickChooseContainerButton() {
404
- await this.containerChooseBtn.click();
405
- }
406
- async clickFilterChooseButton() {
407
- await this.filterChooseBtn.click();
468
+ await this.click(this.containerChooseBtn);
408
469
  }
409
- async clickRenameFolderThreeDotsButton() {
410
- await this.renameFolderThreeDotsBtn.click();
470
+ async clickSubmitButton() {
471
+ await this.click(this.submitBtn);
411
472
  }
412
- async clickRenameFolderButton() {
413
- await this.clickRenameButton();
473
+ async clickConfirmButton() {
474
+ await this.click(this.confirmBtn);
414
475
  }
415
- async clickConfirmRenameButton() {
416
- await this.confirmRenameBtn.click();
476
+ async clickCreateButton() {
477
+ await this.click(this.createBtn);
417
478
  }
418
- async clickUpdateFolderButton() {
419
- await this.updateFolderBtn.click();
479
+ async clickAddButton() {
480
+ await this.click(this.addBtn);
420
481
  }
421
482
  async clickUpdateButton() {
422
- await this.updateBtn.click();
423
- }
424
- async clickSubmitButton() {
425
- await (0, test_1.expect)(this.submitBtn).toBeVisible();
426
- await this.submitBtn.click();
427
- }
428
- async clickConfirmToSubmitButton() {
429
- await this.confirmToSubmitBtn.click();
483
+ await this.click(this.updateBtn);
430
484
  }
431
485
  async clickChangeButton() {
432
- await this.changeBtn.click();
486
+ await this.click(this.changeBtn);
433
487
  }
434
- async clickExactLinkWithName(name, toForce = false) {
435
- const exactLinkWithNameLocator = this.page.getByRole('link', { name: name, exact: true });
436
- await (0, test_1.expect)(exactLinkWithNameLocator).toBeVisible();
437
- await exactLinkWithNameLocator.click({ force: toForce });
488
+ async clickDeleteButton() {
489
+ await this.click(this.deleteBtn);
438
490
  }
439
- async enterAliasName(aliasName) {
440
- // Unlocks alias
441
- await this.page.waitForTimeout(500);
442
- await (0, test_1.expect)(this.aliasLockBtn).toBeVisible();
443
- await this.aliasLockBtn.click({ force: true });
444
- await this.aliasNameTxt.clear();
445
- await this.aliasNameTxt.fill(aliasName);
491
+ async clickDeleteExactButton() {
492
+ await this.click(this.deleteExactBtn);
446
493
  }
447
- async updateIcon(iconName) {
448
- await (0, test_1.expect)(this.iconBtn).toBeVisible();
449
- // Force click is needed
450
- await this.iconBtn.click({ force: true });
451
- await this.searchForTypeToFilterValue(iconName);
452
- await this.clickLabelWithName(iconName, true, true);
453
- await this.clickSubmitButton();
494
+ async clickRemoveExactButton() {
495
+ await this.click(this.removeExactBtn);
454
496
  }
455
- async clickTextButtonWithName(name) {
456
- await (0, test_1.expect)(this.page.getByText(name, { exact: true })).toBeVisible();
457
- await this.page.getByText(name, { exact: true }).click();
497
+ async clickInsertButton() {
498
+ await this.click(this.insertBtn);
458
499
  }
459
- async clickSelectPropertyEditorButton() {
460
- await (0, test_1.expect)(this.selectPropertyEditorBtn).toBeVisible();
461
- await this.selectPropertyEditorBtn.click();
500
+ async clickRenameButton() {
501
+ await this.click(this.renameBtn);
462
502
  }
463
- async clickCreateFolderButton() {
464
- await (0, test_1.expect)(this.createFolderBtn).toBeVisible();
465
- await this.createFolderBtn.click();
466
- await this.page.waitForTimeout(500); // Wait for the action to complete
503
+ async clickRestoreButton() {
504
+ await this.click(this.restoreBtn);
467
505
  }
468
- async enterAPropertyName(name) {
469
- await (0, test_1.expect)(this.propertyNameTxt).toBeVisible();
470
- await this.propertyNameTxt.fill(name);
506
+ async clickDisableButton() {
507
+ await this.click(this.disableBtn);
471
508
  }
472
- async clickNextPaginationButton() {
473
- await (0, test_1.expect)(this.nextPaginationBtn).toBeVisible();
474
- await this.nextPaginationBtn.click();
509
+ async clickEnableButton() {
510
+ await this.click(this.enableBtn);
475
511
  }
476
- async clickNextButton() {
477
- await (0, test_1.expect)(this.nextBtn).toBeVisible();
478
- await this.nextBtn.click();
512
+ async clickActionButton() {
513
+ await this.click(this.actionBtn);
479
514
  }
480
- async clickConfirmButton() {
481
- await (0, test_1.expect)(this.confirmBtn).toBeVisible();
482
- await this.confirmBtn.click();
515
+ async clickNextButton() {
516
+ await this.click(this.nextBtn);
483
517
  }
484
518
  async clickBreadcrumbButton() {
485
- await (0, test_1.expect)(this.breadcrumbBtn).toBeVisible();
486
- await this.breadcrumbBtn.click();
519
+ await this.click(this.breadcrumbBtn);
487
520
  }
488
- async clickInsertButton() {
489
- await (0, test_1.expect)(this.insertBtn).toBeVisible();
490
- await this.insertBtn.click();
521
+ async clickLeftArrowButton() {
522
+ await this.click(this.leftArrowBtn);
491
523
  }
524
+ // Confirmation Button Methods
492
525
  async clickConfirmToDeleteButton() {
493
- await (0, test_1.expect)(this.confirmToDeleteBtn).toBeVisible();
494
- await this.confirmToDeleteBtn.click();
495
- await this.page.waitForTimeout(500); // Wait for the action to complete
526
+ await this.click(this.confirmToDeleteBtn);
527
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
496
528
  }
497
529
  async clickConfirmCreateFolderButton() {
498
- await (0, test_1.expect)(this.confirmCreateFolderBtn).toBeVisible();
499
- await this.confirmCreateFolderBtn.click();
500
- await this.page.waitForTimeout(500); // Wait for the action to complete
501
- }
502
- async clickRemoveExactButton() {
503
- await (0, test_1.expect)(this.removeExactBtn).toBeVisible();
504
- await this.removeExactBtn.click();
505
- }
506
- async clickRemoveButtonForName(name) {
507
- const removeButtonWithNameLocator = this.page.locator('[name="' + name + '"] [label="Remove"]');
508
- await (0, test_1.expect)(removeButtonWithNameLocator).toBeVisible();
509
- await removeButtonWithNameLocator.click();
510
- }
511
- async clickTrashIconButtonForName(name) {
512
- const trashIconButtonWithNameLocator = this.page.locator('[name="' + name + '"] [name="icon-trash"]');
513
- await (0, test_1.expect)(trashIconButtonWithNameLocator).toBeVisible();
514
- await trashIconButtonWithNameLocator.click();
530
+ await this.click(this.confirmCreateFolderBtn);
531
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
515
532
  }
516
- async clickRemoveWithName(name) {
517
- const removeLabelWithNameLocator = this.page.locator('[label="Remove ' + name + '"]');
518
- await (0, test_1.expect)(removeLabelWithNameLocator).toBeVisible();
519
- await removeLabelWithNameLocator.click();
533
+ async clickConfirmRemoveButton() {
534
+ await this.click(this.confirmToRemoveBtn);
520
535
  }
521
- async clickDisableButton() {
522
- await (0, test_1.expect)(this.disableBtn).toBeVisible();
523
- await this.disableBtn.click();
536
+ async clickConfirmToSubmitButton() {
537
+ await this.click(this.confirmToSubmitBtn);
524
538
  }
525
539
  async clickConfirmDisableButton() {
526
- await (0, test_1.expect)(this.confirmDisableBtn).toBeVisible();
527
- await this.confirmDisableBtn.click();
528
- }
529
- async clickConfirmRemoveButton() {
530
- await (0, test_1.expect)(this.confirmToRemoveBtn).toBeVisible();
531
- await this.confirmToRemoveBtn.click();
532
- }
533
- async clickEnableButton() {
534
- await (0, test_1.expect)(this.enableBtn).toBeVisible();
535
- await this.enableBtn.click();
540
+ await this.click(this.confirmDisableBtn);
536
541
  }
537
542
  async clickConfirmEnableButton() {
538
- await (0, test_1.expect)(this.confirmEnableBtn).toBeVisible();
539
- await this.confirmEnableBtn.click();
543
+ await this.click(this.confirmEnableBtn);
540
544
  }
541
- async insertDictionaryItem(dictionaryName) {
542
- await this.clickInsertButton();
543
- await (0, test_1.expect)(this.insertDictionaryItemBtn).toBeVisible();
544
- await this.insertDictionaryItemBtn.click();
545
- await (0, test_1.expect)(this.page.getByLabel(dictionaryName)).toBeVisible();
546
- await this.page.getByLabel(dictionaryName).click();
547
- await (0, test_1.expect)(this.chooseBtn).toBeVisible();
548
- await this.chooseBtn.click();
545
+ async clickConfirmRenameButton() {
546
+ await this.click(this.confirmRenameBtn);
549
547
  }
550
- async addQueryBuilderWithOrderByStatement(propertyAlias, isAscending) {
551
- await (0, test_1.expect)(this.queryBuilderBtn).toBeVisible({ timeout: 10000 });
552
- await this.queryBuilderBtn.click();
553
- await (0, test_1.expect)(this.orderByPropertyAliasBtn).toBeVisible();
554
- await this.orderByPropertyAliasBtn.click();
555
- // Wait and choose property alias option
556
- await this.waitAndSelectQueryBuilderDropDownList(propertyAlias);
557
- await (0, test_1.expect)(this.orderByPropertyAliasBtn).toBeVisible();
558
- await this.orderByPropertyAliasBtn.click();
559
- // Click to ascending button if isAscending is false
560
- if (!isAscending) {
561
- await (0, test_1.expect)(this.ascendingBtn).toBeVisible();
562
- await this.ascendingBtn.click();
563
- }
548
+ async clickConfirmTrashButton() {
549
+ await this.click(this.confirmTrashBtn);
550
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
564
551
  }
565
- async addQueryBuilderWithWhereStatement(propertyAlias, operator, constrainValue) {
566
- await (0, test_1.expect)(this.queryBuilderBtn).toBeVisible({ timeout: 10000 });
567
- await this.queryBuilderBtn.click();
568
- // Wait and choose property alias
569
- await (0, test_1.expect)(this.wherePropertyAliasBtn).toBeVisible();
570
- await this.wherePropertyAliasBtn.click();
571
- await this.waitAndSelectQueryBuilderDropDownList(propertyAlias);
572
- // Wait and choose operator
573
- await (0, test_1.expect)(this.whereOperatorBtn).toBeVisible();
574
- await this.whereOperatorBtn.click();
575
- await this.waitAndSelectQueryBuilderDropDownList(operator);
576
- // Wait and choose constrain value and press Enter
577
- await (0, test_1.expect)(this.whereConstrainValueTxt).toBeVisible();
578
- await this.whereConstrainValueTxt.clear();
579
- await this.whereConstrainValueTxt.fill(constrainValue);
580
- await this.whereConstrainValueTxt.press('Enter');
552
+ async clickDeleteAndConfirmButton() {
553
+ await this.clickDeleteActionMenuOption();
554
+ await this.clickConfirmToDeleteButton();
581
555
  }
582
- async waitAndSelectQueryBuilderDropDownList(option) {
583
- const ddlOption = this.page.locator('[open]').locator('uui-combobox-list-option').filter({ hasText: option }).first();
584
- await (0, test_1.expect)(ddlOption).toBeVisible({ timeout: 10000 });
585
- await ddlOption.click();
556
+ // Folder Methods
557
+ async clickCreateFolderButton() {
558
+ await this.click(this.createFolderBtn);
559
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
560
+ }
561
+ async enterFolderName(folderName) {
562
+ await this.enterText(this.folderNameTxt, folderName, { verify: true });
586
563
  }
587
564
  async createFolder(folderName) {
588
565
  await this.clickCreateActionMenuOption();
@@ -590,585 +567,577 @@ class UiBaseLocators {
590
567
  await this.enterFolderName(folderName);
591
568
  await this.clickConfirmCreateFolderButton();
592
569
  }
593
- async deletePropertyEditor(propertyEditorName) {
594
- // We need to hover over the property to be able to see the delete button
595
- await this.page.locator('uui-button').filter({ hasText: propertyEditorName }).getByLabel('Editor settings').hover();
596
- await this.deleteBtn.click();
570
+ async deleteFolder() {
571
+ await this.clickDeleteActionMenuOption();
572
+ await this.clickConfirmToDeleteButton();
597
573
  }
598
- async enterFolderName(folderName) {
599
- await (0, test_1.expect)(this.folderNameTxt).toBeVisible();
600
- await this.folderNameTxt.clear();
601
- await this.folderNameTxt.fill(folderName);
602
- await (0, test_1.expect)(this.folderNameTxt).toHaveValue(folderName);
574
+ async clickFolderButton() {
575
+ await this.click(this.folderBtn);
603
576
  }
604
- async isTextWithExactNameVisible(name, isVisible = true) {
605
- return (0, test_1.expect)(this.page.getByText(name, { exact: true })).toBeVisible({ visible: isVisible });
577
+ async clickNewFolderThreeDotsButton() {
578
+ await this.click(this.newFolderThreeDotsBtn);
606
579
  }
607
- async isQueryBuilderCodeShown(code) {
608
- await (0, test_1.expect)(this.queryBuilderShowCode).toBeVisible();
609
- await this.queryBuilderShowCode.click();
610
- await (0, test_1.expect)(this.queryBuilderShowCode).toContainText(code, { timeout: 10000 });
580
+ async clickRenameFolderThreeDotsButton() {
581
+ await this.click(this.renameFolderThreeDotsBtn);
611
582
  }
612
- async deleteFolder() {
613
- await this.clickDeleteActionMenuOption();
614
- await this.clickConfirmToDeleteButton();
583
+ async clickRenameFolderButton() {
584
+ await this.clickRenameButton();
615
585
  }
616
- async clickDeleteExactButton() {
617
- await (0, test_1.expect)(this.deleteExactBtn).toBeVisible();
618
- await this.deleteExactBtn.click();
586
+ async clickUpdateFolderButton() {
587
+ await this.click(this.updateFolderBtn);
619
588
  }
620
- async isTreeItemVisible(name, isVisible = true) {
621
- await (0, test_1.expect)(this.page.locator('umb-tree-item').locator('[label="' + name + '"]')).toBeVisible({ visible: isVisible });
589
+ // Three Dots Menu Methods
590
+ async clickCreateThreeDotsButton() {
591
+ await this.click(this.createThreeDotsBtn);
622
592
  }
623
- async doesTreeItemHaveTheCorrectIcon(name, icon) {
624
- return await (0, test_1.expect)(this.page.locator('umb-tree-item').filter({ hasText: name }).locator('umb-icon').locator('[name="' + icon + '"]')).toBeVisible();
593
+ async clickFilterChooseButton() {
594
+ await this.click(this.filterChooseBtn);
595
+ }
596
+ // Success State Methods
597
+ async isSuccessStateVisibleForSaveButton(isVisible = true) {
598
+ const regex = new RegExp(`^workspace-action:.*Save$`);
599
+ const saveButtonLocator = this.page.getByTestId(regex);
600
+ const saveBtn = this.workspaceAction.filter({ has: saveButtonLocator });
601
+ await (0, test_1.expect)(saveBtn.locator(this.successState)).toBeVisible({ visible: isVisible, timeout: ConstantHelper_1.ConstantHelper.timeout.long });
602
+ }
603
+ async isSuccessButtonWithTextVisible(text) {
604
+ return await this.isVisible(this.successState.filter({ hasText: text }));
605
+ }
606
+ async isSuccessStateIconVisible() {
607
+ await this.isVisible(this.successStateIcon);
608
+ }
609
+ async isFailedStateButtonVisible() {
610
+ await this.isVisible(this.failedStateButton);
611
+ }
612
+ // Notification Methods
613
+ async isSuccessNotificationVisible(isVisible = true) {
614
+ return await (0, test_1.expect)(this.successNotification.first()).toBeVisible({ visible: isVisible, timeout: ConstantHelper_1.ConstantHelper.timeout.long });
615
+ }
616
+ async doesSuccessNotificationsHaveCount(count) {
617
+ await this.hasCount(this.successNotification, count);
618
+ }
619
+ async doesSuccessNotificationHaveText(text, isVisible = true, deleteNotification = false, timeout = 5000) {
620
+ const response = await (0, test_1.expect)(this.successNotification.filter({ hasText: text })).toBeVisible({
621
+ visible: isVisible,
622
+ timeout: timeout
623
+ });
624
+ if (deleteNotification) {
625
+ await this.click(this.successNotification.filter({ hasText: text }).getByLabel('close'), { force: true });
626
+ }
627
+ return response;
628
+ }
629
+ async isErrorNotificationVisible(isVisible = true) {
630
+ return await (0, test_1.expect)(this.errorNotification.first()).toBeVisible({ visible: isVisible });
631
+ }
632
+ async doesErrorNotificationHaveText(text, isVisible = true, deleteNotification = false) {
633
+ const response = await (0, test_1.expect)(this.errorNotification.filter({ hasText: text })).toBeVisible({ visible: isVisible });
634
+ if (deleteNotification) {
635
+ await this.click(this.errorNotification.filter({ hasText: text }).locator('svg'));
636
+ }
637
+ return response;
638
+ }
639
+ // Modal Methods
640
+ async clickChooseModalButton() {
641
+ await this.click(this.chooseModalBtn);
625
642
  }
643
+ async clickCreateModalButton() {
644
+ await this.click(this.createModalBtn);
645
+ }
646
+ async clickModalMenuItemWithName(name) {
647
+ await this.click(this.openedModal.locator(`uui-menu-item[label="${name}"]`));
648
+ }
649
+ async isModalMenuItemWithNameDisabled(name) {
650
+ await this.hasAttribute(this.sidebarModal.locator(`uui-menu-item[label="${name}"]`), 'disabled', '');
651
+ }
652
+ async isModalMenuItemWithNameVisible(name, isVisible = true) {
653
+ await this.isVisible(this.sidebarModal.locator(`uui-menu-item[label="${name}"]`), isVisible);
654
+ }
655
+ // Container Methods
656
+ async clickContainerSaveAndPublishButton() {
657
+ await this.click(this.containerSaveAndPublishBtn);
658
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
659
+ }
660
+ // Navigation Methods
626
661
  async goToSection(sectionName, checkSections = true, skipReload = false) {
627
662
  if (checkSections) {
628
663
  for (let section in ConstantHelper_1.ConstantHelper.sections) {
629
- await (0, test_1.expect)(this.sectionLinks.getByRole('tab', { name: ConstantHelper_1.ConstantHelper.sections[section] })).toBeVisible({ timeout: 30000 });
664
+ await (0, test_1.expect)(this.sectionLinks.getByRole('tab', { name: ConstantHelper_1.ConstantHelper.sections[section] })).toBeVisible({ timeout: ConstantHelper_1.ConstantHelper.timeout.navigation });
630
665
  }
631
666
  }
632
- // We need to check if we are on the section tab already, if we are, then we need to reload the page instead of clicking again
633
667
  const alreadySelected = await this.sectionLinks.locator('[active]').getByText(sectionName).isVisible();
634
668
  if (alreadySelected && !skipReload) {
635
669
  await this.page.reload();
636
670
  }
637
671
  else {
638
- await this.backOfficeHeader.getByRole('tab', { name: sectionName }).click();
672
+ await this.click(this.backOfficeHeader.getByRole('tab', { name: sectionName }));
639
673
  }
640
674
  }
641
675
  async goToSettingsTreeItem(settingsTreeItemName) {
642
676
  await this.goToSection(ConstantHelper_1.ConstantHelper.sections.settings);
643
- await (0, test_1.expect)(this.page.getByLabel(settingsTreeItemName, { exact: true })).toBeVisible();
644
- await this.page.getByLabel(settingsTreeItemName, { exact: true }).click();
677
+ await this.click(this.page.getByLabel(settingsTreeItemName, { exact: true }));
645
678
  }
646
- async clickDataElement(elementName, options = null) {
647
- await this.page.click(`[data-element="${elementName}"]`, options);
679
+ async isSectionWithNameVisible(sectionName, isVisible = true) {
680
+ await this.isVisible(this.page.getByRole('tab', { name: sectionName }), isVisible);
648
681
  }
649
- async getDataElement(elementName) {
650
- return this.page.locator(`[data-element="${elementName}"]`);
682
+ async isBackOfficeMainVisible(isVisible = true) {
683
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.medium);
684
+ await this.isVisible(this.backOfficeMain, isVisible);
651
685
  }
652
- async isButtonWithNameVisible(name) {
653
- await (0, test_1.expect)(this.page.getByRole('button', { name: name })).toBeVisible();
686
+ // Link & Button Click by Name Methods
687
+ async clickExactLinkWithName(name, toForce = false) {
688
+ const exactLinkWithNameLocator = this.page.getByRole('link', { name: name, exact: true });
689
+ await this.click(exactLinkWithNameLocator, { force: toForce });
690
+ }
691
+ async clickLinkWithName(name, isExact = false) {
692
+ await this.click(this.page.getByRole('link', { name: name, exact: isExact }));
654
693
  }
655
694
  async clickLabelWithName(name, isExact = true, toForce = false) {
656
- await (0, test_1.expect)(this.page.getByLabel(name, { exact: isExact })).toBeVisible();
657
- await this.page.getByLabel(name, { exact: isExact }).click({ force: toForce });
695
+ await this.click(this.page.getByLabel(name, { exact: isExact }), { force: toForce });
658
696
  }
659
697
  async clickButtonWithName(name, isExact = false) {
660
698
  const exactButtonWithNameLocator = this.page.getByRole('button', { name: name, exact: isExact });
661
- await (0, test_1.expect)(exactButtonWithNameLocator).toBeVisible();
662
- // Force click is needed
663
- await exactButtonWithNameLocator.click({ force: true });
699
+ await this.click(exactButtonWithNameLocator, { force: true });
664
700
  }
665
- async isSuccessNotificationVisible(isVisible = true) {
666
- return await (0, test_1.expect)(this.successNotification.first()).toBeVisible({ visible: isVisible, timeout: 10000 });
667
- }
668
- async doesSuccessNotificationsHaveCount(count) {
669
- return await (0, test_1.expect)(this.successNotification).toHaveCount(count);
701
+ async clickTextButtonWithName(name) {
702
+ await this.click(this.page.getByText(name, { exact: true }));
670
703
  }
671
- async isErrorNotificationVisible(isVisible = true) {
672
- return await (0, test_1.expect)(this.errorNotification.first()).toBeVisible({ visible: isVisible });
704
+ async isButtonWithNameVisible(name) {
705
+ await this.isVisible(this.page.getByRole('button', { name: name }));
673
706
  }
674
- async isTextWithMessageVisible(message, isVisible = true) {
675
- return await (0, test_1.expect)(this.page.getByText(message)).toBeVisible({ visible: isVisible });
707
+ async getButtonWithName(name) {
708
+ await this.waitForVisible(this.page.getByRole('button', { name: name }));
709
+ return this.page.getByRole('button', { name: name });
676
710
  }
677
- async clickCreateThreeDotsButton() {
678
- await (0, test_1.expect)(this.createThreeDotsBtn).toBeVisible();
679
- await this.createThreeDotsBtn.click();
711
+ // Remove Button Methods
712
+ async clickRemoveButtonForName(name) {
713
+ const removeButtonWithNameLocator = this.page.locator('[name="' + name + '"] [label="Remove"]');
714
+ await this.click(removeButtonWithNameLocator);
680
715
  }
681
- async clickCreateButton() {
682
- await (0, test_1.expect)(this.createBtn).toBeVisible();
683
- await this.createBtn.click();
716
+ async clickTrashIconButtonForName(name) {
717
+ const trashIconButtonWithNameLocator = this.page.locator('[name="' + name + '"] [name="icon-trash"]');
718
+ await this.click(trashIconButtonWithNameLocator);
684
719
  }
685
- async clickAddButton() {
686
- await (0, test_1.expect)(this.addBtn).toBeVisible();
687
- await this.addBtn.click();
720
+ async clickRemoveWithName(name) {
721
+ const removeLabelWithNameLocator = this.page.locator('[label="Remove ' + name + '"]');
722
+ await this.click(removeLabelWithNameLocator);
688
723
  }
689
- ;
690
- async clickNewFolderThreeDotsButton() {
691
- await (0, test_1.expect)(this.newFolderThreeDotsBtn).toBeVisible();
692
- await this.newFolderThreeDotsBtn.click();
724
+ // Alias & Icon Methods
725
+ async enterAliasName(aliasName) {
726
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
727
+ await this.click(this.aliasLockBtn, { force: true });
728
+ await this.enterText(this.aliasNameTxt, aliasName);
693
729
  }
694
- async clickEditorSettingsButton(index = 0) {
695
- await (0, test_1.expect)(this.editorSettingsBtn.nth(index)).toBeVisible();
696
- return this.editorSettingsBtn.nth(index).click();
730
+ async updateIcon(iconName) {
731
+ await this.click(this.iconBtn, { force: true });
732
+ await this.searchForTypeToFilterValue(iconName);
733
+ await this.clickLabelWithName(iconName, true, true);
734
+ await this.clickSubmitButton();
697
735
  }
698
- async enterDescription(description) {
699
- await (0, test_1.expect)(this.enterDescriptionTxt).toBeVisible();
700
- await this.enterDescriptionTxt.clear();
701
- await this.enterDescriptionTxt.fill(description);
736
+ // Property Editor Methods
737
+ async clickSelectPropertyEditorButton() {
738
+ await this.click(this.selectPropertyEditorBtn);
702
739
  }
703
- async doesDescriptionHaveValue(value, index = 0) {
704
- return await (0, test_1.expect)(this.descriptionBtn.nth(index)).toHaveValue(value);
740
+ async enterAPropertyName(name) {
741
+ await this.enterText(this.propertyNameTxt, name, { clearFirst: false });
705
742
  }
706
- async clickStructureTab() {
707
- await this.page.waitForTimeout(1000);
708
- await (0, test_1.expect)(this.structureTabBtn).toBeVisible();
709
- await this.structureTabBtn.click();
743
+ async clickEditorSettingsButton(index = 0) {
744
+ await this.click(this.editorSettingsBtn.nth(index));
710
745
  }
711
- async clickAllowAtRootButton() {
712
- await (0, test_1.expect)(this.allowAtRootBtn).toBeVisible();
713
- await this.allowAtRootBtn.click();
746
+ async addPropertyEditor(propertyEditorName, index = 0) {
747
+ await this.click(this.addPropertyBtn.nth(index));
748
+ await this.enterAPropertyName(propertyEditorName);
749
+ await this.hasValue(this.propertyNameTxt, propertyEditorName);
750
+ await this.clickSelectPropertyEditorButton();
751
+ await this.searchForTypeToFilterValue(propertyEditorName);
752
+ await this.click(this.page.getByText(propertyEditorName, { exact: true }));
753
+ await this.clickSubmitButton();
714
754
  }
715
- async clickIAmDoneReorderingButton() {
716
- await (0, test_1.expect)(this.iAmDoneReorderingBtn).toBeVisible();
717
- await this.iAmDoneReorderingBtn.click();
755
+ async updatePropertyEditor(propertyEditorName) {
756
+ await this.clickEditorSettingsButton();
757
+ await this.clickChangeButton();
758
+ await this.searchForTypeToFilterValue(propertyEditorName);
759
+ await this.click(this.page.getByText(propertyEditorName, { exact: true }));
760
+ await this.enterAPropertyName(propertyEditorName);
761
+ await this.clickSubmitButton();
718
762
  }
719
- async clickReorderButton() {
720
- await (0, test_1.expect)(this.reorderBtn).toBeVisible();
721
- await this.reorderBtn.click();
763
+ async deletePropertyEditor(propertyEditorName) {
764
+ await this.page.locator('uui-button').filter({ hasText: propertyEditorName }).getByLabel('Editor settings').hover();
765
+ await this.click(this.deleteBtn);
722
766
  }
723
- async clickLabelAboveButton() {
724
- await (0, test_1.expect)(this.labelAboveBtn).toBeVisible();
725
- await this.labelAboveBtn.click();
767
+ async deletePropertyEditorWithName(name) {
768
+ const propertyEditor = this.page.locator('umb-content-type-design-editor-property', { hasText: name });
769
+ await this.hoverAndClick(propertyEditor, propertyEditor.getByLabel('Delete'), { force: true });
770
+ await this.clickConfirmToDeleteButton();
726
771
  }
727
- async clickMandatoryToggle() {
728
- await (0, test_1.expect)(this.mandatoryToggle).toBeVisible();
729
- await this.mandatoryToggle.click();
772
+ async enterPropertyEditorDescription(description) {
773
+ await this.enterText(this.enterPropertyEditorDescriptionTxt, description);
730
774
  }
731
- async selectValidationOption(option) {
732
- await (0, test_1.expect)(this.validation).toBeVisible();
733
- await this.validation.selectOption(option);
775
+ async isPropertyEditorUiWithNameReadOnly(name) {
776
+ const propertyEditorUiLocator = this.page.locator('umb-property-editor-ui-' + name);
777
+ await this.hasAttribute(propertyEditorUiLocator, 'readonly', '');
734
778
  }
735
- async enterRegEx(regEx) {
736
- await (0, test_1.expect)(this.regexTxt).toBeVisible();
737
- await this.regexTxt.fill(regEx);
779
+ async isPropertyEditorUiWithNameVisible(name, isVisible = true) {
780
+ const propertyEditorUiLocator = this.page.locator('umb-property-editor-ui-' + name);
781
+ await this.isVisible(propertyEditorUiLocator, isVisible);
738
782
  }
739
- async enterRegExMessage(regExMessage) {
740
- await (0, test_1.expect)(this.regexMessageTxt).toBeVisible();
741
- await this.regexMessageTxt.fill(regExMessage);
783
+ async doesPropertyHaveInvalidBadge(propertyName) {
784
+ await this.isVisible(this.page.locator('umb-property-layout').filter({ hasText: propertyName }).locator('#invalid-badge uui-badge'));
742
785
  }
743
- async clickCompositionsButton() {
744
- await (0, test_1.expect)(this.compositionsBtn).toBeVisible();
745
- await this.compositionsBtn.click();
786
+ // Group Methods
787
+ async clickAddGroupButton() {
788
+ await this.click(this.addGroupBtn);
746
789
  }
747
- async clickAddTabButton() {
748
- await (0, test_1.expect)(this.addTabBtn).toBeVisible();
749
- await this.addTabBtn.click();
790
+ async enterGroupName(groupName, index = 0) {
791
+ const groupNameTxt = this.groupLabel.nth(index);
792
+ await this.enterText(groupNameTxt, groupName);
750
793
  }
751
- async enterTabName(tabName) {
752
- await (0, test_1.expect)(this.unnamedTabTxt).toBeVisible();
753
- await this.page.waitForTimeout(400);
754
- await this.unnamedTabTxt.clear();
755
- await this.unnamedTabTxt.fill(tabName);
756
- // We use this to make sure the test id is updated
757
- await this.page.getByRole('tab', { name: 'Design' }).click();
758
- // We click again to make sure the tab is focused
759
- await this.page.getByTestId('tab:' + tabName).click();
794
+ async isGroupVisible(groupName, isVisible = true) {
795
+ await this.isVisible(this.groupLabel.filter({ hasText: groupName }), isVisible);
760
796
  }
761
- async searchForTypeToFilterValue(searchValue) {
762
- await (0, test_1.expect)(this.typeToFilterSearchTxt).toBeVisible();
763
- await this.typeToFilterSearchTxt.fill(searchValue);
797
+ async doesGroupHaveValue(value) {
798
+ await this.waitForVisible(this.groupLabel);
799
+ return await this.hasValue(this.groupLabel, value);
764
800
  }
765
- async addPropertyEditor(propertyEditorName, index = 0) {
766
- await (0, test_1.expect)(this.addPropertyBtn.nth(index)).toBeVisible();
767
- await this.addPropertyBtn.nth(index).click();
768
- await this.enterAPropertyName(propertyEditorName);
769
- await (0, test_1.expect)(this.propertyNameTxt).toHaveValue(propertyEditorName);
770
- await this.clickSelectPropertyEditorButton();
771
- await this.searchForTypeToFilterValue(propertyEditorName);
772
- await this.page.getByText(propertyEditorName, { exact: true }).click();
773
- await this.clickSubmitButton();
801
+ async deleteGroup(groupName) {
802
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.medium);
803
+ const groups = this.page.locator('umb-content-type-design-editor-group').all();
804
+ for (const group of await groups) {
805
+ if (await group.getByLabel('Group', { exact: true }).inputValue() === groupName) {
806
+ const headerActionsDeleteLocator = group.locator('[slot="header-actions"]').getByLabel('Delete');
807
+ await this.click(headerActionsDeleteLocator, { force: true });
808
+ return;
809
+ }
810
+ }
774
811
  }
775
- async updatePropertyEditor(propertyEditorName) {
776
- await this.clickEditorSettingsButton();
777
- await this.clickChangeButton();
778
- await this.searchForTypeToFilterValue(propertyEditorName);
779
- await this.page.getByText(propertyEditorName, { exact: true }).click();
780
- await this.enterAPropertyName(propertyEditorName);
781
- await this.clickSubmitButton();
812
+ async reorderTwoGroups(firstGroupName, secondGroupName) {
813
+ const firstGroup = this.page.getByTestId('group:' + firstGroupName);
814
+ const secondGroup = this.page.getByTestId('group:' + secondGroupName);
815
+ const firstGroupValue = await firstGroup.getByLabel('Group').inputValue();
816
+ const secondGroupValue = await secondGroup.getByLabel('Group').inputValue();
817
+ const dragToLocator = firstGroup.locator('[slot="header"]').first();
818
+ const dragFromLocator = secondGroup.locator('[slot="header"]').first();
819
+ await this.dragAndDrop(dragFromLocator, dragToLocator, 0, 0, 20);
820
+ return { firstGroupValue, secondGroupValue };
782
821
  }
783
- async enterPropertyEditorDescription(description) {
784
- await (0, test_1.expect)(this.enterPropertyEditorDescriptionTxt).toBeVisible();
785
- await this.enterPropertyEditorDescriptionTxt.clear();
786
- await this.enterPropertyEditorDescriptionTxt.fill(description);
822
+ // Tab Methods
823
+ async clickAddTabButton() {
824
+ await this.click(this.addTabBtn);
787
825
  }
788
- async clickAddGroupButton() {
789
- await (0, test_1.expect)(this.addGroupBtn).toBeVisible();
790
- await this.addGroupBtn.click();
826
+ async enterTabName(tabName) {
827
+ await this.waitForVisible(this.unnamedTabTxt);
828
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.debounce);
829
+ await this.enterText(this.unnamedTabTxt, tabName);
830
+ await this.click(this.page.getByRole('tab', { name: 'Design' }));
831
+ await this.click(this.page.getByTestId('tab:' + tabName));
791
832
  }
792
- async clickChooseModalButton() {
793
- await (0, test_1.expect)(this.chooseModalBtn).toBeVisible();
794
- await this.chooseModalBtn.click();
833
+ async clickRemoveTabWithName(name) {
834
+ const tab = this.page.locator('uui-tab').filter({ hasText: name });
835
+ await this.hoverAndClick(tab, tab.locator('[label="Remove"]'));
795
836
  }
796
- async enterGroupName(groupName, index = 0) {
797
- const groupNameTxt = this.groupLabel.nth(index);
798
- await (0, test_1.expect)(groupNameTxt).toBeVisible();
799
- await groupNameTxt.clear();
800
- await groupNameTxt.fill(groupName);
837
+ async clickStructureTab() {
838
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.medium);
839
+ await this.click(this.structureTabBtn);
801
840
  }
802
- async isGroupVisible(groupName, isVisible = true) {
803
- await (0, test_1.expect)(this.groupLabel.filter({ hasText: groupName })).toBeVisible({ visible: isVisible });
841
+ getTabLocatorWithName(name) {
842
+ return this.page.getByRole('tab', { name: name });
804
843
  }
805
- async doesGroupHaveValue(value) {
806
- await (0, test_1.expect)(this.groupLabel).toBeVisible();
807
- return await (0, test_1.expect)(this.groupLabel).toHaveValue(value);
844
+ // Validation Methods
845
+ async clickMandatoryToggle() {
846
+ await this.click(this.mandatoryToggle);
808
847
  }
809
- async rename(newName) {
810
- await this.clickRenameActionMenuOption();
811
- await (0, test_1.expect)(this.newNameTxt).toBeVisible();
812
- await this.newNameTxt.click();
813
- await this.newNameTxt.clear();
814
- await this.newNameTxt.fill(newName);
815
- await this.renameModalBtn.click();
816
- await this.page.waitForTimeout(500);
848
+ async selectValidationOption(option) {
849
+ await this.selectByValue(this.validation, option);
817
850
  }
818
- async isSuccessButtonWithTextVisible(text) {
819
- return await (0, test_1.expect)(this.successState.filter({ hasText: text })).toBeVisible();
851
+ async enterRegEx(regEx) {
852
+ await this.enterText(this.regexTxt, regEx, { clearFirst: false });
820
853
  }
821
- async dragAndDrop(dragFromSelector, dragToSelector, verticalOffset = 0, horizontalOffset = 0, steps = 5) {
822
- await (0, test_1.expect)(dragFromSelector).toBeVisible();
823
- await (0, test_1.expect)(dragToSelector).toBeVisible();
824
- const targetLocation = await dragToSelector.boundingBox();
825
- const elementCenterX = targetLocation.x + targetLocation.width / 2;
826
- const elementCenterY = targetLocation.y + targetLocation.height / 2;
827
- await dragFromSelector.hover();
828
- await this.page.mouse.move(10, 10);
829
- await dragFromSelector.hover();
830
- await this.page.mouse.down();
831
- await this.page.waitForTimeout(400);
832
- await this.page.mouse.move(elementCenterX + horizontalOffset, elementCenterY + verticalOffset, { steps: steps });
833
- await this.page.waitForTimeout(400);
834
- await this.page.mouse.up();
854
+ async enterRegExMessage(regExMessage) {
855
+ await this.enterText(this.regexMessageTxt, regExMessage, { clearFirst: false });
835
856
  }
836
- async getButtonWithName(name) {
837
- await (0, test_1.expect)(this.page.getByRole('button', { name: name })).toBeVisible();
838
- return this.page.getByRole('button', { name: name });
857
+ async isValidationMessageVisible(message, isVisible = true) {
858
+ await this.isVisible(this.validationMessage.filter({ hasText: message }), isVisible);
839
859
  }
840
- async clickCreateLink() {
841
- await (0, test_1.expect)(this.createLink).toBeVisible();
842
- await this.createLink.click();
860
+ // Composition & Structure Methods
861
+ async clickCompositionsButton() {
862
+ await this.click(this.compositionsBtn);
843
863
  }
844
- async insertSystemFieldValue(fieldValue) {
845
- await this.clickInsertButton();
846
- await (0, test_1.expect)(this.insertValueBtn).toBeVisible();
847
- await this.insertValueBtn.click();
848
- await (0, test_1.expect)(this.chooseFieldDropDown).toBeVisible();
849
- await this.chooseFieldDropDown.click();
850
- await (0, test_1.expect)(this.systemFieldsOption).toBeVisible();
851
- await this.systemFieldsOption.click();
852
- await (0, test_1.expect)(this.chooseFieldValueDropDown).toBeVisible();
853
- await this.chooseFieldValueDropDown.click();
854
- await (0, test_1.expect)(this.page.getByText(fieldValue)).toBeVisible();
855
- await this.page.getByText(fieldValue).click();
856
- await this.clickSubmitButton();
864
+ async clickAllowAtRootButton() {
865
+ await this.click(this.allowAtRootBtn);
857
866
  }
858
- async insertPartialView(partialViewName) {
859
- await this.clickInsertButton();
860
- await (0, test_1.expect)(this.insertPartialViewBtn).toBeVisible();
861
- await this.insertPartialViewBtn.click();
862
- await (0, test_1.expect)(this.page.getByLabel(partialViewName)).toBeVisible();
863
- await this.page.getByLabel(partialViewName).click();
864
- await this.clickChooseButton();
867
+ async clickAllowedChildNodesButton() {
868
+ await this.click(this.allowedChildNodesModal.locator(this.chooseBtn));
865
869
  }
866
- async deletePropertyEditorWithName(name) {
867
- // We need to hover over the Property Editor to make the delete button visible
868
- const propertyEditor = this.page.locator('umb-content-type-design-editor-property', { hasText: name });
869
- await (0, test_1.expect)(propertyEditor).toBeVisible();
870
- await propertyEditor.hover();
871
- await (0, test_1.expect)(propertyEditor.getByLabel('Delete')).toBeVisible();
872
- // Force click is needed
873
- await propertyEditor.getByLabel('Delete').click({ force: true });
874
- await this.clickConfirmToDeleteButton();
870
+ async clickAddCollectionButton() {
871
+ await this.click(this.addCollectionBtn);
875
872
  }
876
- async clickRenameButton() {
877
- await (0, test_1.expect)(this.renameBtn).toBeVisible();
878
- await this.renameBtn.click();
873
+ // Reorder Methods
874
+ async clickIAmDoneReorderingButton() {
875
+ await this.click(this.iAmDoneReorderingBtn);
879
876
  }
880
- async clickDeleteAndConfirmButton() {
881
- await this.clickDeleteActionMenuOption();
882
- await this.clickConfirmToDeleteButton();
877
+ async clickReorderButton() {
878
+ await this.click(this.reorderBtn);
883
879
  }
884
- async clickDeleteButton() {
885
- await (0, test_1.expect)(this.deleteBtn).toBeVisible();
886
- await this.deleteBtn.click();
880
+ async clickLabelAboveButton() {
881
+ await this.click(this.labelAboveBtn);
887
882
  }
883
+ // Query Builder Methods
888
884
  async clickQueryBuilderButton() {
889
- await (0, test_1.expect)(this.queryBuilderBtn).toBeVisible();
890
- await this.queryBuilderBtn.click();
891
- await this.page.waitForTimeout(500);
885
+ await this.click(this.queryBuilderBtn);
886
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
887
+ }
888
+ async addQueryBuilderWithOrderByStatement(propertyAlias, isAscending) {
889
+ await this.click(this.queryBuilderBtn, { timeout: ConstantHelper_1.ConstantHelper.timeout.long });
890
+ await this.click(this.orderByPropertyAliasBtn);
891
+ await this.waitAndSelectQueryBuilderDropDownList(propertyAlias);
892
+ await this.click(this.orderByPropertyAliasBtn);
893
+ if (!isAscending) {
894
+ await this.click(this.ascendingBtn);
895
+ }
896
+ }
897
+ async addQueryBuilderWithWhereStatement(propertyAlias, operator, constrainValue) {
898
+ await this.click(this.queryBuilderBtn, { timeout: ConstantHelper_1.ConstantHelper.timeout.long });
899
+ await this.click(this.wherePropertyAliasBtn);
900
+ await this.waitAndSelectQueryBuilderDropDownList(propertyAlias);
901
+ await this.click(this.whereOperatorBtn);
902
+ await this.waitAndSelectQueryBuilderDropDownList(operator);
903
+ await this.enterText(this.whereConstrainValueTxt, constrainValue);
904
+ await this.pressKey(this.whereConstrainValueTxt, 'Enter');
905
+ }
906
+ async waitAndSelectQueryBuilderDropDownList(option) {
907
+ const ddlOption = this.page.locator('[open]').locator('uui-combobox-list-option').filter({ hasText: option }).first();
908
+ await this.click(ddlOption, { timeout: ConstantHelper_1.ConstantHelper.timeout.long });
892
909
  }
893
910
  async chooseRootContentInQueryBuilder(contentName) {
894
- await (0, test_1.expect)(this.chooseRootContentBtn).toBeVisible();
895
- await this.chooseRootContentBtn.click();
911
+ await this.click(this.chooseRootContentBtn);
896
912
  await this.clickModalMenuItemWithName(contentName);
897
913
  await this.clickChooseButton();
898
914
  }
899
- async reorderTwoGroups(firstGroupName, secondGroupName) {
900
- const firstGroup = this.page.getByTestId('group:' + firstGroupName);
901
- const secondGroup = this.page.getByTestId('group:' + secondGroupName);
902
- const firstGroupValue = await firstGroup.getByLabel('Group').inputValue();
903
- const secondGroupValue = await secondGroup.getByLabel('Group').inputValue();
904
- const dragToLocator = firstGroup.locator('[slot="header"]').first();
905
- const dragFromLocator = secondGroup.locator('[slot="header"]').first();
906
- await this.dragAndDrop(dragFromLocator, dragToLocator, 0, 0, 20);
907
- return { firstGroupValue, secondGroupValue };
908
- }
909
- async clickAllowedChildNodesButton() {
910
- await (0, test_1.expect)(this.allowedChildNodesModal.locator(this.chooseBtn)).toBeVisible();
911
- await this.allowedChildNodesModal.locator(this.chooseBtn).click();
912
- }
913
- async clickAddCollectionButton() {
914
- await (0, test_1.expect)(this.addCollectionBtn).toBeVisible();
915
- await this.addCollectionBtn.click();
915
+ async isQueryBuilderCodeShown(code) {
916
+ await this.click(this.queryBuilderShowCode);
917
+ await this.containsText(this.queryBuilderShowCode, code, ConstantHelper_1.ConstantHelper.timeout.long);
916
918
  }
917
919
  async doesReturnedItemsHaveCount(itemCount) {
918
- await (0, test_1.expect)(this.returnedItemsCount).toContainText(itemCount.toString() + ' published items returned');
920
+ await this.containsText(this.returnedItemsCount, itemCount.toString() + ' published items returned');
919
921
  }
920
922
  async doesQueryResultHaveContentName(contentName) {
921
- await (0, test_1.expect)(this.queryResults).toContainText(contentName);
922
- }
923
- async deleteGroup(groupName) {
924
- await this.page.waitForTimeout(1000);
925
- const groups = this.page.locator('umb-content-type-design-editor-group').all();
926
- for (const group of await groups) {
927
- if (await group.getByLabel('Group', { exact: true }).inputValue() === groupName) {
928
- const headerActionsDeleteLocator = group.locator('[slot="header-actions"]').getByLabel('Delete');
929
- await (0, test_1.expect)(headerActionsDeleteLocator).toBeVisible();
930
- // Force click is needed
931
- await headerActionsDeleteLocator.click({ force: true });
932
- return;
933
- }
934
- }
923
+ await this.containsText(this.queryResults, contentName);
935
924
  }
936
- async clickRemoveTabWithName(name) {
937
- await (0, test_1.expect)(this.page.locator('uui-tab').filter({ hasText: name })).toBeVisible();
938
- await this.page.locator('uui-tab').filter({ hasText: name }).hover();
939
- const removeTabWithNameLocator = this.page.locator('uui-tab').filter({ hasText: name }).locator('[label="Remove"]');
940
- await (0, test_1.expect)(removeTabWithNameLocator).toBeVisible();
941
- await removeTabWithNameLocator.click();
925
+ // Insert Methods
926
+ async insertDictionaryItem(dictionaryName) {
927
+ await this.clickInsertButton();
928
+ await this.click(this.insertDictionaryItemBtn);
929
+ await this.click(this.page.getByLabel(dictionaryName));
930
+ await this.click(this.chooseBtn);
942
931
  }
943
- async clickLeftArrowButton() {
944
- await (0, test_1.expect)(this.leftArrowBtn).toBeVisible();
945
- await this.leftArrowBtn.click();
932
+ async insertSystemFieldValue(fieldValue) {
933
+ await this.clickInsertButton();
934
+ await this.click(this.insertValueBtn);
935
+ await this.click(this.chooseFieldDropDown);
936
+ await this.click(this.systemFieldsOption);
937
+ await this.click(this.chooseFieldValueDropDown);
938
+ await this.click(this.page.getByText(fieldValue));
939
+ await this.clickSubmitButton();
946
940
  }
947
- async clickToUploadButton() {
948
- await (0, test_1.expect)(this.clickToUploadBtn).toBeVisible();
949
- await this.clickToUploadBtn.click();
941
+ async insertPartialView(partialViewName) {
942
+ await this.clickInsertButton();
943
+ await this.click(this.insertPartialViewBtn);
944
+ await this.click(this.page.getByLabel(partialViewName));
945
+ await this.clickChooseButton();
950
946
  }
951
- async uploadFile(filePath) {
952
- const [fileChooser] = await Promise.all([
953
- this.page.waitForEvent('filechooser'),
954
- await this.clickToUploadButton(),
955
- ]);
956
- await fileChooser.setFiles(filePath);
947
+ // Rename Methods
948
+ async rename(newName) {
949
+ await this.clickRenameActionMenuOption();
950
+ await this.click(this.newNameTxt);
951
+ await this.enterText(this.newNameTxt, newName);
952
+ await this.click(this.renameModalBtn);
953
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
957
954
  }
958
- getTabLocatorWithName(name) {
959
- return this.page.getByRole('tab', { name: name });
955
+ // Search & Filter Methods
956
+ async searchForTypeToFilterValue(searchValue) {
957
+ await this.enterText(this.typeToFilterSearchTxt, searchValue, { clearFirst: false });
960
958
  }
961
- getTextLocatorWithName(name) {
962
- return this.page.getByText(name, { exact: true });
959
+ // Description Methods
960
+ async enterDescription(description) {
961
+ await this.enterText(this.enterDescriptionTxt, description);
963
962
  }
964
- getLocatorWithDataMark(dataMark) {
965
- return this.page.getByTestId(dataMark);
963
+ async doesDescriptionHaveValue(value, index = 0) {
964
+ return await this.hasValue(this.descriptionBtn.nth(index), value);
966
965
  }
967
- ;
968
- async isFailedStateButtonVisible() {
969
- await (0, test_1.expect)(this.failedStateButton).toBeVisible();
966
+ // Drag and Drop Methods
967
+ async dragAndDrop(dragFromSelector, dragToSelector, verticalOffset = 0, horizontalOffset = 0, steps = 5) {
968
+ await this.waitForVisible(dragFromSelector);
969
+ await this.waitForVisible(dragToSelector);
970
+ const targetLocation = await dragToSelector.boundingBox();
971
+ const elementCenterX = targetLocation.x + targetLocation.width / 2;
972
+ const elementCenterY = targetLocation.y + targetLocation.height / 2;
973
+ await this.hover(dragFromSelector);
974
+ await this.page.mouse.move(10, 10);
975
+ await this.hover(dragFromSelector);
976
+ await this.page.mouse.down();
977
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.debounce);
978
+ await this.page.mouse.move(elementCenterX + horizontalOffset, elementCenterY + verticalOffset, { steps: steps });
979
+ await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.debounce);
980
+ await this.page.mouse.up();
970
981
  }
971
- async clickContainerSaveAndPublishButton() {
972
- await (0, test_1.expect)(this.containerSaveAndPublishBtn).toBeVisible();
973
- await this.containerSaveAndPublishBtn.click();
974
- await this.page.waitForTimeout(500);
982
+ // Create Link Methods
983
+ async clickCreateLink() {
984
+ await this.click(this.createLink);
975
985
  }
976
- async clickConfirmTrashButton() {
977
- await (0, test_1.expect)(this.confirmTrashBtn).toBeVisible();
978
- await this.confirmTrashBtn.click();
979
- await this.page.waitForTimeout(500);
986
+ // Recycle Bin Methods
987
+ async clickRecycleBinButton() {
988
+ await this.click(this.recycleBinBtn);
980
989
  }
981
990
  async reloadRecycleBin(containsItems = true) {
982
- await (0, test_1.expect)(this.recycleBinMenuItem).toBeVisible();
983
- // If the Recycle Bin does not contain any items,0 the caret button should not be visible. and we should not try to click it
991
+ await this.waitForVisible(this.recycleBinMenuItem);
984
992
  if (!containsItems) {
985
993
  await this.clickReloadChildrenActionMenuOption();
986
- await (0, test_1.expect)(this.recycleBinMenuItemCaretBtn).not.toBeVisible();
994
+ await this.isVisible(this.recycleBinMenuItemCaretBtn, false);
987
995
  return;
988
996
  }
989
997
  await this.clickActionsMenuForName('Recycle Bin');
990
998
  await this.clickReloadChildrenActionMenuOption();
991
999
  await this.openCaretButtonForName('Recycle Bin');
992
1000
  }
993
- async clickRecycleBinButton() {
994
- await (0, test_1.expect)(this.recycleBinBtn).toBeVisible();
995
- await this.recycleBinBtn.click();
996
- }
997
1001
  async isItemVisibleInRecycleBin(item, isVisible = true, isReload = true) {
998
1002
  if (isReload) {
999
1003
  await this.reloadRecycleBin(isVisible);
1000
1004
  }
1001
- return await (0, test_1.expect)(this.page.locator('[label="Recycle Bin"] [label="' + item + '"]')).toBeVisible({ visible: isVisible });
1005
+ return await this.isVisible(this.page.locator('[label="Recycle Bin"] [label="' + item + '"]'), isVisible);
1002
1006
  }
1007
+ // View Methods
1003
1008
  async changeToGridView() {
1004
- await (0, test_1.expect)(this.viewBundleBtn).toBeVisible();
1005
- await this.viewBundleBtn.click();
1006
- await this.gridBtn.click();
1009
+ await this.click(this.viewBundleBtn);
1010
+ await this.click(this.gridBtn);
1007
1011
  }
1008
1012
  async changeToListView() {
1009
- await (0, test_1.expect)(this.viewBundleBtn).toBeVisible();
1010
- await this.viewBundleBtn.click();
1011
- await this.listBtn.click();
1013
+ await this.click(this.viewBundleBtn);
1014
+ await this.click(this.listBtn);
1012
1015
  }
1013
1016
  async isViewBundleButtonVisible(isVisible = true) {
1014
- return (0, test_1.expect)(this.viewBundleBtn).toBeVisible({ visible: isVisible });
1015
- }
1016
- async doesSuccessNotificationHaveText(text, isVisible = true, deleteNotification = false, timeout = 5000) {
1017
- const response = await (0, test_1.expect)(this.successNotification.filter({ hasText: text })).toBeVisible({
1018
- visible: isVisible,
1019
- timeout: timeout
1020
- });
1021
- if (deleteNotification) {
1022
- await this.successNotification.filter({ hasText: text }).getByLabel('close').click({ force: true });
1023
- }
1024
- return response;
1025
- }
1026
- async doesErrorNotificationHaveText(text, isVisible = true, deleteNotification = false) {
1027
- const response = await (0, test_1.expect)(this.errorNotification.filter({ hasText: text })).toBeVisible({ visible: isVisible });
1028
- if (deleteNotification) {
1029
- await this.errorNotification.filter({ hasText: text }).locator('svg').click();
1030
- }
1031
- return response;
1032
- }
1033
- async isSectionWithNameVisible(sectionName, isVisible = true) {
1034
- await (0, test_1.expect)(this.page.getByRole('tab', { name: sectionName })).toBeVisible({ visible: isVisible });
1017
+ return this.isVisible(this.viewBundleBtn, isVisible);
1035
1018
  }
1019
+ // Media Methods
1036
1020
  async clickMediaWithName(name) {
1037
- await (0, test_1.expect)(this.mediaCardItems.filter({ hasText: name })).toBeVisible();
1038
- await this.mediaCardItems.filter({ hasText: name }).click();
1039
- }
1040
- async clickChooseContentStartNodeButton() {
1041
- await (0, test_1.expect)(this.chooseDocumentInputBtn).toBeVisible();
1042
- await this.chooseDocumentInputBtn.click();
1043
- }
1044
- async clickChooseMediaStartNodeButton() {
1045
- await (0, test_1.expect)(this.chooseMediaInputBtn).toBeVisible();
1046
- await this.chooseMediaInputBtn.click();
1047
- }
1048
- async clickActionButton() {
1049
- await (0, test_1.expect)(this.actionBtn).toBeVisible();
1050
- await this.actionBtn.click();
1051
- }
1052
- async clickReferenceNodeLinkWithName(name) {
1053
- await (0, test_1.expect)(this.page.locator('[name="' + name + '"] a#open-part')).toBeVisible();
1054
- await this.page.locator('[name="' + name + '"] a#open-part').click();
1055
- }
1056
- async clickLinkWithName(name, isExact = false) {
1057
- await (0, test_1.expect)(this.page.getByRole('link', { name: name, exact: isExact })).toBeVisible();
1058
- await this.page.getByRole('link', { name: name, exact: isExact }).click();
1059
- }
1060
- async clickMediaPickerModalSubmitButton() {
1061
- await (0, test_1.expect)(this.mediaPickerModalSubmitBtn).toBeVisible();
1062
- await this.mediaPickerModalSubmitBtn.click();
1021
+ await this.click(this.mediaCardItems.filter({ hasText: name }));
1063
1022
  }
1064
1023
  async selectMediaWithName(mediaName, isForce = false) {
1065
1024
  const mediaLocator = this.mediaCardItems.filter({ hasText: mediaName });
1066
- await (0, test_1.expect)(mediaLocator).toBeVisible();
1025
+ await this.waitForVisible(mediaLocator);
1026
+ // Using direct click with position option (not supported by BasePage.click)
1067
1027
  await mediaLocator.click({ position: { x: 0.5, y: 0.5 }, force: isForce });
1068
1028
  }
1069
1029
  async selectMediaWithTestId(mediaKey) {
1070
1030
  const locator = this.page.getByTestId('media:' + mediaKey);
1071
- await (0, test_1.expect)(locator).toBeVisible();
1031
+ await this.waitForVisible(locator);
1032
+ // Using direct click with position option (not supported by BasePage.click)
1072
1033
  await locator.click({ position: { x: 0.5, y: 0.5 } });
1073
1034
  }
1074
- async clickCreateModalButton() {
1075
- await (0, test_1.expect)(this.createModalBtn).toBeVisible();
1076
- await this.createModalBtn.click();
1035
+ async clickMediaPickerModalSubmitButton() {
1036
+ await this.click(this.mediaPickerModalSubmitBtn);
1077
1037
  }
1078
1038
  async clickMediaCaptionAltTextModalSubmitButton() {
1079
- await (0, test_1.expect)(this.mediaCaptionAltTextModalSubmitBtn).toBeVisible();
1080
- await this.mediaCaptionAltTextModalSubmitBtn.click();
1081
- }
1082
- // Embed Modal
1083
- async enterEmbeddedURL(value) {
1084
- await (0, test_1.expect)(this.embeddedURLTxt).toBeVisible();
1085
- await this.embeddedURLTxt.clear();
1086
- await this.embeddedURLTxt.fill(value);
1039
+ await this.click(this.mediaCaptionAltTextModalSubmitBtn);
1087
1040
  }
1088
- async clickEmbeddedRetrieveButton() {
1089
- await (0, test_1.expect)(this.embeddedRetrieveBtn).toBeVisible();
1090
- await this.embeddedRetrieveBtn.click();
1091
- }
1092
- async clickEmbeddedMediaModalConfirmButton() {
1093
- await (0, test_1.expect)(this.embeddedMediaModalConfirmBtn).toBeVisible();
1094
- await this.embeddedMediaModalConfirmBtn.click();
1041
+ async clickChooseMediaStartNodeButton() {
1042
+ await this.click(this.chooseMediaInputBtn);
1095
1043
  }
1096
- async waitForEmbeddedPreviewVisible() {
1097
- await (0, test_1.expect)(this.embeddedPreview).toBeVisible();
1044
+ async isMediaCardItemWithNameDisabled(itemName) {
1045
+ await this.hasAttribute(this.mediaCardItems.filter({ hasText: itemName }), 'class', 'not-allowed');
1098
1046
  }
1099
- async isSubmitButtonDisabled() {
1100
- await (0, test_1.expect)(this.submitBtn).toBeVisible();
1101
- await (0, test_1.expect)(this.submitBtn).toHaveAttribute('disabled');
1047
+ async isMediaCardItemWithNameVisible(itemName, isVisible = true) {
1048
+ await this.isVisible(this.mediaCardItems.filter({ hasText: itemName }), isVisible);
1102
1049
  }
1103
1050
  async doesMediaHaveThumbnail(mediaId, thumbnailIconName, thumbnailImage) {
1104
1051
  const mediaThumbnailLocator = this.page.getByTestId('media:' + mediaId);
1105
1052
  if (thumbnailIconName === 'image') {
1106
1053
  const regexImageSrc = new RegExp(`^${thumbnailImage}.*`);
1107
- await (0, test_1.expect)(mediaThumbnailLocator.locator('umb-imaging-thumbnail img')).toHaveAttribute('src', regexImageSrc);
1054
+ await this.hasAttribute(mediaThumbnailLocator.locator('umb-imaging-thumbnail img'), 'src', regexImageSrc.toString());
1108
1055
  }
1109
1056
  else {
1110
- await (0, test_1.expect)(mediaThumbnailLocator.locator('umb-imaging-thumbnail umb-icon')).toHaveAttribute('name', thumbnailIconName);
1057
+ await this.hasAttribute(mediaThumbnailLocator.locator('umb-imaging-thumbnail umb-icon'), 'name', thumbnailIconName);
1111
1058
  }
1112
1059
  }
1060
+ async isInputDropzoneVisible(isVisible = true) {
1061
+ await this.isVisible(this.inputDropzone, isVisible);
1062
+ }
1063
+ async isImageCropperFieldVisible(isVisible = true) {
1064
+ await this.isVisible(this.imageCropperField, isVisible);
1065
+ }
1066
+ async isInputUploadFieldVisible(isVisible = true) {
1067
+ await this.isVisible(this.inputUploadField, isVisible);
1068
+ }
1069
+ // Upload Methods
1070
+ async clickToUploadButton() {
1071
+ await this.click(this.clickToUploadBtn);
1072
+ }
1073
+ async uploadFile(filePath) {
1074
+ const [fileChooser] = await Promise.all([
1075
+ this.page.waitForEvent('filechooser'),
1076
+ await this.clickToUploadButton(),
1077
+ ]);
1078
+ await fileChooser.setFiles(filePath);
1079
+ }
1080
+ // Embedded Media Methods
1081
+ async enterEmbeddedURL(value) {
1082
+ await this.enterText(this.embeddedURLTxt, value);
1083
+ }
1084
+ async clickEmbeddedRetrieveButton() {
1085
+ await this.click(this.embeddedRetrieveBtn);
1086
+ }
1087
+ async clickEmbeddedMediaModalConfirmButton() {
1088
+ await this.click(this.embeddedMediaModalConfirmBtn);
1089
+ }
1090
+ async waitForEmbeddedPreviewVisible() {
1091
+ await this.waitForVisible(this.embeddedPreview);
1092
+ }
1093
+ // Document Methods
1094
+ async clickChooseContentStartNodeButton() {
1095
+ await this.click(this.chooseDocumentInputBtn);
1096
+ }
1097
+ // User Methods
1113
1098
  async clickCurrentUserAvatarButton() {
1114
- await (0, test_1.expect)(this.currentUserAvatarBtn).toBeVisible();
1115
- await this.currentUserAvatarBtn.click({ force: true });
1099
+ await this.click(this.currentUserAvatarBtn, { force: true });
1116
1100
  }
1101
+ // Collection Methods
1117
1102
  async clickCreateActionButton() {
1118
- await (0, test_1.expect)(this.createActionBtn).toBeVisible();
1119
- await this.createActionBtn.click();
1103
+ await this.click(this.createActionBtn);
1120
1104
  }
1121
1105
  async clickCreateActionWithOptionName(optionName) {
1122
1106
  await this.clickCreateActionButton();
1123
1107
  const createOptionLocator = this.createActionButtonCollection.locator('[label="' + optionName + '"]');
1124
- await (0, test_1.expect)(createOptionLocator).toBeVisible();
1125
- await createOptionLocator.click();
1108
+ await this.click(createOptionLocator);
1126
1109
  }
1127
1110
  async doesCollectionTreeItemTableRowHaveName(name) {
1128
- await (0, test_1.expect)(this.collectionTreeItemTableRow.first()).toBeVisible();
1129
- await (0, test_1.expect)(this.collectionTreeItemTableRow.locator('[label="' + name + '"]')).toBeVisible();
1111
+ await this.waitForVisible(this.collectionTreeItemTableRow.first());
1112
+ await this.isVisible(this.collectionTreeItemTableRow.locator('[label="' + name + '"]'));
1130
1113
  }
1131
1114
  async doesCollectionTreeItemTableRowHaveIcon(name, icon) {
1132
- await (0, test_1.expect)(this.collectionTreeItemTableRow.first()).toBeVisible();
1133
- await (0, test_1.expect)(this.collectionTreeItemTableRow.filter({ hasText: name }).locator('umb-icon').locator('[name="' + icon + '"]')).toBeVisible();
1115
+ await this.waitForVisible(this.collectionTreeItemTableRow.first());
1116
+ await this.isVisible(this.collectionTreeItemTableRow.filter({ hasText: name }).locator('umb-icon').locator('[name="' + icon + '"]'));
1134
1117
  }
1135
- async clickFolderButton() {
1136
- await (0, test_1.expect)(this.folderBtn).toBeVisible();
1137
- await this.folderBtn.click();
1118
+ // Reference Methods
1119
+ async clickReferenceNodeLinkWithName(name) {
1120
+ await this.click(this.page.locator('[name="' + name + '"] a#open-part'));
1138
1121
  }
1139
1122
  async doesReferenceHeadlineHaveText(text) {
1140
- await (0, test_1.expect)(this.referenceHeadline).toContainText(text);
1123
+ await this.containsText(this.referenceHeadline, text);
1141
1124
  }
1142
1125
  async isReferenceHeadlineVisible(isVisible) {
1143
- await (0, test_1.expect)(this.referenceHeadline).toBeVisible({ visible: isVisible });
1126
+ await this.isVisible(this.referenceHeadline, isVisible);
1144
1127
  }
1145
1128
  async doesReferenceItemsHaveCount(count) {
1146
- await (0, test_1.expect)(this.entityItemRef).toHaveCount(count);
1129
+ await this.hasCount(this.entityItemRef, count);
1147
1130
  }
1148
1131
  async isReferenceItemNameVisible(itemName) {
1149
- await (0, test_1.expect)(this.entityItemRef.locator('uui-ref-node[name="' + itemName + '"]')).toBeVisible();
1132
+ await this.isVisible(this.entityItemRef.locator('uui-ref-node[name="' + itemName + '"]'));
1150
1133
  }
1151
1134
  async doesReferencesContainText(text) {
1152
- await (0, test_1.expect)(this.confirmActionModalEntityReferences).toContainText(text);
1153
- }
1154
- async isValidationMessageVisible(message, isVisible = true) {
1155
- await (0, test_1.expect)(this.validationMessage.filter({ hasText: message })).toBeVisible({ visible: isVisible });
1156
- }
1157
- async isSuccessStateIconVisible() {
1158
- await (0, test_1.expect)(this.successStateIcon).toBeVisible();
1159
- }
1160
- async isPropertyEditorUiWithNameReadOnly(name) {
1161
- const propertyEditorUiLocator = this.page.locator('umb-property-editor-ui-' + name);
1162
- await (0, test_1.expect)(propertyEditorUiLocator).toHaveAttribute('readonly');
1163
- }
1164
- async isPropertyEditorUiWithNameVisible(name, isVisible = true) {
1165
- const propertyEditorUiLocator = this.page.locator('umb-property-editor-ui-' + name);
1166
- await (0, test_1.expect)(propertyEditorUiLocator).toBeVisible({ visible: isVisible });
1135
+ await this.containsText(this.confirmActionModalEntityReferences, text);
1167
1136
  }
1168
- // Entity Action
1137
+ // Entity Action Methods
1169
1138
  async clickEntityActionWithName(name) {
1170
1139
  const regex = new RegExp(`^entity-action:.*${name}$`);
1171
- await this.openEntityAction.getByTestId(regex).filter({ has: this.page.locator(':visible') }).click();
1140
+ await this.click(this.openEntityAction.getByTestId(regex).filter({ has: this.page.locator(':visible') }));
1172
1141
  }
1173
1142
  async clickCreateActionMenuOption() {
1174
1143
  await this.clickEntityActionWithName('Create');
@@ -1230,69 +1199,63 @@ class UiBaseLocators {
1230
1199
  async clickUpdateActionMenuOption() {
1231
1200
  await this.clickEntityActionWithName('Update');
1232
1201
  }
1233
- async clickModalMenuItemWithName(name) {
1234
- await (0, test_1.expect)(this.openedModal.locator('uui-menu-item[label="' + name + '"]')).toBeVisible();
1235
- await this.openedModal.locator('uui-menu-item[label="' + name + '"]').click();
1236
- }
1237
- async isModalMenuItemWithNameDisabled(name) {
1238
- await (0, test_1.expect)(this.sidebarModal.locator('uui-menu-item[label="' + name + '"]')).toHaveAttribute('disabled');
1239
- }
1240
- async doesPropertyHaveInvalidBadge(propertyName) {
1241
- await (0, test_1.expect)(this.page.locator('umb-property-layout').filter({ hasText: propertyName }).locator('#invalid-badge uui-badge')).toBeVisible();
1242
- }
1243
- async isModalMenuItemWithNameVisible(name, isVisible = true) {
1244
- await (0, test_1.expect)(this.sidebarModal.locator('uui-menu-item[label="' + name + '"]')).toBeVisible({ visible: isVisible });
1202
+ async clickLockActionMenuOption() {
1203
+ await this.clickEntityActionWithName('Lock');
1245
1204
  }
1205
+ // Entity Item Methods
1246
1206
  async clickEntityItemByName(itemName) {
1247
- await (0, test_1.expect)(this.page.locator('uui-ref-node,umb-ref-item[name="' + itemName + '"]')).toBeVisible();
1248
- await this.page.locator('uui-ref-node,umb-ref-item[name="' + itemName + '"]').click();
1249
- }
1250
- async isMediaCardItemWithNameDisabled(itemName) {
1251
- await (0, test_1.expect)(this.mediaCardItems.filter({ hasText: itemName })).toHaveAttribute('class', 'not-allowed');
1252
- }
1253
- async isMediaCardItemWithNameVisible(itemName, isVisible = true) {
1254
- await (0, test_1.expect)(this.mediaCardItems.filter({ hasText: itemName })).toBeVisible({ visible: isVisible });
1207
+ await this.click(this.page.locator('uui-ref-node,umb-ref-item[name="' + itemName + '"]'));
1255
1208
  }
1209
+ // Workspace Action Methods
1256
1210
  async clickWorkspaceActionMenuButton() {
1257
- await (0, test_1.expect)(this.workspaceActionMenuBtn).toBeVisible();
1258
- await this.workspaceActionMenuBtn.click();
1259
- }
1260
- async clickLockActionMenuOption() {
1261
- await this.clickEntityActionWithName('Lock');
1211
+ await this.click(this.workspaceActionMenuBtn);
1262
1212
  }
1263
- async isDashboardTabWithNameVisible(name, isVisible = true) {
1264
- await (0, test_1.expect)(this.page.locator('uui-tab[label="' + name + '"]')).toBeVisible({ visible: isVisible });
1213
+ // Pagination Methods
1214
+ async clickNextPaginationButton() {
1215
+ await this.click(this.nextPaginationBtn);
1265
1216
  }
1217
+ // Editor Methods
1266
1218
  async enterMonacoEditorValue(value) {
1267
- await (0, test_1.expect)(this.monacoEditor).toBeVisible();
1268
- await this.monacoEditor.click();
1269
- await this.page.keyboard.press('Control+A');
1270
- await this.page.keyboard.press('Backspace');
1219
+ await this.click(this.monacoEditor);
1220
+ await this.pressKey(this.monacoEditor, 'Control+A');
1221
+ await this.pressKey(this.monacoEditor, 'Backspace');
1271
1222
  await this.page.keyboard.insertText(value);
1272
1223
  }
1224
+ // Loader Methods
1273
1225
  async waitUntilUiLoaderIsNoLongerVisible() {
1274
- await (0, test_1.expect)(this.uiLoader).toBeVisible({ visible: false, timeout: 10000 });
1226
+ await this.waitForHidden(this.uiLoader, 10000);
1227
+ }
1228
+ // Dashboard Methods
1229
+ async isDashboardTabWithNameVisible(name, isVisible = true) {
1230
+ await this.isVisible(this.page.locator('uui-tab[label="' + name + '"]'), isVisible);
1275
1231
  }
1276
1232
  async isWorkspaceViewTabWithAliasVisible(alias, isVisible = true) {
1277
- await (0, test_1.expect)(this.page.getByTestId('workspace:view-link:' + alias)).toBeVisible({ visible: isVisible });
1233
+ await this.isVisible(this.page.getByTestId('workspace:view-link:' + alias), isVisible);
1278
1234
  }
1279
- async clickRestoreButton() {
1280
- await (0, test_1.expect)(this.restoreBtn).toBeVisible();
1281
- await this.restoreBtn.click();
1235
+ // Submit Button Methods
1236
+ async isSubmitButtonDisabled() {
1237
+ await this.isVisible(this.submitBtn);
1238
+ await this.isDisabled(this.submitBtn);
1282
1239
  }
1283
- async isInputDropzoneVisible(isVisible = true) {
1284
- await (0, test_1.expect)(this.inputDropzone).toBeVisible({ visible: isVisible });
1240
+ // Data Element Methods
1241
+ async clickDataElement(elementName, options = null) {
1242
+ await this.click(this.page.locator(`[data-element="${elementName}"]`), options);
1285
1243
  }
1286
- async isImageCropperFieldVisible(isVisible = true) {
1287
- await (0, test_1.expect)(this.imageCropperField).toBeVisible({ visible: isVisible });
1244
+ async getDataElement(elementName) {
1245
+ return this.page.locator(`[data-element="${elementName}"]`);
1288
1246
  }
1289
- async isInputUploadFieldVisible(isVisible = true) {
1290
- await (0, test_1.expect)(this.inputUploadField).toBeVisible({ visible: isVisible });
1247
+ getLocatorWithDataMark(dataMark) {
1248
+ return this.page.getByTestId(dataMark);
1291
1249
  }
1292
- async isBackOfficeMainVisible(isVisible = true) {
1293
- // We need to wait to make sure the page has loaded
1294
- await this.page.waitForTimeout(1000);
1295
- await (0, test_1.expect)(this.backOfficeMain).toBeVisible({ visible: isVisible });
1250
+ // Text Visibility Methods
1251
+ async isTextWithExactNameVisible(name, isVisible = true) {
1252
+ return (0, test_1.expect)(this.page.getByText(name, { exact: true })).toBeVisible({ visible: isVisible });
1253
+ }
1254
+ async isTextWithMessageVisible(message, isVisible = true) {
1255
+ return await (0, test_1.expect)(this.page.getByText(message)).toBeVisible({ visible: isVisible });
1256
+ }
1257
+ getTextLocatorWithName(name) {
1258
+ return this.page.getByText(name, { exact: true });
1296
1259
  }
1297
1260
  }
1298
1261
  exports.UiBaseLocators = UiBaseLocators;