@umbraco/playwright-testhelpers 17.1.0-beta.6 → 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 -834
  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,567 +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
- await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.medium);
407
- const menuItemFirstLocator = menuItem.locator('#menu-item').first();
408
- const actionModalLocator = menuItem.locator('#action-modal').first();
409
- await this.hover(menuItemFirstLocator, { force: true });
410
- await this.click(actionModalLocator, { force: true });
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 });
411
344
  }
412
345
  async isActionsMenuForNameVisible(name, isVisible = true) {
413
- const menuItem = this.getMenuItemByLabel(name);
414
- await this.click(menuItem);
415
- 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 });
416
348
  }
417
- // Caret Button Methods
418
349
  async clickCaretButtonForName(name) {
419
350
  await this.isCaretButtonWithNameVisible(name);
420
- 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();
421
352
  }
422
353
  async isCaretButtonWithNameVisible(name, isVisible = true) {
423
- const caretButton = this.getMenuItemByLabel(name).locator('#caret-button').first();
424
- 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 });
425
355
  }
426
356
  async clickCaretButton() {
427
- await this.click(this.caretBtn);
357
+ await this.page.locator('#caret-button').click();
428
358
  }
429
359
  async openCaretButtonForName(name, isInModal = false) {
430
360
  let menuItem;
431
361
  if (isInModal) {
432
- menuItem = this.sidebarModal.locator(`uui-menu-item[label="${name}"]`);
362
+ menuItem = this.sidebarModal.locator('uui-menu-item[label="' + name + '"]');
433
363
  }
434
364
  else {
435
- menuItem = this.getMenuItemByLabel(name);
365
+ menuItem = this.page.locator('uui-menu-item[label="' + name + '"]');
436
366
  }
437
- await this.waitForVisible(menuItem, ConstantHelper_1.ConstantHelper.timeout.long);
438
367
  const isCaretButtonOpen = await menuItem.getAttribute('show-children');
439
368
  if (isCaretButtonOpen === null) {
440
369
  await this.clickCaretButtonForName(name);
441
370
  }
442
371
  }
443
- // Tree Methods
444
372
  async reloadTree(treeName) {
445
- await this.isVisible(this.page.getByLabel(treeName, { exact: true }));
446
- 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);
447
376
  await this.clickActionsMenuForName(treeName);
448
377
  await this.clickReloadChildrenActionMenuOption();
449
378
  await this.openCaretButtonForName(treeName);
450
379
  }
451
- async isTreeItemVisible(name, isVisible = true) {
452
- await this.isVisible(this.treeItem.locator('[label="' + name + '"]'), isVisible);
453
- }
454
- async doesTreeItemHaveTheCorrectIcon(name, icon) {
455
- return await this.isVisible(this.treeItem.filter({ hasText: name }).locator('umb-icon').locator('[name="' + icon + '"]'));
456
- }
457
- // Core Button Click Methods
458
380
  async clickReloadButton() {
459
- await this.click(this.reloadBtn);
381
+ await (0, test_1.expect)(this.reloadBtn).toBeVisible();
382
+ await this.reloadBtn.click();
460
383
  }
461
384
  async clickReloadChildrenButton() {
462
- 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 });
463
393
  }
464
394
  async clickSaveButton() {
465
- await this.click(this.saveBtn);
466
- 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);
467
398
  }
468
399
  async clickChooseButton() {
469
- await this.click(this.chooseBtn);
400
+ await (0, test_1.expect)(this.chooseBtn).toBeVisible();
401
+ await this.chooseBtn.click();
470
402
  }
471
403
  async clickChooseContainerButton() {
472
- await this.click(this.containerChooseBtn);
404
+ await this.containerChooseBtn.click();
473
405
  }
