@umbraco/playwright-testhelpers 2.0.0-beta.9 → 2.0.0-beta.91

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 (194) hide show
  1. package/dist/lib/helpers/ApiHelpers.d.ts +53 -4
  2. package/dist/lib/helpers/ApiHelpers.js +260 -9
  3. package/dist/lib/helpers/ApiHelpers.js.map +1 -1
  4. package/dist/lib/helpers/ContentRenderUiHelper.d.ts +8 -0
  5. package/dist/lib/helpers/ContentRenderUiHelper.js +21 -0
  6. package/dist/lib/helpers/ContentRenderUiHelper.js.map +1 -0
  7. package/dist/lib/helpers/ContentUiHelper.d.ts +190 -0
  8. package/dist/lib/helpers/ContentUiHelper.js +569 -0
  9. package/dist/lib/helpers/ContentUiHelper.js.map +1 -0
  10. package/dist/lib/helpers/DataTypeApiHelper.d.ts +96 -14
  11. package/dist/lib/helpers/DataTypeApiHelper.js +841 -130
  12. package/dist/lib/helpers/DataTypeApiHelper.js.map +1 -1
  13. package/dist/lib/helpers/DataTypeUiHelper.d.ts +266 -0
  14. package/dist/lib/helpers/DataTypeUiHelper.js +850 -0
  15. package/dist/lib/helpers/DataTypeUiHelper.js.map +1 -0
  16. package/dist/lib/helpers/DictionaryApiHelper.d.ts +2 -1
  17. package/dist/lib/helpers/DictionaryApiHelper.js +17 -4
  18. package/dist/lib/helpers/DictionaryApiHelper.js.map +1 -1
  19. package/dist/lib/helpers/DictionaryUiHelper.d.ts +7 -9
  20. package/dist/lib/helpers/DictionaryUiHelper.js +33 -33
  21. package/dist/lib/helpers/DictionaryUiHelper.js.map +1 -1
  22. package/dist/lib/helpers/DocumentApiHelper.d.ts +39 -0
  23. package/dist/lib/helpers/DocumentApiHelper.js +388 -0
  24. package/dist/lib/helpers/DocumentApiHelper.js.map +1 -1
  25. package/dist/lib/helpers/DocumentBlueprintApiHelper.d.ts +18 -0
  26. package/dist/lib/helpers/DocumentBlueprintApiHelper.js +126 -0
  27. package/dist/lib/helpers/DocumentBlueprintApiHelper.js.map +1 -0
  28. package/dist/lib/helpers/DocumentBlueprintUiHelper.d.ts +18 -0
  29. package/dist/lib/helpers/DocumentBlueprintUiHelper.js +54 -0
  30. package/dist/lib/helpers/DocumentBlueprintUiHelper.js.map +1 -0
  31. package/dist/lib/helpers/DocumentTypeApiHelper.d.ts +43 -0
  32. package/dist/lib/helpers/DocumentTypeApiHelper.js +577 -0
  33. package/dist/lib/helpers/DocumentTypeApiHelper.js.map +1 -0
  34. package/dist/lib/helpers/DocumentTypeUiHelper.d.ts +35 -0
  35. package/dist/lib/helpers/DocumentTypeUiHelper.js +98 -0
  36. package/dist/lib/helpers/DocumentTypeUiHelper.js.map +1 -0
  37. package/dist/lib/helpers/ExamineManagementUiHelper.d.ts +15 -0
  38. package/dist/lib/helpers/ExamineManagementUiHelper.js +38 -0
  39. package/dist/lib/helpers/ExamineManagementUiHelper.js.map +1 -0
  40. package/dist/lib/helpers/HealthCheckApiHelper.d.ts +13 -0
  41. package/dist/lib/helpers/HealthCheckApiHelper.js +47 -0
  42. package/dist/lib/helpers/HealthCheckApiHelper.js.map +1 -0
  43. package/dist/lib/helpers/HealthCheckUiHelper.d.ts +23 -0
  44. package/dist/lib/helpers/HealthCheckUiHelper.js +59 -0
  45. package/dist/lib/helpers/HealthCheckUiHelper.js.map +1 -0
  46. package/dist/lib/helpers/IndexerApiHelper.d.ts +7 -0
  47. package/dist/lib/helpers/IndexerApiHelper.js +19 -0
  48. package/dist/lib/helpers/IndexerApiHelper.js.map +1 -0
  49. package/dist/lib/helpers/LanguageApiHelper.d.ts +8 -4
  50. package/dist/lib/helpers/LanguageApiHelper.js +46 -26
  51. package/dist/lib/helpers/LanguageApiHelper.js.map +1 -1
  52. package/dist/lib/helpers/LanguageUiHelper.d.ts +23 -0
  53. package/dist/lib/helpers/LanguageUiHelper.js +68 -0
  54. package/dist/lib/helpers/LanguageUiHelper.js.map +1 -0
  55. package/dist/lib/helpers/LogViewerUiHelper.d.ts +37 -0
  56. package/dist/lib/helpers/LogViewerUiHelper.js +102 -0
  57. package/dist/lib/helpers/LogViewerUiHelper.js.map +1 -0
  58. package/dist/lib/helpers/LoginApiHelper.d.ts +17 -0
  59. package/dist/lib/helpers/LoginApiHelper.js +105 -0
  60. package/dist/lib/helpers/LoginApiHelper.js.map +1 -0
  61. package/dist/lib/helpers/LoginUiHelper.d.ts +11 -0
  62. package/dist/lib/helpers/LoginUiHelper.js +30 -0
  63. package/dist/lib/helpers/LoginUiHelper.js.map +1 -0
  64. package/dist/lib/helpers/MediaApiHelper.d.ts +32 -0
  65. package/dist/lib/helpers/MediaApiHelper.js +245 -0
  66. package/dist/lib/helpers/MediaApiHelper.js.map +1 -0
  67. package/dist/lib/helpers/MediaTypeApiHelper.d.ts +32 -0
  68. package/dist/lib/helpers/MediaTypeApiHelper.js +390 -0
  69. package/dist/lib/helpers/MediaTypeApiHelper.js.map +1 -0
  70. package/dist/lib/helpers/MediaTypeUiHelper.d.ts +14 -0
  71. package/dist/lib/helpers/MediaTypeUiHelper.js +38 -0
  72. package/dist/lib/helpers/MediaTypeUiHelper.js.map +1 -0
  73. package/dist/lib/helpers/MediaUiHelper.d.ts +54 -0
  74. package/dist/lib/helpers/MediaUiHelper.js +158 -0
  75. package/dist/lib/helpers/MediaUiHelper.js.map +1 -0
  76. package/dist/lib/helpers/MemberApiHelper.d.ts +16 -0
  77. package/dist/lib/helpers/MemberApiHelper.js +88 -0
  78. package/dist/lib/helpers/MemberApiHelper.js.map +1 -0
  79. package/dist/lib/helpers/MemberGroupApiHelper.d.ts +14 -0
  80. package/dist/lib/helpers/MemberGroupApiHelper.js +62 -0
  81. package/dist/lib/helpers/MemberGroupApiHelper.js.map +1 -0
  82. package/dist/lib/helpers/MemberGroupUiHelper.d.ts +17 -0
  83. package/dist/lib/helpers/MemberGroupUiHelper.js +48 -0
  84. package/dist/lib/helpers/MemberGroupUiHelper.js.map +1 -0
  85. package/dist/lib/helpers/MemberTypeApiHelper.d.ts +17 -0
  86. package/dist/lib/helpers/MemberTypeApiHelper.js +121 -0
  87. package/dist/lib/helpers/MemberTypeApiHelper.js.map +1 -0
  88. package/dist/lib/helpers/MemberTypeUiHelper.d.ts +13 -0
  89. package/dist/lib/helpers/MemberTypeUiHelper.js +35 -0
  90. package/dist/lib/helpers/MemberTypeUiHelper.js.map +1 -0
  91. package/dist/lib/helpers/MemberUiHelper.d.ts +42 -0
  92. package/dist/lib/helpers/MemberUiHelper.js +120 -0
  93. package/dist/lib/helpers/MemberUiHelper.js.map +1 -0
  94. package/dist/lib/helpers/ModelsBuilderApiHelper.d.ts +6 -0
  95. package/dist/lib/helpers/ModelsBuilderApiHelper.js +15 -0
  96. package/dist/lib/helpers/ModelsBuilderApiHelper.js.map +1 -0
  97. package/dist/lib/helpers/ModelsBuilderUiHelper.d.ts +9 -0
  98. package/dist/lib/helpers/ModelsBuilderUiHelper.js +22 -0
  99. package/dist/lib/helpers/ModelsBuilderUiHelper.js.map +1 -0
  100. package/dist/lib/helpers/NotificationConstantHelper.d.ts +30 -0
  101. package/dist/lib/helpers/NotificationConstantHelper.js +35 -0
  102. package/dist/lib/helpers/NotificationConstantHelper.js.map +1 -0
  103. package/dist/lib/helpers/ObjectTypesApiHelper.d.ts +7 -0
  104. package/dist/lib/helpers/ObjectTypesApiHelper.js +25 -0
  105. package/dist/lib/helpers/ObjectTypesApiHelper.js.map +1 -0
  106. package/dist/lib/helpers/PackageApiHelper.d.ts +3 -2
  107. package/dist/lib/helpers/PackageApiHelper.js +6 -3
  108. package/dist/lib/helpers/PackageApiHelper.js.map +1 -1
  109. package/dist/lib/helpers/PackageUiHelper.d.ts +50 -0
  110. package/dist/lib/helpers/PackageUiHelper.js +140 -0
  111. package/dist/lib/helpers/PackageUiHelper.js.map +1 -0
  112. package/dist/lib/helpers/PartialViewApiHelper.d.ts +5 -4
  113. package/dist/lib/helpers/PartialViewApiHelper.js +36 -30
  114. package/dist/lib/helpers/PartialViewApiHelper.js.map +1 -1
  115. package/dist/lib/helpers/PartialViewUiHelper.d.ts +7 -11
  116. package/dist/lib/helpers/PartialViewUiHelper.js +27 -36
  117. package/dist/lib/helpers/PartialViewUiHelper.js.map +1 -1
  118. package/dist/lib/helpers/ProfilingUiHelper.d.ts +11 -0
  119. package/dist/lib/helpers/ProfilingUiHelper.js +27 -0
  120. package/dist/lib/helpers/ProfilingUiHelper.js.map +1 -0
  121. package/dist/lib/helpers/PublishedCacheApiHelper.d.ts +6 -0
  122. package/dist/lib/helpers/PublishedCacheApiHelper.js +15 -0
  123. package/dist/lib/helpers/PublishedCacheApiHelper.js.map +1 -0
  124. package/dist/lib/helpers/PublishedStatusUiHelper.d.ts +19 -0
  125. package/dist/lib/helpers/PublishedStatusUiHelper.js +47 -0
  126. package/dist/lib/helpers/PublishedStatusUiHelper.js.map +1 -0
  127. package/dist/lib/helpers/RedirectManagementApiHelper.d.ts +10 -0
  128. package/dist/lib/helpers/RedirectManagementApiHelper.js +30 -0
  129. package/dist/lib/helpers/RedirectManagementApiHelper.js.map +1 -0
  130. package/dist/lib/helpers/RedirectManagementUiHelper.d.ts +17 -0
  131. package/dist/lib/helpers/RedirectManagementUiHelper.js +45 -0
  132. package/dist/lib/helpers/RedirectManagementUiHelper.js.map +1 -0
  133. package/dist/lib/helpers/RelationTypeApiHelper.d.ts +15 -0
  134. package/dist/lib/helpers/{RelationType.js → RelationTypeApiHelper.js} +45 -58
  135. package/dist/lib/helpers/RelationTypeApiHelper.js.map +1 -0
  136. package/dist/lib/helpers/RelationTypeUiHelper.d.ts +21 -0
  137. package/dist/lib/helpers/RelationTypeUiHelper.js +55 -0
  138. package/dist/lib/helpers/RelationTypeUiHelper.js.map +1 -0
  139. package/dist/lib/helpers/ScriptApiHelper.d.ts +5 -3
  140. package/dist/lib/helpers/ScriptApiHelper.js +43 -26
  141. package/dist/lib/helpers/ScriptApiHelper.js.map +1 -1
  142. package/dist/lib/helpers/ScriptUiHelper.d.ts +8 -12
  143. package/dist/lib/helpers/ScriptUiHelper.js +31 -40
  144. package/dist/lib/helpers/ScriptUiHelper.js.map +1 -1
  145. package/dist/lib/helpers/StylesheetApiHelper.d.ts +6 -4
  146. package/dist/lib/helpers/StylesheetApiHelper.js +48 -41
  147. package/dist/lib/helpers/StylesheetApiHelper.js.map +1 -1
  148. package/dist/lib/helpers/StylesheetUiHelper.d.ts +17 -15
  149. package/dist/lib/helpers/StylesheetUiHelper.js +60 -47
  150. package/dist/lib/helpers/StylesheetUiHelper.js.map +1 -1
  151. package/dist/lib/helpers/TelemetryDataUiHelper.d.ts +10 -0
  152. package/dist/lib/helpers/TelemetryDataUiHelper.js +25 -0
  153. package/dist/lib/helpers/TelemetryDataUiHelper.js.map +1 -0
  154. package/dist/lib/helpers/TemplateApiHelper.d.ts +5 -0
  155. package/dist/lib/helpers/TemplateApiHelper.js +68 -0
  156. package/dist/lib/helpers/TemplateApiHelper.js.map +1 -1
  157. package/dist/lib/helpers/TemplateUiHelper.d.ts +14 -18
  158. package/dist/lib/helpers/TemplateUiHelper.js +65 -59
  159. package/dist/lib/helpers/TemplateUiHelper.js.map +1 -1
  160. package/dist/lib/helpers/TemporaryFileApiHelper.d.ts +17 -1
  161. package/dist/lib/helpers/TemporaryFileApiHelper.js +23 -10
  162. package/dist/lib/helpers/TemporaryFileApiHelper.js.map +1 -1
  163. package/dist/lib/helpers/UiBaseLocators.d.ts +217 -10
  164. package/dist/lib/helpers/UiBaseLocators.js +718 -40
  165. package/dist/lib/helpers/UiBaseLocators.js.map +1 -1
  166. package/dist/lib/helpers/UiHelpers.d.ts +51 -7
  167. package/dist/lib/helpers/UiHelpers.js +78 -21
  168. package/dist/lib/helpers/UiHelpers.js.map +1 -1
  169. package/dist/lib/helpers/UserApiHelper.d.ts +28 -11
  170. package/dist/lib/helpers/UserApiHelper.js +123 -21
  171. package/dist/lib/helpers/UserApiHelper.js.map +1 -1
  172. package/dist/lib/helpers/UserGroupApiHelper.d.ts +8 -3
  173. package/dist/lib/helpers/UserGroupApiHelper.js +52 -19
  174. package/dist/lib/helpers/UserGroupApiHelper.js.map +1 -1
  175. package/dist/lib/helpers/UserGroupUiHelper.d.ts +20 -0
  176. package/dist/lib/helpers/UserGroupUiHelper.js +56 -0
  177. package/dist/lib/helpers/UserGroupUiHelper.js.map +1 -0
  178. package/dist/lib/helpers/UserUiHelper.d.ts +73 -0
  179. package/dist/lib/helpers/UserUiHelper.js +199 -0
  180. package/dist/lib/helpers/UserUiHelper.js.map +1 -0
  181. package/dist/lib/helpers/WelcomeDashboardUiHelper.d.ts +9 -0
  182. package/dist/lib/helpers/WelcomeDashboardUiHelper.js +22 -0
  183. package/dist/lib/helpers/WelcomeDashboardUiHelper.js.map +1 -0
  184. package/dist/lib/helpers/index.d.ts +1 -0
  185. package/dist/lib/helpers/index.js +3 -1
  186. package/dist/lib/helpers/index.js.map +1 -1
  187. package/dist/lib/helpers/testExtension.js +5 -0
  188. package/dist/lib/helpers/testExtension.js.map +1 -1
  189. package/dist/tsconfig.tsbuildinfo +1 -1
  190. package/dist/umbraco.config.js +1 -1
  191. package/dist/umbraco.config.js.map +1 -1
  192. package/package.json +9 -11
  193. package/dist/lib/helpers/RelationType.d.ts +0 -15
  194. package/dist/lib/helpers/RelationType.js.map +0 -1
