@umbraco/playwright-testhelpers 17.1.0-beta.5 → 17.1.0-beta.7

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