474
- async clickSubmitButton() {
475
- await this.click(this.submitBtn);
406
+ async clickFilterChooseButton() {
407
+ await this.filterChooseBtn.click();
476
408
  }
477
- async clickConfirmButton() {
478
- await this.click(this.confirmBtn);
409
+ async clickRenameFolderThreeDotsButton() {
410
+ await this.renameFolderThreeDotsBtn.click();
479
411
  }
480
- async clickCreateButton() {
481
- await this.click(this.createBtn);
412
+ async clickRenameFolderButton() {
413
+ await this.clickRenameButton();
482
414
  }
483
- async clickAddButton() {
484
- await this.click(this.addBtn);
415
+ async clickConfirmRenameButton() {
416
+ await this.confirmRenameBtn.click();
417
+ }
418
+ async clickUpdateFolderButton() {
419
+ await this.updateFolderBtn.click();
485
420
  }
486
421
  async clickUpdateButton() {
487
- await this.click(this.updateBtn);
422
+ await this.updateBtn.click();
488
423
  }
489
- async clickChangeButton() {
490
- await this.click(this.changeBtn);
424
+ async clickSubmitButton() {
425
+ await (0, test_1.expect)(this.submitBtn).toBeVisible();
426
+ await this.submitBtn.click();
491
427
  }
492
- async clickDeleteButton() {
493
- await this.click(this.deleteBtn);
428
+ async clickConfirmToSubmitButton() {
429
+ await this.confirmToSubmitBtn.click();
494
430
  }
495
- async clickDeleteExactButton() {
496
- await this.click(this.deleteExactBtn);
431
+ async clickChangeButton() {
432
+ await this.changeBtn.click();
497
433
  }
498
- async clickRemoveExactButton() {
499
- 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 });
500
438
  }
501
- async clickInsertButton() {
502
- 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);
503
446
  }
504
- async clickRenameButton() {
505
- 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();
506
454
  }
507
- async clickRestoreButton() {
508
- 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();
509
458
  }
510
- async clickDisableButton() {
511
- await this.click(this.disableBtn);
459
+ async clickSelectPropertyEditorButton() {
460
+ await (0, test_1.expect)(this.selectPropertyEditorBtn).toBeVisible();
461
+ await this.selectPropertyEditorBtn.click();
512
462
  }
513
- async clickEnableButton() {
514
- 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
515
467
  }
516
- async clickActionButton() {
517
- 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();
518
475
  }
519
476
  async clickNextButton() {
520
- 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();
521
483
  }
522
484
  async clickBreadcrumbButton() {
523
- await this.click(this.breadcrumbBtn);
485
+ await (0, test_1.expect)(this.breadcrumbBtn).toBeVisible();
486
+ await this.breadcrumbBtn.click();
524
487
  }
525
- async clickLeftArrowButton() {
526
- await this.click(this.leftArrowBtn);
488
+ async clickInsertButton() {
489
+ await (0, test_1.expect)(this.insertBtn).toBeVisible();
490
+ await this.insertBtn.click();
527
491
  }
528
- // Confirmation Button Methods
529
492
  async clickConfirmToDeleteButton() {
530
- await this.click(this.confirmToDeleteBtn);
531
- 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
532
496
  }
533
497
  async clickConfirmCreateFolderButton() {
534
- await this.click(this.confirmCreateFolderBtn);
535
- 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
536
501
  }
537
- async clickConfirmRemoveButton() {
538
- await this.click(this.confirmToRemoveBtn);
502
+ async clickRemoveExactButton() {
503
+ await (0, test_1.expect)(this.removeExactBtn).toBeVisible();
504
+ await this.removeExactBtn.click();
539
505
  }
540
- async clickConfirmToSubmitButton() {
541
- 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();
542
524
  }
543
525
  async clickConfirmDisableButton() {
544
- await this.click(this.confirmDisableBtn);
526
+ await (0, test_1.expect)(this.confirmDisableBtn).toBeVisible();
527
+ await this.confirmDisableBtn.click();
545
528
  }
546
- async clickConfirmEnableButton() {
547
- await this.click(this.confirmEnableBtn);
529
+ async clickConfirmRemoveButton() {
530
+ await (0, test_1.expect)(this.confirmToRemoveBtn).toBeVisible();
531
+ await this.confirmToRemoveBtn.click();
548
532
  }
549
- async clickConfirmRenameButton() {
550
- await this.click(this.confirmRenameBtn);
533
+ async clickEnableButton() {
534
+ await (0, test_1.expect)(this.enableBtn).toBeVisible();
535
+ await this.enableBtn.click();
551
536
  }
552
- async clickConfirmTrashButton() {
553
- await this.click(this.confirmTrashBtn);
554
- 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();
555
540
  }
556
- async clickDeleteAndConfirmButton() {
557
- await this.clickDeleteActionMenuOption();
558
- 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();
559
549
  }
560
- // Folder Methods
561
- async clickCreateFolderButton() {
562
- await this.click(this.createFolderBtn);
563
- 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
+ }
564
564
  }
565
- async enterFolderName(folderName) {
566
- 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();
567
586
  }
568
587
  async createFolder(folderName) {
569
588
  await this.clickCreateActionMenuOption();
@@ -571,574 +590,586 @@ class UiBaseLocators extends BasePage_1.BasePage {
571
590
  await this.enterFolderName(folderName);
572
591
  await this.clickConfirmCreateFolderButton();
573
592
  }
574
- async deleteFolder() {
575
- await this.clickDeleteActionMenuOption();
576
- await this.clickConfirmToDeleteButton();
577
- }
578
- async clickFolderButton() {
579
- await this.click(this.folderBtn);
580
- }
581
- async clickNewFolderThreeDotsButton() {
582
- await this.click(this.newFolderThreeDotsBtn);
583
- }
584
- async clickRenameFolderThreeDotsButton() {
585
- await this.click(this.renameFolderThreeDotsBtn);
586
- }
587
- async clickRenameFolderButton() {
588
- await this.clickRenameButton();
589
- }
590
- async clickUpdateFolderButton() {
591
- await this.click(this.updateFolderBtn);
592
- }
593
- // Three Dots Menu Methods
594
- async clickCreateThreeDotsButton() {
595
- await this.click(this.createThreeDotsBtn);
596
- }
597
- async clickFilterChooseButton() {
598
- await this.click(this.filterChooseBtn);
599
- }
600
- // Success State Methods
601
- async isSuccessStateVisibleForSaveButton(isVisible = true) {
602
- const regex = new RegExp(`^workspace-action:.*Save$`);
603
- const saveButtonLocator = this.page.getByTestId(regex);
604
- const saveBtn = this.workspaceAction.filter({ has: saveButtonLocator });
605
- await this.isVisible(saveBtn.locator(this.successState), isVisible, ConstantHelper_1.ConstantHelper.timeout.long);
606
- }
607
- async isSuccessButtonWithTextVisible(text) {
608
- return await this.isVisible(this.successState.filter({ hasText: text }));
609
- }
610
- async isSuccessStateIconVisible() {
611
- await this.isVisible(this.successStateIcon);
612
- }
613
- async isFailedStateButtonVisible() {
614
- await this.isVisible(this.failedStateButton);
615
- }
616
- // Notification Methods
617
- async isSuccessNotificationVisible(isVisible = true) {
618
- return await this.isVisible(this.successNotification.first(), isVisible, ConstantHelper_1.ConstantHelper.timeout.long);
619
- }
620
- async doesSuccessNotificationsHaveCount(count) {
621
- await this.hasCount(this.successNotification, count);
622
- }
623
- async doesSuccessNotificationHaveText(text, isVisible = true, deleteNotification = false, timeout = 5000) {
624
- const response = await this.isVisible(this.successNotification.filter({ hasText: text }), isVisible, timeout);
625
- if (deleteNotification) {
626
- await this.click(this.successNotification.filter({ hasText: text }).getByLabel('close'), { force: true });
627
- }
628
- return response;
629
- }
630
- async isErrorNotificationVisible(isVisible = true) {
631
- 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();
632
597
  }
633
- async doesErrorNotificationHaveText(text, isVisible = true, deleteNotification = false) {
634
- const response = await this.isVisible(this.errorNotification.filter({ hasText: text }), isVisible);
635
- if (deleteNotification) {
636
- await this.click(this.errorNotification.filter({ hasText: text }).locator('svg'));
637
- }
638
- 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);
639
603
  }
640
- // Modal Methods
641
- async clickChooseModalButton() {
642
- 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 });
643
606
  }
644
- async clickCreateModalButton() {
645
- 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 });
646
611
  }
647
- async clickModalMenuItemWithName(name) {
648
- 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();
649
615
  }
650
- async isModalMenuItemWithNameDisabled(name) {
651
- 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();
652
619
  }
653
- async isModalMenuItemWithNameVisible(name, isVisible = true) {
654
- 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 });
655
622
  }
656
- // Container Methods
657
- async clickContainerSaveAndPublishButton() {
658
- await this.click(this.containerSaveAndPublishBtn);
659
- 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();
660
625
  }
661
- // Navigation Methods
662
626
  async goToSection(sectionName, checkSections = true, skipReload = false) {
663
627
  if (checkSections) {
664
628
  for (let section in ConstantHelper_1.ConstantHelper.sections) {
665
- 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 });
666
630
  }
667
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
668
633
  const alreadySelected = await this.sectionLinks.locator('[active]').getByText(sectionName).isVisible();
669
634
  if (alreadySelected && !skipReload) {
670
635
  await this.page.reload();
671
636
  }
672
637
  else {
673
- await this.click(this.backOfficeHeader.getByRole('tab', { name: sectionName }));
638
+ await this.backOfficeHeader.getByRole('tab', { name: sectionName }).click();
674
639
  }
675
640
  }
676
641
  async goToSettingsTreeItem(settingsTreeItemName) {
677
642
  await this.goToSection(ConstantHelper_1.ConstantHelper.sections.settings);
678
- await this.click(this.page.getByLabel(settingsTreeItemName, { exact: true }));
679
- }
680
- async isSectionWithNameVisible(sectionName, isVisible = true) {
681
- 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();
682
645
  }
683
- async isBackOfficeMainVisible(isVisible = true) {
684
- await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.timeout.medium);
685
- await this.isVisible(this.backOfficeMain, isVisible);
646
+ async clickDataElement(elementName, options = null) {
647
+ await this.page.click(`[data-element="${elementName}"]`, options);
686
648
  }
687
- // Link & Button Click by Name Methods
688
- async clickExactLinkWithName(name, toForce = false) {
689
- const exactLinkWithNameLocator = this.page.getByRole('link', { name: name, exact: true });
690
- await this.click(exactLinkWithNameLocator, { force: toForce });
649
+ async getDataElement(elementName) {
650
+ return this.page.locator(`[data-element="${elementName}"]`);
691
651
  }
692
- async clickLinkWithName(name, isExact = false) {
693
- 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();
694
654
  }
695
655
  async clickLabelWithName(name, isExact = true, toForce = false) {
696
- 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 });
697
658
  }