@@ -6,73 +6,339 @@ const ConstantHelper_1 = require("./ConstantHelper");
6
6
  class UiBaseLocators {
7
7
  page;
8
8
  saveBtn;
9
+ chooseBtn;
9
10
  submitBtn;
10
11
  createFolderBtn;
11
12
  breadcrumbBtn;
12
13
  deleteBtn;
13
14
  confirmToDeleteBtn;
14
- deleteFolderBtn;
15
+ deleteLabelBtn;
16
+ deleteExactLabelBtn;
17
+ deleteExactBtn;
15
18
  confirmCreateFolderBtn;
16
19
  insertBtn;
17
- dictionaryInsertItemBtn;
18
- caretDictionaryBtn;
19
- insertValueBtn;
20
20
  modalCaretBtn;
21
21
  queryBuilderBtn;
22
22
  queryBuilderOrderedBy;
23
23
  queryBuilderCreateDate;
24
24
  folderNameTxt;
25
25
  textAreaInputArea;
26
+ wherePropertyAliasBtn;
27
+ whereOperatorBtn;
28
+ whereConstrainValueTxt;
29
+ orderByPropertyAliasBtn;
30
+ ascendingBtn;
31
+ queryBuilderShowCode;
32
+ createThreeDotsBtn;
33
+ newFolderThreeDotsBtn;
34
+ renameThreeDotsBtn;
35
+ newNameTxt;
36
+ renameModalBtn;
37
+ createBtn;
38
+ successState;
39
+ chooseModalBtn;
40
+ addBtn;
41
+ renameFolderThreeDotsBtn;
42
+ renameFolderBtn;
43
+ updateFolderBtn;
44
+ filterChooseBtn;
45
+ updateBtn;
46
+ changeBtn;
47
+ propertyNameTxt;
48
+ selectPropertyEditorBtn;
49
+ addGroupBtn;
50
+ iAmDoneReorderingBtn;
51
+ reorderBtn;
52
+ compositionsBtn;
53
+ addTabBtn;
54
+ descriptionBtn;
55
+ enterDescriptionTxt;
56
+ mandatorySlider;
57
+ validation;
58
+ regexTxt;
59
+ regexMessageTxt;
60
+ structureTabBtn;
61
+ allowAtRootBtn;
62
+ addPropertyBtn;
63
+ typeToFilterSearchTxt;
64
+ editorSettingsBtn;
65
+ labelAboveBtn;
66
+ unnamedTxt;
67
+ deleteThreeDotsBtn;
68
+ removeExactBtn;
69
+ confirmBtn;
70
+ disableBtn;
71
+ confirmDisableBtn;
72
+ enableBtn;
73
+ confirmEnableBtn;
74
+ iconBtn;
75
+ aliasLockBtn;
76
+ aliasNameTxt;
77
+ deleteFolderThreeDotsBtn;
78
+ createLink;
79
+ insertValueBtn;
80
+ insertPartialViewBtn;
81
+ insertDictionaryItemBtn;
82
+ chooseFieldDropDown;
83
+ systemFieldsOption;
84
+ chooseFieldValueDropDown;
85
+ renameBtn;
86
+ deleteFolderBtn;
87
+ returnedItemsCount;
88
+ chooseRootContentBtn;
89
+ queryResults;
90
+ reloadBtn;
91
+ confirmToRemoveBtn;
92
+ confirmToSubmitBtn;
93
+ typeGroups;
94
+ allowedChildNodesModal;
95
+ configureAsACollectionBtn;
96
+ errorNotification;
97
+ confirmRenameFolderBtn;
98
+ successNotification;
99
+ leftArrowBtn;
100
+ clickToUploadBtn;
101
+ backOfficeHeader;
102
+ failedStateButton;
103
+ sidebarModal;
104
+ enterAName;
105
+ mediaCardItems;
106
+ enterPropertyEditorDescriptionTxt;
107
+ breadcrumbsTemplateModal;
108
+ containerChooseBtn;
109
+ documentTypeNode;
110
+ groupLabel;
111
+ containerSaveAndPublishBtn;
112
+ confirmTrashBtn;
113
+ recycleBinBtn;
114
+ recycleBinMenuItemCaretBtn;
115
+ recycleBinMenuItem;
116
+ gridBtn;
117
+ listBtn;
118
+ viewBundleBtn;
26
119
  constructor(page) {
27
120
  this.page = page;
28
- this.saveBtn = page.getByLabel('Save');
121
+ this.saveBtn = page.getByLabel('Save', { exact: true });
29
122
  this.submitBtn = page.getByLabel('Submit');
30
- this.deleteFolderBtn = page.getByLabel('Delete');
123
+ this.deleteExactLabelBtn = page.getByLabel('Delete', { exact: true });
124
+ this.deleteExactBtn = page.getByRole('button', { name: 'Delete', exact: true });
125
+ this.deleteLabelBtn = page.getByLabel('Delete');
31
126
  this.deleteBtn = page.getByRole('button', { name: 'Delete' });
32
127
  this.confirmToDeleteBtn = page.locator('#confirm').getByLabel('Delete');
33
- this.confirmCreateFolderBtn = page.locator('#confirm').getByLabel('Create folder');
128
+ this.confirmCreateFolderBtn = page.locator('#confirm').getByLabel('Create Folder');
34
129
  this.breadcrumbBtn = page.getByLabel('Breadcrumb');
35
130
  this.createFolderBtn = page.getByLabel('Create folder');
36
- this.insertBtn = page.getByLabel('Choose value to insert');
37
- this.dictionaryInsertItemBtn = page.getByLabel('Insert Dictionary item');
38
- this.caretDictionaryBtn = page.locator('umb-tree-picker-modal').locator('#caret-button');
39
- this.insertValueBtn = page.getByLabel('Choose value to insert');
40
- this.modalCaretBtn = page.locator('umb-tree-picker-modal').locator('#caret-button');
131
+ this.insertBtn = page.locator('uui-box uui-button').filter({ hasText: 'Insert' });
132
+ this.sidebarModal = page.locator('uui-modal-sidebar');
133
+ this.modalCaretBtn = this.sidebarModal.locator('#caret-button');
134
+ this.enterAName = page.getByLabel('Enter a name...', { exact: true });
41
135
  this.queryBuilderBtn = page.locator('#query-builder-button').getByLabel('Query builder');
42
136
  this.queryBuilderOrderedBy = page.locator('#property-alias-dropdown').getByLabel('Property alias');
43
- this.queryBuilderCreateDate = page.locator('#property-alias-dropdown').getByText('CreateDate');
44
- this.folderNameTxt = page.getByRole('textbox', { name: 'Enter folder name...' });
137
+ this.queryBuilderCreateDate = page.locator('#property-alias-dropdown').getByText('CreateDate').locator("..");
138
+ this.folderNameTxt = page.getByLabel('Enter a folder name');
45
139
  this.textAreaInputArea = page.locator('textarea.inputarea');
140
+ this.wherePropertyAliasBtn = page.locator('#property-alias-dropdown');
141
+ this.whereOperatorBtn = page.locator('#operator-dropdown');
142
+ this.whereConstrainValueTxt = page.getByLabel('constrain value');
143
+ this.orderByPropertyAliasBtn = page.locator('#sort-dropdown');
144
+ this.ascendingBtn = page.locator('[key="template_ascending"]');
145
+ this.queryBuilderShowCode = page.locator('umb-code-block');
146
+ this.createThreeDotsBtn = page.getByText('Create...', { exact: true });
147
+ this.chooseBtn = page.getByLabel('Choose', { exact: true });
148
+ this.containerChooseBtn = page.locator('#container').getByLabel('Choose');
149
+ this.containerSaveAndPublishBtn = page.locator('#container').getByLabel('Save and Publish');
150
+ this.newFolderThreeDotsBtn = page.getByLabel('New Folder...');
151
+ this.renameThreeDotsBtn = page.getByLabel('Rename...', { exact: true });
152
+ this.newNameTxt = page.getByRole('textbox', { name: 'Enter new name...' });
153
+ this.renameModalBtn = page.locator('umb-rename-modal').getByLabel('Rename');
154
+ this.createBtn = page.getByRole('button', { name: 'Create', exact: true });
155
+ this.successState = page.locator('[state="success"]');
156
+ this.chooseModalBtn = page.locator('umb-tree-picker-modal').getByLabel('Choose');
157
+ this.addBtn = page.getByLabel('Add', { exact: true });
158
+ this.renameFolderThreeDotsBtn = page.getByLabel('Rename folder...');
159
+ this.renameFolderBtn = page.getByLabel('Rename folder');
160
+ this.confirmRenameFolderBtn = page.locator('#confirm').getByLabel('Rename folder');
161
+ this.updateFolderBtn = page.getByLabel('Update folder');
162
+ this.filterChooseBtn = page.locator('button').filter({ hasText: 'Choose' });
163
+ this.updateBtn = page.getByLabel('Update');
164
+ this.changeBtn = page.getByLabel('Change');
165
+ this.propertyNameTxt = page.locator('#name-input #input');
166
+ this.selectPropertyEditorBtn = page.getByLabel('Select Property Editor');
167
+ this.addGroupBtn = page.getByLabel('Add group', { exact: true });
168
+ this.iAmDoneReorderingBtn = page.getByLabel('I am done reordering');
169
+ this.reorderBtn = page.getByLabel('Reorder');
170
+ this.compositionsBtn = page.getByLabel('Compositions');
171
+ this.addTabBtn = page.getByLabel('Add tab');
172
+ this.descriptionBtn = page.getByLabel('Description');
173
+ this.enterDescriptionTxt = page.getByLabel('Enter a description...');
174
+ this.mandatorySlider = page.locator('#mandatory #slider');
175
+ this.validation = page.locator('#native');
176
+ this.regexTxt = page.locator('input[name="pattern"]');
177
+ this.regexMessageTxt = page.locator('textarea[name="pattern-message"]');
178
+ this.structureTabBtn = page.locator('uui-tab').filter({ hasText: 'Structure' }).locator('svg');
179
+ this.allowAtRootBtn = page.locator('label').filter({ hasText: 'Allow at root' });
180
+ this.addPropertyBtn = page.getByLabel('Add property', { exact: true });
181
+ this.typeToFilterSearchTxt = page.locator('[type="search"] #input');
182
+ this.editorSettingsBtn = page.getByLabel('Editor settings');
183
+ this.labelAboveBtn = page.locator('button').filter({ hasText: 'Label above' });
184
+ this.unnamedTxt = page.getByRole('textbox', { name: 'Unnamed' });
185
+ this.deleteThreeDotsBtn = page.locator('#action-modal').getByLabel('Delete...');
186
+ this.removeExactBtn = page.getByLabel('Remove', { exact: true });
187
+ this.confirmBtn = page.getByLabel('Confirm');
188
+ this.disableBtn = page.getByLabel('Disable', { exact: true });
189
+ this.confirmDisableBtn = page.locator('#confirm').getByLabel('Disable');
190
+ this.confirmToSubmitBtn = page.locator('#confirm').getByLabel('Submit');
191
+ this.enableBtn = page.getByLabel('Enable');
192
+ this.confirmEnableBtn = page.locator('#confirm').getByLabel('Enable');
193
+ this.iconBtn = page.getByLabel('icon');
194
+ this.aliasLockBtn = page.locator('#name #lock');
195
+ this.aliasNameTxt = page.locator('#name').getByLabel('alias');
196
+ this.deleteFolderThreeDotsBtn = page.locator('#action-modal').getByLabel('Delete Folder...');
197
+ this.createLink = page.getByRole('link', { name: 'Create' });
198
+ this.insertValueBtn = page.locator('uui-button').filter({ has: page.locator('[key="template_insertPageField"]') });
199
+ this.insertPartialViewBtn = page.locator('uui-button').filter({ has: page.locator('[key="template_insertPartialView"]') });
200
+ this.insertDictionaryItemBtn = page.locator('uui-button').filter({ has: page.locator('[key="template_insertDictionaryItem"]') });
201
+ this.chooseFieldDropDown = page.locator('#preview #expand-symbol-wrapper');
202
+ this.systemFieldsOption = page.getByText('System fields');
203
+ this.chooseFieldValueDropDown = page.locator('#value #expand-symbol-wrapper');
204
+ this.renameBtn = page.locator('#action-modal').getByLabel('Rename');
205
+ this.deleteFolderBtn = page.locator('#action-modal').getByLabel('Delete folder');
206
+ this.returnedItemsCount = page.locator('#results-count');
207
+ this.chooseRootContentBtn = page.getByLabel('Choose root document');
208
+ this.queryResults = page.locator('query-results');
209
+ this.reloadBtn = page.getByRole('button', { name: 'Reload', exact: true });
210
+ this.confirmToRemoveBtn = page.locator('#confirm').getByLabel('Remove');
211
+ this.typeGroups = page.locator('umb-content-type-design-editor-group');
212
+ this.allowedChildNodesModal = page.locator('umb-tree-picker-modal');
213
+ this.configureAsACollectionBtn = page.getByLabel('Configure as a collection');
214
+ this.errorNotification = page.locator('uui-toast-notification[open][color="danger"]');
215
+ this.successNotification = page.locator('uui-toast-notification[open][color="positive"]');
216
+ this.leftArrowBtn = page.locator('[name="icon-arrow-left"] svg');
217
+ this.clickToUploadBtn = page.locator('uui-file-dropzone').filter({ hasText: 'Click to upload' });
218
+ this.backOfficeHeader = page.locator('umb-backoffice-header');
219
+ this.failedStateButton = page.locator('uui-button[state="failed"]');
220
+ this.mediaCardItems = page.locator('uui-card-media');
221
+ this.enterPropertyEditorDescriptionTxt = this.sidebarModal.getByLabel('Enter a description...');
222
+ this.breadcrumbsTemplateModal = this.sidebarModal.locator('umb-template-workspace-editor uui-breadcrumbs');
223
+ this.documentTypeNode = page.locator('uui-ref-node-document-type');
224
+ this.groupLabel = page.getByLabel('Group', { exact: true });
225
+ this.confirmTrashBtn = page.locator('#confirm').getByLabel('Trash');
226
+ this.recycleBinBtn = page.getByLabel('Recycle Bin', { exact: true });
227
+ this.recycleBinMenuItem = page.locator('uui-menu-item[label="Recycle Bin"]');
228
+ this.recycleBinMenuItemCaretBtn = this.recycleBinMenuItem.locator('#caret-button');
229
+ this.gridBtn = this.page.getByLabel('Grid');
230
+ this.listBtn = this.page.getByLabel('List');
231
+ this.viewBundleBtn = this.page.locator('umb-collection-view-bundle');
46
232
  }
47
233
  async clickActionsMenuForName(name) {
48
- await this.page.locator('[label="' + name + '"] >> [label="Open actions menu"]').click({ force: true });
234
+ await this.page.locator('[label="' + name + '"]').click();
235
+ await this.page.locator('[label="' + name + '"] >> [label="Open actions menu"]').first().click();
49
236
  }
50
237
  async clickCaretButtonForName(name) {
51
238
  await this.page.locator('div').filter({ hasText: name }).locator('#caret-button').click();
52
239
  }
240
+ async clickCaretButton() {
241
+ await this.page.locator('#caret-button').click();
242
+ }
243
+ async reloadTree(treeName) {
244
+ // Waits until the tree item is visible
245
+ await (0, test_1.expect)(this.page.getByLabel(treeName, { exact: true })).toBeVisible();
246
+ await this.page.waitForTimeout(500);
247
+ await this.clickActionsMenuForName(treeName);
248
+ await this.clickReloadButton();
249
+ const menuItem = this.page.locator('uui-menu-item[label="' + treeName + '"]');
250
+ const isCaretButtonOpen = await menuItem.getAttribute('show-children');
251
+ if (isCaretButtonOpen === null) {
252
+ // We need to wait before clicking the caret button. Because the reload might not have happend yet.
253
+ // await this.page.waitForTimeout(500);
254
+ await this.clickCaretButtonForName(treeName);
255
+ }
256
+ }
257
+ async clickReloadButton() {
258
+ await this.reloadBtn.click();
259
+ }
53
260
  async clickSaveButton() {
261
+ // This wait is necessary to avoid the save button is ignored
262
+ await this.page.waitForTimeout(500);
263
+ await (0, test_1.expect)(this.saveBtn).toBeVisible();
54
264
  await this.saveBtn.click();
55
265
  }
266
+ async clickChooseButton() {
267
+ await this.chooseBtn.click();
268
+ }
269
+ async clickChooseContainerButton() {
270
+ await this.containerChooseBtn.click();
271
+ }
272
+ async clickFilterChooseButton() {
273
+ await this.filterChooseBtn.click();
274
+ }
275
+ async clickRenameFolderThreeDotsButton() {
276
+ await this.renameFolderThreeDotsBtn.click();
277
+ }
278
+ async clickRenameFolderButton() {
279
+ await this.renameFolderBtn.click();
280
+ }
281
+ async clickConfirmRenameFolderButton() {
282
+ await this.confirmRenameFolderBtn.click();
283
+ }
284
+ async clickUpdateFolderButton() {
285
+ await this.updateFolderBtn.click();
286
+ }
287
+ async clickUpdateButton() {
288
+ await this.updateBtn.click();
289
+ }
56
290
  async clickSubmitButton() {
291
+ await (0, test_1.expect)(this.submitBtn).toBeVisible();
57
292
  await this.submitBtn.click();
58
293
  }
294
+ async clickConfirmToSubmitButton() {
295
+ await this.confirmToSubmitBtn.click();
296
+ }
297
+ async clickChangeButton() {
298
+ await this.changeBtn.click();
299
+ }
300
+ async clickExactLinkWithName(name) {
301
+ await this.page.getByRole('link', { name: name, exact: true }).click();
302
+ }
303
+ async enterAliasName(aliasName) {
304
+ // Unlocks alias
305
+ await this.aliasLockBtn.click();
306
+ await this.aliasNameTxt.clear();
307
+ await this.aliasNameTxt.fill(aliasName);
308
+ }
309
+ async updateIcon(iconName) {
310
+ await this.iconBtn.click({ force: true });
311
+ await this.searchForTypeToFilterValue(iconName);
312
+ await this.clickLabelWithName(iconName, true, true);
313
+ await this.clickSubmitButton();
314
+ }
315
+ async clickTextButtonWithName(name) {
316
+ await (0, test_1.expect)(this.page.getByText(name, { exact: true })).toBeVisible();
317
+ await this.page.getByText(name, { exact: true }).click();
318
+ }
319
+ async clickSelectPropertyEditorButton() {
320
+ await (0, test_1.expect)(this.selectPropertyEditorBtn).toBeVisible();
321
+ await this.selectPropertyEditorBtn.click();
322
+ }
59
323
  async clickCreateFolderButton() {
60
324
  await this.createFolderBtn.click();
61
325
  }
326
+ async enterAPropertyName(name) {
327
+ await (0, test_1.expect)(this.propertyNameTxt).toBeVisible();
328
+ await this.propertyNameTxt.fill(name);
329
+ }
330
+ async clickConfirmButton() {
331
+ await this.confirmBtn.click();
332
+ }
62
333
  async clickBreadcrumbButton() {
63
334
  await this.breadcrumbBtn.click();
64
335
  }
65
336
  async clickInsertButton() {
337
+ await (0, test_1.expect)(this.insertBtn).toBeVisible();
66
338
  await this.insertBtn.click();
67
339
  }
68
- async clickDictionaryInsertItemButton() {
69
- await this.dictionaryInsertItemBtn.click({ force: true });
70
- }
71
- async clickCaretDictionaryButton() {
72
- await this.caretDictionaryBtn.click();
73
- }
74
340
  async clickDeleteButton() {
75
- await this.deleteBtn.click();
341
+ await this.deleteBtn.click({ force: true });
76
342
  }
77
343
  async clickConfirmToDeleteButton() {
78
344
  await this.confirmToDeleteBtn.click();
@@ -83,34 +349,446 @@ class UiBaseLocators {
83
349
  async clickConfirmCreateFolderButton() {
84
350
  await this.confirmCreateFolderBtn.click();
85
351
  }
86
- async insertDictionaryByName(dictionaryName) {
87
- await this.insertValueBtn.click();
88
- await this.clickDictionaryInsertItemButton();
89
- await this.page.waitForTimeout(1000);
90
- await this.modalCaretBtn.click({ force: true });
352
+ async clickDeleteThreeDotsButton() {
353
+ await this.deleteThreeDotsBtn.click();
354
+ }
355
+ async clickRemoveExactButton() {
356
+ await this.removeExactBtn.click();
357
+ }
358
+ async clickRemoveButtonForName(name) {
359
+ await this.page.locator('[name="' + name + '"] [Label="Remove"]').click();
360
+ }
361
+ async clickTrashIconButtonForName(name) {
362
+ await this.page.locator('[name="' + name + '"] [name="icon-trash"]').click();
363
+ }
364
+ async clickRemoveWithName(name) {
365
+ await this.page.getByLabel('Remove ' + name).click();
366
+ }
367
+ async clickDisableButton() {
368
+ await this.disableBtn.click();
369
+ }
370
+ async clickConfirmDisableButton() {
371
+ await this.confirmDisableBtn.click();
372
+ }
373
+ async clickConfirmRemoveButton() {
374
+ await this.confirmToRemoveBtn.click();
375
+ }
376
+ async clickEnableButton() {
377
+ await this.enableBtn.click();
378
+ }
379
+ async clickConfirmEnableButton() {
380
+ await this.confirmEnableBtn.click();
381
+ }
382
+ async insertDictionaryItem(dictionaryName) {
383
+ await this.clickInsertButton();
384
+ await (0, test_1.expect)(this.insertDictionaryItemBtn).toBeVisible();
385
+ await this.insertDictionaryItemBtn.click();
386
+ await (0, test_1.expect)(this.page.getByLabel(dictionaryName)).toBeVisible();
91
387
  await this.page.getByLabel(dictionaryName).click();
92
- await this.submitBtn.click();
388
+ await this.chooseBtn.click();
389
+ }
390
+ async addQueryBuilderWithOrderByStatement(propertyAlias, isAscending) {
391
+ await (0, test_1.expect)(this.queryBuilderBtn).toBeVisible({ timeout: 10000 });
392
+ await this.queryBuilderBtn.click();
393
+ await (0, test_1.expect)(this.orderByPropertyAliasBtn).toBeVisible();
394
+ await this.orderByPropertyAliasBtn.click();
395
+ // Wait and choose property alias option
396
+ await this.waitAndSelectQueryBuilderDropDownList(propertyAlias);
397
+ // Click to acending button if isAcsending is false
398
+ if (!isAscending) {
399
+ await this.ascendingBtn.click();
400
+ }
93
401
  }
94
- async addQueryBuilderWithCreateDateOption() {
402
+ async addQueryBuilderWithWhereStatement(propertyAlias, operator, constrainValue) {
403
+ await (0, test_1.expect)(this.queryBuilderBtn).toBeVisible({ timeout: 10000 });
95
404
  await this.queryBuilderBtn.click({ force: true });
96
- await this.page.waitForTimeout(1000);
97
- await this.queryBuilderOrderedBy.click({ force: true });
98
- await this.page.waitForTimeout(1000);
99
- await this.queryBuilderCreateDate.click({ force: true });
100
- await this.submitBtn.click({ force: true });
405
+ // Wait and choose property alias
406
+ await (0, test_1.expect)(this.wherePropertyAliasBtn).toBeVisible();
407
+ await this.wherePropertyAliasBtn.click();
408
+ await this.waitAndSelectQueryBuilderDropDownList(propertyAlias);
409
+ // Wait and choose operator
410
+ await (0, test_1.expect)(this.whereOperatorBtn).toBeVisible();
411
+ await this.whereOperatorBtn.click();
412
+ await this.waitAndSelectQueryBuilderDropDownList(operator);
413
+ // Wait and choose constrain value and press Enter
414
+ await (0, test_1.expect)(this.whereConstrainValueTxt).toBeVisible();
415
+ await this.whereConstrainValueTxt.clear();
416
+ await this.whereConstrainValueTxt.fill(constrainValue);
417
+ await this.whereConstrainValueTxt.press('Enter');
418
+ }
419
+ async waitAndSelectQueryBuilderDropDownList(option) {
420
+ const ddlOption = this.page.locator('[open]').locator('uui-combobox-list-option').filter({ hasText: option }).first();
421
+ await (0, test_1.expect)(ddlOption).toBeVisible({ timeout: 10000 });
422
+ await ddlOption.click();
423
+ }
424
+ async createFolder(folderName) {
425
+ await this.clickCreateButton();
426
+ await this.clickNewFolderThreeDotsButton();
427
+ await this.enterFolderName(folderName);
428
+ await this.clickConfirmCreateFolderButton();
429
+ }
430
+ async deletePropertyEditor(propertyEditorName) {
431
+ // We need to hover over the property to be able to see the delete button
432
+ await this.page.locator('uui-button').filter({ hasText: propertyEditorName }).getByLabel('Editor settings').hover();
433
+ await this.deleteLabelBtn.click();
434
+ }
435
+ async enterFolderName(folderName) {
436
+ await this.folderNameTxt.clear();
437
+ await this.folderNameTxt.fill(folderName);
438
+ }
439
+ async isTextWithExactNameVisible(name, isVisible = true) {
440
+ return (0, test_1.expect)(this.page.getByText(name, { exact: true })).toBeVisible({ visible: isVisible });
441
+ }
442
+ async isQueryBuilderCodeShown(code) {
443
+ await (0, test_1.expect)(this.queryBuilderShowCode).toBeVisible();
444
+ await this.queryBuilderShowCode.click();
445
+ await (0, test_1.expect)(this.queryBuilderShowCode).toContainText(code, { timeout: 10000 });
101
446
  }
102
447
  async deleteFolder() {
103
448
  await this.clickDeleteFolderButton();
104
449
  await this.clickConfirmToDeleteButton();
105
450
  }
106
- async isTreeItemVisible(name) {
107
- await (0, test_1.expect)(this.page.locator('umb-tree-item').locator('[label="' + name + '"] ')).toBeVisible();
451
+ async clickDeleteExactLabel() {
452
+ await this.deleteExactLabelBtn.click();
453
+ }
454
+ async clickDeleteExactButton() {
455
+ await this.deleteExactBtn.click();
108
456
  }
109
- async goToSection(sectionName) {
110
- for (let section in ConstantHelper_1.ConstantHelper.sections) {
111
- await (0, test_1.expect)(this.page.getByRole('tab', { name: section })).toBeVisible();
457
+ async isTreeItemVisible(name, isVisible = true) {
458
+ await (0, test_1.expect)(this.page.locator('umb-tree-item').locator('[label="' + name + '"]')).toBeVisible({ visible: isVisible });
459
+ }
460
+ async doesTreeItemHaveTheCorrectIcon(name, icon) {
461
+ return await (0, test_1.expect)(this.page.locator('umb-tree-item').filter({ hasText: name }).locator('umb-icon').locator('[name="' + icon + '"]')).toBeVisible();
462
+ }
463
+ async goToSection(sectionName, checkSections = true) {
464
+ if (checkSections) {
465
+ for (let section in ConstantHelper_1.ConstantHelper.sections) {
466
+ await (0, test_1.expect)(this.backOfficeHeader.getByRole('tab', { name: ConstantHelper_1.ConstantHelper.sections[section] })).toBeVisible({ timeout: 30000 });
467
+ }
112
468
  }
113
- await this.page.getByRole('tab', { name: sectionName }).click();
469
+ await this.backOfficeHeader.getByRole('tab', { name: sectionName }).click();
470
+ }
471
+ async goToSettingsTreeItem(settingsTreeItemName) {
472
+ await this.goToSection(ConstantHelper_1.ConstantHelper.sections.settings);
473
+ await this.page.getByLabel(settingsTreeItemName, { exact: true }).click();
474
+ }
475
+ async clickDataElement(elementName, options = null) {
476
+ await this.page.click(`[data-element="${elementName}"]`, options);
477
+ }
478
+ async getDataElement(elementName) {
479
+ return this.page.locator(`[data-element="${elementName}"]`);
480
+ }
481
+ async isButtonWithNameVisible(name) {
482
+ await (0, test_1.expect)(this.page.getByRole('button', { name: name })).toBeVisible();
483
+ }
484
+ async clickLabelWithName(name, isExact = true, toForce = false) {
485
+ await (0, test_1.expect)(this.page.getByLabel(name, { exact: isExact })).toBeVisible();
486
+ await this.page.getByLabel(name, { exact: isExact }).click({ force: toForce });
487
+ }
488
+ async clickButtonWithName(name, isExact = false) {
489
+ await this.page.getByRole('button', { name: name, exact: isExact }).click();
490
+ }
491
+ async isSuccessNotificationVisible(isVisible = true) {
492
+ return await (0, test_1.expect)(this.successNotification.first()).toBeVisible({ visible: isVisible });
493
+ }
494
+ async doesSuccessNotificationsHaveCount(count) {
495
+ return await (0, test_1.expect)(this.successNotification).toHaveCount(count);
496
+ }
497
+ async isErrorNotificationVisible(isVisible = true) {
498
+ return await (0, test_1.expect)(this.errorNotification.first()).toBeVisible({ visible: isVisible });
499
+ }
500
+ async isTextWithMessageVisible(message, isVisible = true) {
501
+ return await (0, test_1.expect)(this.page.getByText(message)).toBeVisible({ visible: isVisible });
502
+ }
503
+ async clickCreateThreeDotsButton() {
504
+ await this.createThreeDotsBtn.click();
505
+ }
506
+ async clickCreateButton(toForceClick = false) {
507
+ await (0, test_1.expect)(this.createBtn).toBeVisible();
508
+ await this.createBtn.click({ force: toForceClick });
509
+ }
510
+ async clickAddButton() {
511
+ await this.addBtn.click();
512
+ }
513
+ ;
514
+ async clickNewFolderThreeDotsButton() {
515
+ await this.newFolderThreeDotsBtn.click();
516
+ }
517
+ async clickEditorSettingsButton(index = 0) {
518
+ return this.editorSettingsBtn.nth(index).click();
519
+ }
520
+ async enterDescription(description) {
521
+ await this.enterDescriptionTxt.fill(description);
522
+ }
523
+ async doesDescriptionHaveValue(value, index = 0) {
524
+ return await (0, test_1.expect)(this.descriptionBtn.nth(index)).toHaveValue(value);
525
+ }
526
+ async clickStructureTab() {
527
+ await this.page.waitForTimeout(1000);
528
+ await this.structureTabBtn.waitFor({ state: 'visible' });
529
+ await this.structureTabBtn.click();
530
+ }
531
+ async clickAllowAtRootButton() {
532
+ await this.allowAtRootBtn.click();
533
+ }
534
+ async clickIAmDoneReorderingButton() {
535
+ await this.iAmDoneReorderingBtn.click();
536
+ }
537
+ async clickReorderButton() {
538
+ await this.reorderBtn.click();
539
+ }
540
+ async clickLabelAboveButton() {
541
+ await this.labelAboveBtn.click();
542
+ }
543
+ async clickMandatorySlider() {
544
+ await this.mandatorySlider.click();
545
+ }
546
+ async selectValidationOption(option) {
547
+ await this.validation.selectOption(option);
548
+ }
549
+ async enterRegEx(regEx) {
550
+ await this.regexTxt.fill(regEx);
551
+ }
552
+ async enterRegExMessage(regExMessage) {
553
+ await this.regexMessageTxt.fill(regExMessage);
554
+ }
555
+ async clickCompositionsButton() {
556
+ await this.compositionsBtn.click();
557
+ }
558
+ async clickAddTabButton() {
559
+ await this.addTabBtn.click();
560
+ }
561
+ async enterTabName(tabName) {
562
+ await (0, test_1.expect)(this.unnamedTxt).toBeVisible();
563
+ await this.page.waitForTimeout(400);
564
+ await this.unnamedTxt.clear();
565
+ await this.unnamedTxt.fill(tabName);
566
+ }
567
+ async searchForTypeToFilterValue(searchValue) {
568
+ await (0, test_1.expect)(this.typeToFilterSearchTxt).toBeVisible();
569
+ await this.typeToFilterSearchTxt.fill(searchValue);
570
+ }
571
+ async addPropertyEditor(propertyEditorName, index = 0) {
572
+ await (0, test_1.expect)(this.addPropertyBtn.nth(index)).toBeVisible();
573
+ await this.addPropertyBtn.nth(index).click();
574
+ await this.enterAPropertyName(propertyEditorName);
575
+ await (0, test_1.expect)(this.propertyNameTxt).toHaveValue(propertyEditorName);
576
+ await this.clickSelectPropertyEditorButton();
577
+ await this.searchForTypeToFilterValue(propertyEditorName);
578
+ await this.page.getByText(propertyEditorName, { exact: true }).click();
579
+ await this.clickSubmitButton();
580
+ }
581
+ async updatePropertyEditor(propertyEditorName) {
582
+ await this.clickEditorSettingsButton();
583
+ await this.clickChangeButton();
584
+ await this.searchForTypeToFilterValue(propertyEditorName);
585
+ await this.page.getByText(propertyEditorName, { exact: true }).click();
586
+ await this.enterAPropertyName(propertyEditorName);
587
+ await this.clickSubmitButton();
588
+ }
589
+ async enterPropertyEditorDescription(description) {
590
+ await this.enterPropertyEditorDescriptionTxt.fill(description);
591
+ }
592
+ async clickAddGroupButton() {
593
+ await this.addGroupBtn.click();
594
+ }
595
+ async clickChooseModalButton() {
596
+ await this.chooseModalBtn.click();
597
+ }
598
+ async enterGroupName(groupName, index = 0) {
599
+ await this.page.waitForTimeout(200);
600
+ const groupNameTxt = this.groupLabel.nth(index);
601
+ await (0, test_1.expect)(groupNameTxt).toBeVisible();
602
+ await groupNameTxt.clear();
603
+ await groupNameTxt.fill(groupName);
604
+ }
605
+ async isGroupVisible(groupName, isVisible = true) {
606
+ await (0, test_1.expect)(this.groupLabel.filter({ hasText: groupName })).toBeVisible({ visible: isVisible });
607
+ }
608
+ async doesGroupHaveValue(value) {
609
+ await (0, test_1.expect)(this.groupLabel).toBeVisible();
610
+ return await (0, test_1.expect)(this.groupLabel).toHaveValue(value);
611
+ }
612
+ async rename(newName) {
613
+ await this.clickRenameButton();
614
+ await (0, test_1.expect)(this.newNameTxt).toBeVisible();
615
+ await this.newNameTxt.click();
616
+ await this.newNameTxt.clear();
617
+ await this.newNameTxt.fill(newName);
618
+ await this.renameModalBtn.click();
619
+ }
620
+ async isSuccessButtonWithTextVisible(text) {
621
+ return await (0, test_1.expect)(this.successState.filter({ hasText: text })).toBeVisible();
622
+ }
623
+ async dragAndDrop(dragFromSelector, dragToSelector, verticalOffset = 0, horizontalOffset = 0, steps = 5) {
624
+ await (0, test_1.expect)(dragFromSelector).toBeVisible();
625
+ await (0, test_1.expect)(dragToSelector).toBeVisible();
626
+ const targetLocation = await dragToSelector.boundingBox();
627
+ const elementCenterX = targetLocation.x + targetLocation.width / 2;
628
+ const elementCenterY = targetLocation.y + targetLocation.height / 2;
629
+ await dragFromSelector.hover();
630
+ await this.page.mouse.move(10, 10);
631
+ await dragFromSelector.hover();
632
+ await this.page.mouse.down();
633
+ await this.page.waitForTimeout(400);
634
+ await this.page.mouse.move(elementCenterX + horizontalOffset, elementCenterY + verticalOffset, { steps: steps });
635
+ await this.page.waitForTimeout(400);
636
+ await this.page.mouse.up();
637
+ }
638
+ async clickCreateLink() {
639
+ await this.createLink.click();
640
+ }
641
+ async insertSystemFieldValue(fieldValue) {
642
+ await this.clickInsertButton();
643
+ await (0, test_1.expect)(this.insertValueBtn).toBeVisible();
644
+ await this.insertValueBtn.click();
645
+ await (0, test_1.expect)(this.chooseFieldDropDown).toBeVisible();
646
+ await this.chooseFieldDropDown.click();
647
+ await this.systemFieldsOption.click();
648
+ await this.chooseFieldValueDropDown.click();
649
+ await this.page.getByText(fieldValue).click();
650
+ await this.clickSubmitButton();
651
+ }
652
+ async insertPartialView(partialViewName) {
653
+ await this.clickInsertButton();
654
+ await (0, test_1.expect)(this.insertPartialViewBtn).toBeVisible();
655
+ await this.insertPartialViewBtn.click();
656
+ await (0, test_1.expect)(this.page.getByLabel(partialViewName)).toBeVisible();
657
+ await this.page.getByLabel(partialViewName).click();
658
+ await this.chooseBtn.click();
659
+ }
660
+ async deletePropertyEditorWithName(name) {
661
+ // We need to hover over the Property Editor to make the delete button visible
662
+ const propertyEditor = this.page.locator('umb-content-type-design-editor-property', { hasText: name });
663
+ await propertyEditor.hover();
664
+ await propertyEditor.getByLabel('Delete').click({ force: true });
665
+ await this.clickConfirmToDeleteButton();
666
+ }
667
+ async clickRenameButton() {
668
+ await this.renameBtn.click();
669
+ }
670
+ async clickDeleteAndConfirmButton() {
671
+ await this.clickDeleteExactLabel();
672
+ await this.clickConfirmToDeleteButton();
673
+ }
674
+ async clickQueryBuilderButton() {
675
+ await this.queryBuilderBtn.click();
676
+ }
677
+ async chooseRootContentInQueryBuilder(contentName) {
678
+ await (0, test_1.expect)(this.chooseRootContentBtn).toBeVisible();
679
+ await this.chooseRootContentBtn.click();
680
+ await (0, test_1.expect)(this.page.getByText(contentName)).toBeVisible();
681
+ await this.page.getByText(contentName).click();
682
+ await this.chooseBtn.click();
683
+ }
684
+ async reorderTwoGroups() {
685
+ const firstGroup = this.typeGroups.nth(0);
686
+ const secondGroup = this.typeGroups.nth(1);
687
+ const firstGroupValue = await firstGroup.getByLabel('Group', { exact: true }).inputValue();
688
+ const secondGroupValue = await secondGroup.getByLabel('Group', { exact: true }).inputValue();
689
+ const dragToLocator = firstGroup.locator('[name="icon-navigation"]').first();
690
+ const dragFromLocator = secondGroup.locator('[name="icon-navigation"]').first();
691
+ await this.dragAndDrop(dragFromLocator, dragToLocator, 0, 0, 10);
692
+ return { firstGroupValue, secondGroupValue };
693
+ }
694
+ async clickAllowedChildNodesButton() {
695
+ await this.allowedChildNodesModal.locator(this.chooseBtn).click();
696
+ }
697
+ async clickConfigureAsACollectionButton() {
698
+ await this.configureAsACollectionBtn.click();
699
+ }
700
+ async doesReturnedItemsHaveCount(itemCount) {
701
+ await (0, test_1.expect)(this.returnedItemsCount).toContainText(itemCount.toString() + ' items returned');
702
+ }
703
+ async doesQueryResultHaveContentName(contentName) {
704
+ await (0, test_1.expect)(this.queryBuilderShowCode).toContainText(contentName);
705
+ }
706
+ async deleteGroup(groupName, toForceClick = false) {
707
+ await this.page.waitForTimeout(1000);
708
+ const groups = this.page.locator('umb-content-type-design-editor-group').all();
709
+ for (const group of await groups) {
710
+ if (await group.getByLabel('Group', { exact: true }).inputValue() === groupName) {
711
+ await group.locator('[slot="header-actions"]').getByLabel('Delete').click({ force: toForceClick });
712
+ return;
713
+ }
714
+ }
715
+ }
716
+ async clickRemoveTabWithName(name) {
717
+ await this.page.locator('[label="' + name + '"] [label="Remove"]').click();
718
+ }
719
+ async clickLeftArrowButton() {
720
+ await this.leftArrowBtn.click();
721
+ }
722
+ async clickToUploadButton() {
723
+ await this.clickToUploadBtn.click();
724
+ }
725
+ async uploadFile(filePath) {
726
+ const fileChooserPromise = this.page.waitForEvent('filechooser');
727
+ await this.clickToUploadButton();
728
+ const fileChooser = await fileChooserPromise;
729
+ await fileChooser.setFiles(filePath);
730
+ }
731
+ getTabLocatorWithName(name) {
732
+ return this.page.getByRole('tab', { name: name });
733
+ }
734
+ getTextLocatorWithName(name) {
735
+ return this.page.getByText(name, { exact: true });
736
+ }
737
+ async isFailedStateButtonVisible() {
738
+ await (0, test_1.expect)(this.failedStateButton).toBeVisible();
739
+ }
740
+ async clickContainerSaveAndPublishButton() {
741
+ await this.containerSaveAndPublishBtn.click();
742
+ }
743
+ async clickConfirmTrashButton() {
744
+ await this.confirmTrashBtn.click();
745
+ }
746
+ async reloadRecycleBin(containsItems = true) {
747
+ // We need to wait to be sure that the item is visible after reload
748
+ await (0, test_1.expect)(this.recycleBinMenuItem).toBeVisible();
749
+ await this.clickActionsMenuForName('Recycle Bin');
750
+ await this.clickReloadButton();
751
+ await (0, test_1.expect)(this.recycleBinMenuItem).toBeVisible();
752
+ // 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
753
+ if (!containsItems) {
754
+ await (0, test_1.expect)(this.recycleBinMenuItemCaretBtn).not.toBeVisible();
755
+ return;
756
+ }
757
+ await (0, test_1.expect)(this.recycleBinMenuItemCaretBtn).toBeVisible();
758
+ const isCaretButtonOpen = await this.recycleBinMenuItem.getAttribute('show-children');
759
+ if (isCaretButtonOpen === null) {
760
+ // We need to wait before clicking the caret button. Because the reload might not have happened yet.
761
+ await this.clickCaretButtonForName('Recycle Bin');
762
+ }
763
+ }
764
+ async clickRecycleBinButton() {
765
+ await this.recycleBinBtn.click();
766
+ }
767
+ async isItemVisibleInRecycleBin(item, isVisible = true, isReload = true) {
768
+ if (isReload) {
769
+ await this.reloadRecycleBin(isVisible);
770
+ }
771
+ return (0, test_1.expect)(this.page.locator('[label="Recycle Bin"] [label="' + item + '"]')).toBeVisible({ visible: isVisible });
772
+ }
773
+ async changeToGridView() {
774
+ await this.viewBundleBtn.click();
775
+ await this.gridBtn.click();
776
+ }
777
+ async changeToListView() {
778
+ await this.viewBundleBtn.click();
779
+ await this.listBtn.click();
780
+ }
781
+ async isViewBundleButtonVisible(isVisible = true) {
782
+ return (0, test_1.expect)(this.viewBundleBtn).toBeVisible({ visible: isVisible });
783
+ }
784
+ async doesSuccessNotificationHaveText(text) {
785
+ return await (0, test_1.expect)(this.successNotification.filter({ hasText: text })).toBeVisible();
786
+ }
787
+ async doesErrorNotificationHaveText(text) {
788
+ return await (0, test_1.expect)(this.errorNotification.filter({ hasText: text })).toBeVisible();
789
+ }
790
+ async isSectionWithNameVisible(sectionName, isVisible = true) {
791
+ return (0, test_1.expect)(this.page.getByRole('tab', { name: sectionName })).toBeVisible({ visible: isVisible });
114
792
  }
115
793
  }
116
794
  exports.UiBaseLocators = UiBaseLocators;