698
659
  async clickButtonWithName(name, isExact = false) {
699
660
  const exactButtonWithNameLocator = this.page.getByRole('button', { name: name, exact: isExact });
700
- await this.click(exactButtonWithNameLocator, { force: true });
701
- }
702
- async clickTextButtonWithName(name) {
703
- await this.click(this.page.getByText(name, { exact: true }));
704
- }
705
- async isButtonWithNameVisible(name) {
706
- 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 });
707
664
  }
708
- async getButtonWithName(name) {
709
- await this.waitForVisible(this.page.getByRole('button', { name: name }));
710
- 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 });
711
667
  }
712
- // Remove Button Methods
713
- async clickRemoveButtonForName(name) {
714
- const removeButtonWithNameLocator = this.page.locator('[name="' + name + '"] [label="Remove"]');
715
- await this.click(removeButtonWithNameLocator);
668
+ async doesSuccessNotificationsHaveCount(count) {
669
+ return await (0, test_1.expect)(this.successNotification).toHaveCount(count);
716
670
  }
717
- async clickTrashIconButtonForName(name) {
718
- const trashIconButtonWithNameLocator = this.page.locator('[name="' + name + '"] [name="icon-trash"]');
719
- await this.click(trashIconButtonWithNameLocator);
671
+ async isErrorNotificationVisible(isVisible = true) {
672
+ return await (0, test_1.expect)(this.errorNotification.first()).toBeVisible({ visible: isVisible });
720
673
  }
721
- async clickRemoveWithName(name) {
722
- const removeLabelWithNameLocator = this.page.locator('[label="Remove ' + name + '"]');
723
- await this.click(removeLabelWithNameLocator);
674
+ async isTextWithMessageVisible(message, isVisible = true) {
675
+ return await (0, test_1.expect)(this.page.getByText(message)).toBeVisible({ visible: isVisible });
724
676
  }
725
- // Alias & Icon Methods
726
- async enterAliasName(aliasName) {
727
- await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
728
- await this.click(this.aliasLockBtn, { force: true });
729
- await this.enterText(this.aliasNameTxt, aliasName);
677
+ async clickCreateThreeDotsButton() {
678
+ await (0, test_1.expect)(this.createThreeDotsBtn).toBeVisible();
679
+ await this.createThreeDotsBtn.click();
730
680
  }
731
- async updateIcon(iconName) {
732
- await this.click(this.iconBtn, { force: true });
733
- await this.searchForTypeToFilterValue(iconName);
734
- await this.clickLabelWithName(iconName, true, true);
735
- await this.clickSubmitButton();
681
+ async clickCreateButton() {
682
+ await (0, test_1.expect)(this.createBtn).toBeVisible();
683
+ await this.createBtn.click();
736
684
  }
737
- // Property Editor Methods
738
- async clickSelectPropertyEditorButton() {
739
- await this.click(this.selectPropertyEditorBtn);
685
+ async clickAddButton() {
686
+ await (0, test_1.expect)(this.addBtn).toBeVisible();
687
+ await this.addBtn.click();
740
688
  }
741
- async enterAPropertyName(name) {
742
- 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();
743
693
  }
744
694
  async clickEditorSettingsButton(index = 0) {
745
- await this.click(this.editorSettingsBtn.nth(index));
746
- }
747
- async addPropertyEditor(propertyEditorName, index = 0) {
748
- await this.click(this.addPropertyBtn.nth(index));
749
- await this.enterAPropertyName(propertyEditorName);
750
- await this.hasValue(this.propertyNameTxt, propertyEditorName);
751
- await this.clickSelectPropertyEditorButton();
752
- await this.searchForTypeToFilterValue(propertyEditorName);
753
- await this.click(this.page.getByText(propertyEditorName, { exact: true }));
754
- await this.clickSubmitButton();
755
- }
756
- async updatePropertyEditor(propertyEditorName) {
757
- await this.clickEditorSettingsButton();
758
- await this.clickChangeButton();
759
- await this.searchForTypeToFilterValue(propertyEditorName);
760
- await this.click(this.page.getByText(propertyEditorName, { exact: true }));
761
- await this.enterAPropertyName(propertyEditorName);
762
- await this.clickSubmitButton();
763
- }
764
- async deletePropertyEditor(propertyEditorName) {
765
- await this.page.locator('uui-button').filter({ hasText: propertyEditorName }).getByLabel('Editor settings').hover();
766
- await this.click(this.deleteBtn);
767
- }
768
- async deletePropertyEditorWithName(name) {
769
- const propertyEditor = this.page.locator('umb-content-type-design-editor-property', { hasText: name });
770
- await this.hoverAndClick(propertyEditor, propertyEditor.getByLabel('Delete'), { force: true });
771
- await this.clickConfirmToDeleteButton();
695
+ await (0, test_1.expect)(this.editorSettingsBtn.nth(index)).toBeVisible();
696
+ return this.editorSettingsBtn.nth(index).click();
772
697
  }
773
- async enterPropertyEditorDescription(description) {
774
- 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);
775
702
  }
776
- async isPropertyEditorUiWithNameReadOnly(name) {
777
- const propertyEditorUiLocator = this.page.locator('umb-property-editor-ui-' + name);
778
- await this.hasAttribute(propertyEditorUiLocator, 'readonly', '');
703
+ async doesDescriptionHaveValue(value, index = 0) {
704
+ return await (0, test_1.expect)(this.descriptionBtn.nth(index)).toHaveValue(value);
779
705
  }
780
- async isPropertyEditorUiWithNameVisible(name, isVisible = true) {
781
- const propertyEditorUiLocator = this.page.locator('umb-property-editor-ui-' + name);
782
- 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();
783
710
  }
784
- async doesPropertyHaveInvalidBadge(propertyName) {
785
- 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();
786
714
  }
787
- // Group Methods
788
- async clickAddGroupButton() {
789
- await this.click(this.addGroupBtn);
715
+ async clickIAmDoneReorderingButton() {
716
+ await (0, test_1.expect)(this.iAmDoneReorderingBtn).toBeVisible();
717
+ await this.iAmDoneReorderingBtn.click();
790
718
  }
791
- async enterGroupName(groupName, index = 0) {
792
- const groupNameTxt = this.groupLabel.nth(index);
793
- await this.enterText(groupNameTxt, groupName);
719
+ async clickReorderButton() {
720
+ await (0, test_1.expect)(this.reorderBtn).toBeVisible();
721
+ await this.reorderBtn.click();
794
722
  }
795
- async isGroupVisible(groupName, isVisible = true) {
796
- 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();
797
726
  }
798
- async doesGroupHaveValue(value) {
799
- await this.waitForVisible(this.groupLabel);
800
- return await this.hasValue(this.groupLabel, value);
727
+ async clickMandatoryToggle() {
728
+ await (0, test_1.expect)(this.mandatoryToggle).toBeVisible();
729
+ await this.mandatoryToggle.click();
801
730
  }
802
- async deleteGroup(groupName) {
803
- await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.medium);
804
- const groups = this.page.locator('umb-content-type-design-editor-group').all();
805
- for (const group of await groups) {
806
- if (await group.getByLabel('Group', { exact: true }).inputValue() === groupName) {
807
- const headerActionsDeleteLocator = group.locator('[slot="header-actions"]').getByLabel('Delete');
808
- await this.click(headerActionsDeleteLocator, { force: true });
809
- return;
810
- }
811
- }
731
+ async selectValidationOption(option) {
732
+ await (0, test_1.expect)(this.validation).toBeVisible();
733
+ await this.validation.selectOption(option);
812
734
  }
813
- async reorderTwoGroups(firstGroupName, secondGroupName) {
814
- const firstGroup = this.page.getByTestId('group:' + firstGroupName);
815
- const secondGroup = this.page.getByTestId('group:' + secondGroupName);
816
- const firstGroupValue = await firstGroup.getByLabel('Group').inputValue();
817
- const secondGroupValue = await secondGroup.getByLabel('Group').inputValue();
818
- const dragToLocator = firstGroup.locator('[slot="header"]').first();
819
- const dragFromLocator = secondGroup.locator('[slot="header"]').first();
820
- await this.dragAndDrop(dragFromLocator, dragToLocator, 0, 0, 20);
821
- 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();
822
746
  }
823
- // Tab Methods
824
747
  async clickAddTabButton() {
825
- await this.click(this.addTabBtn);
748
+ await (0, test_1.expect)(this.addTabBtn).toBeVisible();
749
+ await this.addTabBtn.click();
826
750
  }
827
751
  async enterTabName(tabName) {
828
- await this.waitForVisible(this.unnamedTabTxt);
829
- await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.debounce);
830
- await this.enterText(this.unnamedTabTxt, tabName);
831
- await this.click(this.page.getByRole('tab', { name: 'Design' }));
832
- 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();
833
760
  }
834
- async clickRemoveTabWithName(name) {
835
- const tab = this.page.locator('uui-tab').filter({ hasText: name });
836
- 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);
837
764
  }
838
- async clickStructureTab() {
839
- await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.medium);
840
- 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();
841
774
  }
842
- getTabLocatorWithName(name) {
843
- 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();
844
782
  }
845
- // Validation Methods
846
- async clickMandatoryToggle() {
847
- 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);
848
787
  }
849
- async selectValidationOption(option) {
850
- await this.selectByValue(this.validation, option);
788
+ async clickAddGroupButton() {
789
+ await (0, test_1.expect)(this.addGroupBtn).toBeVisible();
790
+ await this.addGroupBtn.click();
851
791
  }
852
- async enterRegEx(regEx) {
853
- 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();
854
795
  }
855
- async enterRegExMessage(regExMessage) {
856
- 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);
857
801
  }
858
- async isValidationMessageVisible(message, isVisible = true) {
859
- 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 });
860
804
  }
861
- // Composition & Structure Methods
862
- async clickCompositionsButton() {
863
- 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);
864
808
  }
865
- async clickAllowAtRootButton() {
866
- 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);
867
817
  }
868
- async clickAllowedChildNodesButton() {
869
- 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();
870
820
  }
871
- async clickAddCollectionButton() {
872
- 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();
873
835
  }
874
- // Reorder Methods
875
- async clickIAmDoneReorderingButton() {
876
- 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 });
877
839
  }
878
- async clickReorderButton() {
879
- await this.click(this.reorderBtn);
840
+ async clickCreateLink() {
841
+ await (0, test_1.expect)(this.createLink).toBeVisible();
842
+ await this.createLink.click();
880
843
  }
881
- async clickLabelAboveButton() {
882
- 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();
883
857
  }
884
- // Query Builder Methods
885
- async clickQueryBuilderButton() {
886
- await this.click(this.queryBuilderBtn);
887
- 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();
888
865
  }
889
- async addQueryBuilderWithOrderByStatement(propertyAlias, isAscending) {
890
- await this.click(this.queryBuilderBtn, { timeout: ConstantHelper_1.ConstantHelper.timeout.long });
891
- await this.click(this.orderByPropertyAliasBtn);
892
- await this.waitAndSelectQueryBuilderDropDownList(propertyAlias);
893
- await this.click(this.orderByPropertyAliasBtn);
894
- if (!isAscending) {
895
- await this.click(this.ascendingBtn);
896
- }
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();
897
875
  }
898
- async addQueryBuilderWithWhereStatement(propertyAlias, operator, constrainValue) {
899
- await this.click(this.queryBuilderBtn, { timeout: ConstantHelper_1.ConstantHelper.timeout.long });
900
- await this.click(this.wherePropertyAliasBtn);
901
- await this.waitAndSelectQueryBuilderDropDownList(propertyAlias);
902
- await this.click(this.whereOperatorBtn);
903
- await this.waitAndSelectQueryBuilderDropDownList(operator);
904
- await this.enterText(this.whereConstrainValueTxt, constrainValue);
905
- await this.pressKey(this.whereConstrainValueTxt, 'Enter');
876
+ async clickRenameButton() {
877
+ await (0, test_1.expect)(this.renameBtn).toBeVisible();
878
+ await this.renameBtn.click();
906
879
  }
907
- async waitAndSelectQueryBuilderDropDownList(option) {
908
- const ddlOption = this.page.locator('[open]').locator('uui-combobox-list-option').filter({ hasText: option }).first();
909
- 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);
910
892
  }
911
893
  async chooseRootContentInQueryBuilder(contentName) {
912
- await this.click(this.chooseRootContentBtn);
894
+ await (0, test_1.expect)(this.chooseRootContentBtn).toBeVisible();
895
+ await this.chooseRootContentBtn.click();
913
896
  await this.clickModalMenuItemWithName(contentName);
914
897
  await this.clickChooseButton();
915
898
  }
916
- async isQueryBuilderCodeShown(code) {
917
- await this.click(this.queryBuilderShowCode);
918
- 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();
919
916
  }
920
917
  async doesReturnedItemsHaveCount(itemCount) {
921
- await this.containsText(this.returnedItemsCount, itemCount.toString() + ' published items returned');
918
+ await (0, test_1.expect)(this.returnedItemsCount).toContainText(itemCount.toString() + ' published items returned');
922
919
  }
923
920
  async doesQueryResultHaveContentName(contentName) {
924
- await this.containsText(this.queryResults, contentName);
921
+ await (0, test_1.expect)(this.queryResults).toContainText(contentName);
925
922
  }
926
- // Insert Methods
927
- async insertDictionaryItem(dictionaryName) {
928
- await this.clickInsertButton();
929
- await this.click(this.insertDictionaryItemBtn);
930
- await this.click(this.page.getByLabel(dictionaryName));
931
- 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
+ }
932
935
  }
933
- async insertSystemFieldValue(fieldValue) {
934
- await this.clickInsertButton();
935
- await this.click(this.insertValueBtn);
936
- await this.click(this.chooseFieldDropDown);
937
- await this.click(this.systemFieldsOption);
938
- await this.click(this.chooseFieldValueDropDown);
939
- await this.click(this.page.getByText(fieldValue));
940
- 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();
941
942
  }
942
- async insertPartialView(partialViewName) {
943
- await this.clickInsertButton();
944
- await this.click(this.insertPartialViewBtn);
945
- await this.click(this.page.getByLabel(partialViewName));
946
- await this.clickChooseButton();
943
+ async clickLeftArrowButton() {
944
+ await (0, test_1.expect)(this.leftArrowBtn).toBeVisible();
945
+ await this.leftArrowBtn.click();
947
946
  }
948
- // Rename Methods
949
- async rename(newName) {
950
- await this.clickRenameActionMenuOption();
951
- await this.click(this.newNameTxt);
952
- await this.enterText(this.newNameTxt, newName);
953
- await this.click(this.renameModalBtn);
954
- 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();
955
950
  }
956
- // Search & Filter Methods
957
- async searchForTypeToFilterValue(searchValue) {
958
- 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);
959
957
  }
960
- // Description Methods
961
- async enterDescription(description) {
962
- await this.enterText(this.enterDescriptionTxt, description);
958
+ getTabLocatorWithName(name) {
959
+ return this.page.getByRole('tab', { name: name });
963
960
  }
964
- async doesDescriptionHaveValue(value, index = 0) {
965
- return await this.hasValue(this.descriptionBtn.nth(index), value);
961
+ getTextLocatorWithName(name) {
962
+ return this.page.getByText(name, { exact: true });
966
963
  }
967
- // Drag and Drop Methods
968
- async dragAndDrop(dragFromSelector, dragToSelector, verticalOffset = 0, horizontalOffset = 0, steps = 5) {
969
- await this.waitForVisible(dragFromSelector);
970
- await this.waitForVisible(dragToSelector);
971
- const targetLocation = await dragToSelector.boundingBox();
972
- const elementCenterX = targetLocation.x + targetLocation.width / 2;
973
- const elementCenterY = targetLocation.y + targetLocation.height / 2;
974
- await this.hover(dragFromSelector);
975
- await this.page.mouse.move(10, 10);
976
- await this.hover(dragFromSelector);
977
- await this.page.mouse.down();
978
- await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.debounce);
979
- await this.page.mouse.move(elementCenterX + horizontalOffset, elementCenterY + verticalOffset, { steps: steps });
980
- await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.debounce);
981
- await this.page.mouse.up();
964
+ getLocatorWithDataMark(dataMark) {
965
+ return this.page.getByTestId(dataMark);
982
966
  }
983
- // Create Link Methods
984
- async clickCreateLink() {
985
- await this.click(this.createLink);
967
+ ;
968
+ async isFailedStateButtonVisible() {
969
+ await (0, test_1.expect)(this.failedStateButton).toBeVisible();
986
970
  }
987
- // Recycle Bin Methods
988
- async clickRecycleBinButton() {
989
- 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);
990
980
  }
991
981
  async reloadRecycleBin(containsItems = true) {
992
- 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
993
984
  if (!containsItems) {
994
985
  await this.clickReloadChildrenActionMenuOption();
995
- await this.isVisible(this.recycleBinMenuItemCaretBtn, false);
986
+ await (0, test_1.expect)(this.recycleBinMenuItemCaretBtn).not.toBeVisible();
996
987
  return;
997
988
  }
998
989
  await this.clickActionsMenuForName('Recycle Bin');
999
990
  await this.clickReloadChildrenActionMenuOption();
1000
991
  await this.openCaretButtonForName('Recycle Bin');
1001
992
  }
993
+ async clickRecycleBinButton() {
994
+ await (0, test_1.expect)(this.recycleBinBtn).toBeVisible();
995
+ await this.recycleBinBtn.click();
996
+ }
1002
997
  async isItemVisibleInRecycleBin(item, isVisible = true, isReload = true) {
1003
998
  if (isReload) {
1004
999
  await this.reloadRecycleBin(isVisible);
1005
1000
  }
1006
- 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 });
1007
1002
  }
1008
- // View Methods
1009
1003
  async changeToGridView() {
1010
- await this.click(this.viewBundleBtn);
1011
- await this.click(this.gridBtn);
1004
+ await (0, test_1.expect)(this.viewBundleBtn).toBeVisible();
1005
+ await this.viewBundleBtn.click();
1006
+ await this.gridBtn.click();
1012
1007
  }
1013
1008
  async changeToListView() {
1014
- await this.click(this.viewBundleBtn);
1015
- await this.click(this.listBtn);
1009
+ await (0, test_1.expect)(this.viewBundleBtn).toBeVisible();
1010
+ await this.viewBundleBtn.click();
1011
+ await this.listBtn.click();
1016
1012
  }
1017
1013
  async isViewBundleButtonVisible(isVisible = true) {
1018
- return this.isVisible(this.viewBundleBtn, isVisible);
1014
+ return (0, test_1.expect)(this.viewBundleBtn).toBeVisible({ visible: isVisible });
1019
1015
  }
1020
- // Media Methods
1021
- async clickMediaWithName(name) {
1022
- 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;
1023
1025
  }
1024
- async selectMediaWithName(mediaName, isForce = false) {
1025
- const mediaLocator = this.mediaCardItems.filter({ hasText: mediaName });
1026
- await this.waitForVisible(mediaLocator);
1027
- // Using direct click with position option (not supported by BasePage.click)
1028
- 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;
1029
1032
  }
1030
- async selectMediaWithTestId(mediaKey) {
1031
- const locator = this.page.getByTestId('media:' + mediaKey);
1032
- await this.waitForVisible(locator);
1033
- // Using direct click with position option (not supported by BasePage.click)
1034
- 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 });
1035
1035
  }
1036
- async clickMediaPickerModalSubmitButton() {
1037
- 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();
1038
1039
  }
1039
- async clickMediaCaptionAltTextModalSubmitButton() {
1040
- await this.click(this.mediaCaptionAltTextModalSubmitBtn);
1040
+ async clickChooseContentStartNodeButton() {
1041
+ await (0, test_1.expect)(this.chooseDocumentInputBtn).toBeVisible();
1042
+ await this.chooseDocumentInputBtn.click();
1041
1043
  }
1042
1044
  async clickChooseMediaStartNodeButton() {
1043
- await this.click(this.chooseMediaInputBtn);
1045
+ await (0, test_1.expect)(this.chooseMediaInputBtn).toBeVisible();
1046
+ await this.chooseMediaInputBtn.click();
1044
1047
  }
1045
- async isMediaCardItemWithNameDisabled(itemName) {
1046
- 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();
1047
1051
  }
1048
- async isMediaCardItemWithNameVisible(itemName, isVisible = true) {
1049
- 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();
1050
1055
  }
1051
- async doesMediaHaveThumbnail(mediaId, thumbnailIconName, thumbnailImage) {
1052
- const mediaThumbnailLocator = this.page.getByTestId('media:' + mediaId);
1053
- if (thumbnailIconName === 'image') {
1054
- const regexImageSrc = new RegExp(`^${thumbnailImage}.*`);
1055
- await this.hasAttribute(mediaThumbnailLocator.locator('umb-imaging-thumbnail img'), 'src', regexImageSrc.toString());
1056
- }
1057
- else {
1058
- await this.hasAttribute(mediaThumbnailLocator.locator('umb-imaging-thumbnail umb-icon'), 'name', thumbnailIconName);
1059
- }
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();
1060
1059
  }
1061
- async isInputDropzoneVisible(isVisible = true) {
1062
- await this.isVisible(this.inputDropzone, isVisible);
1060
+ async clickMediaPickerModalSubmitButton() {
1061
+ await (0, test_1.expect)(this.mediaPickerModalSubmitBtn).toBeVisible();
1062
+ await this.mediaPickerModalSubmitBtn.click();
1063
1063
  }
1064
- async isImageCropperFieldVisible(isVisible = true) {
1065
- 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');
1066
1069
  }
1067
- async isInputUploadFieldVisible(isVisible = true) {
1068
- 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 } });
1069
1074
  }
1070
- // Upload Methods
1071
- async clickToUploadButton() {
1072
- await this.click(this.clickToUploadBtn);
1075
+ async clickCreateModalButton() {
1076
+ await (0, test_1.expect)(this.createModalBtn).toBeVisible();
1077
+ await this.createModalBtn.click();
1073
1078
  }
1074
- async uploadFile(filePath) {
1075
- const [fileChooser] = await Promise.all([
1076
- this.page.waitForEvent('filechooser'),
1077
- await this.clickToUploadButton(),
1078
- ]);
1079
- await fileChooser.setFiles(filePath);
1079
+ async clickMediaCaptionAltTextModalSubmitButton() {
1080
+ await (0, test_1.expect)(this.mediaCaptionAltTextModalSubmitBtn).toBeVisible();
1081
+ await this.mediaCaptionAltTextModalSubmitBtn.click();
1080
1082
  }
1081
- // Embedded Media Methods
1083
+ // Embed Modal
1082
1084
  async enterEmbeddedURL(value) {
1083
- 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);
1084
1088
  }
1085
1089
  async clickEmbeddedRetrieveButton() {
1086
- await this.click(this.embeddedRetrieveBtn);
1090
+ await (0, test_1.expect)(this.embeddedRetrieveBtn).toBeVisible();
1091
+ await this.embeddedRetrieveBtn.click();
1087
1092
  }
1088
1093
  async clickEmbeddedMediaModalConfirmButton() {
1089
- await this.click(this.embeddedMediaModalConfirmBtn);
1094
+ await (0, test_1.expect)(this.embeddedMediaModalConfirmBtn).toBeVisible();
1095
+ await this.embeddedMediaModalConfirmBtn.click();
1090
1096
  }
1091
1097
  async waitForEmbeddedPreviewVisible() {
1092
- await this.waitForVisible(this.embeddedPreview);
1098
+ await (0, test_1.expect)(this.embeddedPreview).toBeVisible();
1093
1099
  }
1094
- // Document Methods
1095
- async clickChooseContentStartNodeButton() {
1096
- 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
+ }
1097
1113
  }
1098
- // User Methods
1099
1114
  async clickCurrentUserAvatarButton() {
1100
- await this.click(this.currentUserAvatarBtn, { force: true });
1115
+ await (0, test_1.expect)(this.currentUserAvatarBtn).toBeVisible();
1116
+ await this.currentUserAvatarBtn.click({ force: true });
1101
1117
  }
1102
- // Collection Methods
1103
1118
  async clickCreateActionButton() {
1104
- await this.click(this.createActionBtn);
1119
+ await (0, test_1.expect)(this.createActionBtn).toBeVisible();
1120
+ await this.createActionBtn.click();
1105
1121
  }
1106
1122
  async clickCreateActionWithOptionName(optionName) {
1107
1123
  await this.clickCreateActionButton();
1108
1124
  const createOptionLocator = this.createActionButtonCollection.locator('[label="' + optionName + '"]');
1109
- await this.click(createOptionLocator);
1125
+ await (0, test_1.expect)(createOptionLocator).toBeVisible();
1126
+ await createOptionLocator.click();
1110
1127
  }
1111
1128
  async doesCollectionTreeItemTableRowHaveName(name) {
1112
- await this.waitForVisible(this.collectionTreeItemTableRow.first());
1113
- 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();
1114
1131
  }
1115
1132
  async doesCollectionTreeItemTableRowHaveIcon(name, icon) {
1116
- await this.waitForVisible(this.collectionTreeItemTableRow.first());
1117
- 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();
1118
1135
  }
1119
- // Reference Methods
1120
- async clickReferenceNodeLinkWithName(name) {
1121
- 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();
1122
1139
  }
1123
1140
  async doesReferenceHeadlineHaveText(text) {
1124
- await this.containsText(this.referenceHeadline, text);
1141
+ await (0, test_1.expect)(this.referenceHeadline).toContainText(text);
1125
1142
  }
1126
1143
  async isReferenceHeadlineVisible(isVisible) {
1127
- await this.isVisible(this.referenceHeadline, isVisible);
1144
+ await (0, test_1.expect)(this.referenceHeadline).toBeVisible({ visible: isVisible });
1128
1145
  }
1129
1146
  async doesReferenceItemsHaveCount(count) {
1130
- await this.hasCount(this.entityItemRef, count);
1147
+ await (0, test_1.expect)(this.entityItemRef).toHaveCount(count);
1131
1148
  }
1132
1149
  async isReferenceItemNameVisible(itemName) {
1133
- 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();
1134
1151
  }
1135
1152
  async doesReferencesContainText(text) {
1136
- 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');
1137
1164
  }
1138
- // 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
1139
1170
  async clickEntityActionWithName(name) {
1140
1171
  const regex = new RegExp(`^entity-action:.*${name}$`);
1141
- 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();
1142
1173
  }
1143
1174
  async clickCreateActionMenuOption() {
1144
1175
  await this.clickEntityActionWithName('Create');
@@ -1200,63 +1231,69 @@ class UiBaseLocators extends BasePage_1.BasePage {
1200
1231
  async clickUpdateActionMenuOption() {
1201
1232
  await this.clickEntityActionWithName('Update');
1202
1233
  }
1203
- async clickLockActionMenuOption() {
1204
- 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 });
1205
1246
  }
1206
- // Entity Item Methods
1207
1247
  async clickEntityItemByName(itemName) {
1208
- 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 });
1209
1256
  }
1210
- // Workspace Action Methods
1211
1257
  async clickWorkspaceActionMenuButton() {
1212
- await this.click(this.workspaceActionMenuBtn);
1258
+ await (0, test_1.expect)(this.workspaceActionMenuBtn).toBeVisible();
1259
+ await this.workspaceActionMenuBtn.click();
1213
1260
  }
1214
- // Pagination Methods
1215
- async clickNextPaginationButton() {
1216
- 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 });
1217
1266
  }
1218
- // Editor Methods
1219
1267
  async enterMonacoEditorValue(value) {
1220
- await this.click(this.monacoEditor);
1221
- await this.pressKey(this.monacoEditor, 'Control+A');
1222
- 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');
1223
1272
  await this.page.keyboard.insertText(value);
1224
1273
  }
1225
- // Loader Methods
1226
1274
  async waitUntilUiLoaderIsNoLongerVisible() {
1227
- await this.waitForHidden(this.uiLoader, 10000);
1228
- }
1229
- // Dashboard Methods
1230
- async isDashboardTabWithNameVisible(name, isVisible = true) {
1231
- await this.isVisible(this.page.locator('uui-tab[label="' + name + '"]'), isVisible);
1275
+ await (0, test_1.expect)(this.uiLoader).toBeVisible({ visible: false, timeout: 10000 });
1232
1276
  }
1233
1277
  async isWorkspaceViewTabWithAliasVisible(alias, isVisible = true) {
1234
- await this.isVisible(this.page.getByTestId('workspace:view-link:' + alias), isVisible);
1235
- }
1236
- // Submit Button Methods
1237
- async isSubmitButtonDisabled() {
1238
- await this.isVisible(this.submitBtn);
1239
- await this.isDisabled(this.submitBtn);
1240
- }
1241
- // Data Element Methods
1242
- async clickDataElement(elementName, options = null) {
1243
- 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 });
1244
1279
  }
1245
- async getDataElement(elementName) {
1246
- return this.page.locator(`[data-element="${elementName}"]`);
1280
+ async clickRestoreButton() {
1281
+ await (0, test_1.expect)(this.restoreBtn).toBeVisible();
1282
+ await this.restoreBtn.click();
1247
1283
  }
1248
- getLocatorWithDataMark(dataMark) {
1249
- return this.page.getByTestId(dataMark);
1284
+ async isInputDropzoneVisible(isVisible = true) {
1285
+ await (0, test_1.expect)(this.inputDropzone).toBeVisible({ visible: isVisible });
1250
1286
  }
1251
- // Text Visibility Methods
1252
- async isTextWithExactNameVisible(name, isVisible = true) {
1253
- 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 });
1254
1289
  }
1255
- async isTextWithMessageVisible(message, isVisible = true) {
1256
- 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 });
1257
1292
  }
1258
- getTextLocatorWithName(name) {
1259
- 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 });
1260
1297
  }
1261
1298
  async doesPropertyWithNameContainValidationMessage(propertyName, validationMessage, isContained = true) {
1262
1299
  const validationMessageLocator = this.page.locator('umb-property-layout[label="' + propertyName + '"]').locator(this.validationMessage);