@umbraco/playwright-testhelpers 2.0.0-beta.41 → 2.0.0-beta.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/helpers/ConstantHelper.d.ts +1 -1
- package/dist/lib/helpers/ConstantHelper.js +1 -1
- package/dist/lib/helpers/ConstantHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentTypeApiHelper.d.ts +10 -1
- package/dist/lib/helpers/DocumentTypeApiHelper.js +193 -4
- package/dist/lib/helpers/DocumentTypeApiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentTypeUiHelper.d.ts +23 -0
- package/dist/lib/helpers/DocumentTypeUiHelper.js +69 -0
- package/dist/lib/helpers/DocumentTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/MemberGroupUiHelper.d.ts +0 -2
- package/dist/lib/helpers/MemberGroupUiHelper.js +0 -5
- package/dist/lib/helpers/MemberGroupUiHelper.js.map +1 -1
- package/dist/lib/helpers/{DictionaryUiHelper.d.ts → TranslationUiHelper.d.ts} +5 -4
- package/dist/lib/helpers/{DictionaryUiHelper.js → TranslationUiHelper.js} +31 -23
- package/dist/lib/helpers/TranslationUiHelper.js.map +1 -0
- package/dist/lib/helpers/UiBaseLocators.d.ts +11 -2
- package/dist/lib/helpers/UiBaseLocators.js +41 -8
- package/dist/lib/helpers/UiBaseLocators.js.map +1 -1
- package/dist/lib/helpers/UiHelpers.d.ts +2 -2
- package/dist/lib/helpers/UiHelpers.js +3 -3
- package/dist/lib/helpers/UiHelpers.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/lib/helpers/DictionaryUiHelper.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConstantHelper.js","sourceRoot":"","sources":["../../../lib/helpers/ConstantHelper.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;IAElB,MAAM,CAAU,QAAQ,GAAG;QAChC,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,SAAS;QAClB,
|
|
1
|
+
{"version":3,"file":"ConstantHelper.js","sourceRoot":"","sources":["../../../lib/helpers/ConstantHelper.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;IAElB,MAAM,CAAU,QAAQ,GAAG;QAChC,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,SAAS;QAClB,WAAW,EAAE,aAAa;QAC1B,KAAK,EAAE,OAAO;KACf,CAAA;;AAVH,wCAWC","sourcesContent":["export class ConstantHelper {\n\n public static readonly sections = {\n content: \"Content\",\n media: \"Media\",\n settings: \"Settings\",\n packages: \"Packages\",\n members: \"Members\",\n translation: \"Translation\",\n users: \"Users\"\n }\n}"]}
|
|
@@ -14,12 +14,21 @@ export declare class DocumentTypeApiHelper {
|
|
|
14
14
|
delete(id: string): Promise<number | undefined>;
|
|
15
15
|
getFolder(id: string): Promise<any>;
|
|
16
16
|
deleteFolder(id: string): Promise<import("playwright-core").APIResponse>;
|
|
17
|
-
createFolder(name: string, parentId?: string): Promise<
|
|
17
|
+
createFolder(name: string, parentId?: string): Promise<string | undefined>;
|
|
18
18
|
renameFolder(folderId: string, folderName: string): Promise<import("playwright-core").APIResponse>;
|
|
19
19
|
createDefaultDocumentType(documentTypeName: string): Promise<string | undefined>;
|
|
20
20
|
createDocumentTypeWithPropertyEditor(documentTypeName: string, dataTypeName: string, dataTypeId: string, groupName?: string, varyByCulture?: boolean): Promise<string | undefined>;
|
|
21
|
+
createDocumentTypeWithPropertyEditorInTab(documentTypeName: string, dataTypeName: string, dataTypeId: string, tabName: string, groupName?: string, varyByCulture?: boolean): Promise<string | undefined>;
|
|
21
22
|
createDocumentTypeWithTwoPropertyEditors(documentTypeName: string, dataTypeNameOne: string, dataTypeIdOne: string, dataTypeNameTwo: string, dataTypeIdTwo: string, groupName?: string): Promise<string | undefined>;
|
|
22
23
|
createDefaultDocumentTypeWithAllowAsRoot(documentTypeName: string): Promise<string | undefined>;
|
|
23
24
|
createDocumentTypeWithAllowedChildNode(documentTypeName: string, allowedChildNodeId: string): Promise<string | undefined>;
|
|
24
25
|
createDocumentTypeWithAllowedTemplate(documentTypeName: string, allowedTemplateId: string): Promise<string | undefined>;
|
|
26
|
+
createDocumentTypeWithTwoGroups(documentTypeName: string, dataType: string, dataTypeId: string, groupNameOne: string, groupNameTwo: string): Promise<string | undefined>;
|
|
27
|
+
createDocumentTypeWithAComposition(documentTypeName: string, compositionId: string): Promise<string | undefined>;
|
|
28
|
+
createDocumentTypeWithTwoTabs(documentTypeName: string, dataType: string, dataTypeId: string, tabNameOne: string, tabNameTwo: string): Promise<string | undefined>;
|
|
29
|
+
doesGroupContainCorrectPropertyEditor(documentTypeName: string, dataTypeName: string, dataTypeId: string, groupName: string): Promise<any>;
|
|
30
|
+
doesTabContainCorrectPropertyEditorInGroup(documentTypeName: string, dataTypeName: string, dataTypeId: string, tabName: string, groupName: string): Promise<any>;
|
|
31
|
+
doesDocumentTypeGroupNameContainCorrectSortOrder(documentTypeName: string, groupName: string, sortOrder: number): Promise<boolean>;
|
|
32
|
+
doesDocumentTypeTabNameContainCorrectSortOrder(documentTypeName: string, tabName: string, sortOrder: number): Promise<boolean>;
|
|
33
|
+
getContainerIdWithName(documentTypeName: string, containerName: string): Promise<any>;
|
|
25
34
|
}
|
|
@@ -126,9 +126,10 @@ class DocumentTypeApiHelper {
|
|
|
126
126
|
async createFolder(name, parentId) {
|
|
127
127
|
const folder = {
|
|
128
128
|
name: name,
|
|
129
|
-
parentId: parentId
|
|
129
|
+
parent: parentId ? { id: parentId } : null
|
|
130
130
|
};
|
|
131
|
-
|
|
131
|
+
const response = await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/document-type/folder', folder);
|
|
132
|
+
return response.headers().location.split("/").pop();
|
|
132
133
|
}
|
|
133
134
|
async renameFolder(folderId, folderName) {
|
|
134
135
|
const folder = {
|
|
@@ -143,7 +144,7 @@ class DocumentTypeApiHelper {
|
|
|
143
144
|
.build();
|
|
144
145
|
return await this.create(documentType);
|
|
145
146
|
}
|
|
146
|
-
async createDocumentTypeWithPropertyEditor(documentTypeName, dataTypeName, dataTypeId, groupName = "
|
|
147
|
+
async createDocumentTypeWithPropertyEditor(documentTypeName, dataTypeName, dataTypeId, groupName = "TestGroup", varyByCulture = false) {
|
|
147
148
|
const crypto = require('crypto');
|
|
148
149
|
const containerId = crypto.randomUUID();
|
|
149
150
|
const documentType = new json_models_builders_1.DocumentTypeBuilder()
|
|
@@ -164,7 +165,35 @@ class DocumentTypeApiHelper {
|
|
|
164
165
|
.build();
|
|
165
166
|
return await this.create(documentType);
|
|
166
167
|
}
|
|
167
|
-
async
|
|
168
|
+
async createDocumentTypeWithPropertyEditorInTab(documentTypeName, dataTypeName, dataTypeId, tabName, groupName = "TestGroup", varyByCulture = false) {
|
|
169
|
+
const crypto = require('crypto');
|
|
170
|
+
const tabId = crypto.randomUUID();
|
|
171
|
+
const groupId = crypto.randomUUID();
|
|
172
|
+
const documentType = new json_models_builders_1.DocumentTypeBuilder()
|
|
173
|
+
.withName(documentTypeName)
|
|
174
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(documentTypeName))
|
|
175
|
+
.addContainer()
|
|
176
|
+
.withName(tabName)
|
|
177
|
+
.withId(tabId)
|
|
178
|
+
.withType("Tab")
|
|
179
|
+
.done()
|
|
180
|
+
.addContainer()
|
|
181
|
+
.withName(groupName)
|
|
182
|
+
.withId(groupId)
|
|
183
|
+
.withType("Group")
|
|
184
|
+
.withParentId(tabId)
|
|
185
|
+
.done()
|
|
186
|
+
.addProperty()
|
|
187
|
+
.withContainerId(groupId)
|
|
188
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(dataTypeName))
|
|
189
|
+
.withName(dataTypeName)
|
|
190
|
+
.withDataTypeId(dataTypeId)
|
|
191
|
+
.done()
|
|
192
|
+
.withVariesByCulture(varyByCulture)
|
|
193
|
+
.build();
|
|
194
|
+
return await this.create(documentType);
|
|
195
|
+
}
|
|
196
|
+
async createDocumentTypeWithTwoPropertyEditors(documentTypeName, dataTypeNameOne, dataTypeIdOne, dataTypeNameTwo, dataTypeIdTwo, groupName = "TestGroup") {
|
|
168
197
|
const crypto = require('crypto');
|
|
169
198
|
const containerId = crypto.randomUUID();
|
|
170
199
|
const documentType = new json_models_builders_1.DocumentTypeBuilder()
|
|
@@ -222,6 +251,166 @@ class DocumentTypeApiHelper {
|
|
|
222
251
|
.build();
|
|
223
252
|
return await this.create(documentType);
|
|
224
253
|
}
|
|
254
|
+
async createDocumentTypeWithTwoGroups(documentTypeName, dataType, dataTypeId, groupNameOne, groupNameTwo) {
|
|
255
|
+
const crypto = require('crypto');
|
|
256
|
+
const groupOneId = crypto.randomUUID();
|
|
257
|
+
const groupTwoId = crypto.randomUUID();
|
|
258
|
+
const documentType = new json_models_builders_1.DocumentTypeBuilder()
|
|
259
|
+
.withName(documentTypeName)
|
|
260
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(documentTypeName))
|
|
261
|
+
.addContainer()
|
|
262
|
+
.withName(groupNameOne)
|
|
263
|
+
.withId(groupOneId)
|
|
264
|
+
.withType("Group")
|
|
265
|
+
.withSortOrder(0)
|
|
266
|
+
.done()
|
|
267
|
+
.addContainer()
|
|
268
|
+
.withName(groupNameTwo)
|
|
269
|
+
.withId(groupTwoId)
|
|
270
|
+
.withType("Group")
|
|
271
|
+
.withSortOrder(1)
|
|
272
|
+
.done()
|
|
273
|
+
.addProperty()
|
|
274
|
+
.withContainerId(groupOneId)
|
|
275
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(dataType + "One"))
|
|
276
|
+
.withName(dataType + "One")
|
|
277
|
+
.withDataTypeId(dataTypeId)
|
|
278
|
+
.done()
|
|
279
|
+
.addProperty()
|
|
280
|
+
.withContainerId(groupTwoId)
|
|
281
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(dataType + "Two"))
|
|
282
|
+
.withName(dataType + "Two")
|
|
283
|
+
.withDataTypeId(dataTypeId)
|
|
284
|
+
.done()
|
|
285
|
+
.build();
|
|
286
|
+
return await this.create(documentType);
|
|
287
|
+
}
|
|
288
|
+
async createDocumentTypeWithAComposition(documentTypeName, compositionId) {
|
|
289
|
+
const documentType = new json_models_builders_1.DocumentTypeBuilder()
|
|
290
|
+
.withName(documentTypeName)
|
|
291
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(documentTypeName))
|
|
292
|
+
.addComposition()
|
|
293
|
+
.withDocumentTypeId(compositionId)
|
|
294
|
+
.done()
|
|
295
|
+
.build();
|
|
296
|
+
return await this.create(documentType);
|
|
297
|
+
}
|
|
298
|
+
async createDocumentTypeWithTwoTabs(documentTypeName, dataType, dataTypeId, tabNameOne, tabNameTwo) {
|
|
299
|
+
const crypto = require('crypto');
|
|
300
|
+
const tabOneId = crypto.randomUUID();
|
|
301
|
+
const tabTwoId = crypto.randomUUID();
|
|
302
|
+
const groupOneId = crypto.randomUUID();
|
|
303
|
+
const groupTwoId = crypto.randomUUID();
|
|
304
|
+
const documentType = new json_models_builders_1.DocumentTypeBuilder()
|
|
305
|
+
.withName(documentTypeName)
|
|
306
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(documentTypeName))
|
|
307
|
+
.addContainer()
|
|
308
|
+
.withName(tabNameOne)
|
|
309
|
+
.withId(tabOneId)
|
|
310
|
+
.withType("Tab")
|
|
311
|
+
.withSortOrder(0)
|
|
312
|
+
.done()
|
|
313
|
+
.addContainer()
|
|
314
|
+
.withName(tabNameTwo)
|
|
315
|
+
.withId(tabTwoId)
|
|
316
|
+
.withType("Tab")
|
|
317
|
+
.withSortOrder(1)
|
|
318
|
+
.done()
|
|
319
|
+
.addContainer()
|
|
320
|
+
.withName("GroupTestOne")
|
|
321
|
+
.withId(groupOneId)
|
|
322
|
+
.withType("Group")
|
|
323
|
+
.withParentId(tabOneId)
|
|
324
|
+
.done()
|
|
325
|
+
.addProperty()
|
|
326
|
+
.withContainerId(groupOneId)
|
|
327
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(dataType + "One"))
|
|
328
|
+
.withName(dataType + "One")
|
|
329
|
+
.withDataTypeId(dataTypeId)
|
|
330
|
+
.done()
|
|
331
|
+
.addContainer()
|
|
332
|
+
.withName("GroupTestTwo")
|
|
333
|
+
.withId(groupTwoId)
|
|
334
|
+
.withType("Group")
|
|
335
|
+
.withParentId(tabTwoId)
|
|
336
|
+
.done()
|
|
337
|
+
.addProperty()
|
|
338
|
+
.withContainerId(groupTwoId)
|
|
339
|
+
.withAlias(AliasHelper_1.AliasHelper.toAlias(dataType + "Two"))
|
|
340
|
+
.withName(dataType + "Two")
|
|
341
|
+
.withDataTypeId(dataTypeId)
|
|
342
|
+
.done()
|
|
343
|
+
.build();
|
|
344
|
+
return await this.create(documentType);
|
|
345
|
+
}
|
|
346
|
+
async doesGroupContainCorrectPropertyEditor(documentTypeName, dataTypeName, dataTypeId, groupName) {
|
|
347
|
+
const documentType = await this.getByName(documentTypeName);
|
|
348
|
+
const group = documentType.containers.find(x => x.name === groupName);
|
|
349
|
+
// Check if group is defined
|
|
350
|
+
if (group) {
|
|
351
|
+
// Check if the document type properties include the specified property, and it belongs to the group
|
|
352
|
+
return documentType.properties.find(x => x.name === dataTypeName && x.dataType.id === dataTypeId && x.container.id === group.id);
|
|
353
|
+
}
|
|
354
|
+
else {
|
|
355
|
+
// Group not found
|
|
356
|
+
return false;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
async doesTabContainCorrectPropertyEditorInGroup(documentTypeName, dataTypeName, dataTypeId, tabName, groupName) {
|
|
360
|
+
const documentType = await this.getByName(documentTypeName);
|
|
361
|
+
const tab = documentType.containers.find(x => x.name === tabName);
|
|
362
|
+
// Check if tab is defined
|
|
363
|
+
if (tab) {
|
|
364
|
+
const group = documentType.containers.find(x => x.name === groupName && x.parent.id === tab.id);
|
|
365
|
+
// Check if group is defined
|
|
366
|
+
if (group) {
|
|
367
|
+
// Check if the document type properties include the specified property, and it belongs to the group
|
|
368
|
+
return documentType.properties.find(x => x.name === dataTypeName && x.dataType.id === dataTypeId && x.container.id === group.id);
|
|
369
|
+
}
|
|
370
|
+
else {
|
|
371
|
+
// Group not found
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
// Tab not found
|
|
377
|
+
return false;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
async doesDocumentTypeGroupNameContainCorrectSortOrder(documentTypeName, groupName, sortOrder) {
|
|
381
|
+
const documentType = await this.getByName(documentTypeName);
|
|
382
|
+
const group = documentType.containers.find(x => x.name === groupName);
|
|
383
|
+
// Check if group is defined
|
|
384
|
+
if (group) {
|
|
385
|
+
return group.sortOrder === sortOrder;
|
|
386
|
+
}
|
|
387
|
+
else {
|
|
388
|
+
// Group not found
|
|
389
|
+
return false;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
async doesDocumentTypeTabNameContainCorrectSortOrder(documentTypeName, tabName, sortOrder) {
|
|
393
|
+
const documentType = await this.getByName(documentTypeName);
|
|
394
|
+
const tab = documentType.containers.find(x => x.name === tabName);
|
|
395
|
+
// Check if tab is defined
|
|
396
|
+
if (tab) {
|
|
397
|
+
return tab.sortOrder === sortOrder;
|
|
398
|
+
}
|
|
399
|
+
else {
|
|
400
|
+
// Tab not found
|
|
401
|
+
return false;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
async getContainerIdWithName(documentTypeName, containerName) {
|
|
405
|
+
const documentType = await this.getByName(documentTypeName);
|
|
406
|
+
const container = documentType.containers.find(x => x.name === containerName);
|
|
407
|
+
if (container) {
|
|
408
|
+
return container.id;
|
|
409
|
+
}
|
|
410
|
+
else {
|
|
411
|
+
return null;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
225
414
|
}
|
|
226
415
|
exports.DocumentTypeApiHelper = DocumentTypeApiHelper;
|
|
227
416
|
//# sourceMappingURL=DocumentTypeApiHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentTypeApiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/DocumentTypeApiHelper.ts"],"names":[],"mappings":";;;AACA,wEAAkE;AAClE,+CAA0C;AAE1C,MAAa,qBAAqB;IAChC,GAAG,CAAY;IAEf,YAAY,GAAe;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,IAAY;QACpC,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QACpD,MAAM,iBAAiB,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAEzD,KAAK,MAAM,YAAY,IAAI,iBAAiB,CAAC,KAAK,EAAE;YAClD,IAAI,YAAY,CAAC,IAAI,KAAK,IAAI,EAAE;gBAC9B,IAAI,YAAY,CAAC,QAAQ,EAAE;oBACzB,OAAO,MAAM,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC;iBACvD;gBACD,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;aAC3C;iBAAM,IAAI,YAAY,CAAC,WAAW,EAAE;gBACnC,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;aACzD;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,OAAO,MAAM,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,GAAG,wFAAwF,CAAC,CAAC;IACzI,CAAC;IAEO,KAAK,CAAC,eAAe,CAAC,IAAY,EAAE,EAAU,EAAE,QAAiB;QACvE,MAAM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gB,CAAC,CAAC;QACjD,MAAM,YAAY,GAAG,IAAI,0CAAmB,EAAE;aAC3C,QAAQ,CAAC,gBAAgB,CAAC;aAC1B,SAAS,CAAC,yBAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;aAChD,oBAAoB,EAAE;aACpB,MAAM,CAAC,iBAAiB,CAAC;aACzB,IAAI,EAAE;aACR,KAAK,EAAE,CAAC;QACX,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACzC,CAAC;CACF;AAnPD,sDAmPC","sourcesContent":["import {ApiHelpers} from \"./ApiHelpers\";\nimport {DocumentTypeBuilder} from \"@umbraco/json-models-builders\";\nimport {AliasHelper} from \"./AliasHelper\";\n\nexport class DocumentTypeApiHelper {\n api: ApiHelpers\n\n constructor(api: ApiHelpers) {\n this.api = api;\n }\n\n async ensureNameNotExists(name: string) {\n const rootDocumentTypes = await this.getAllAtRoot();\n const jsonDocumentTypes = await rootDocumentTypes.json();\n\n for (const documentType of jsonDocumentTypes.items) {\n if (documentType.name === name) {\n if (documentType.isFolder) {\n return await this.recurseDeleteChildren(documentType);\n }\n return await this.delete(documentType.id);\n } else if (documentType.hasChildren) {\n await this.recurseChildren(name, documentType.id, true);\n }\n }\n return null;\n }\n\n async getAllAtRoot() {\n return await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/document-type/root?skip=0&take=10000&foldersOnly=false');\n }\n\n private async recurseChildren(name: string, id: string, toDelete: boolean) {\n const items = await this.getChildren(id);\n\n for (const child of items) {\n if (child.name === name) {\n if (!toDelete) {\n if (child.isFolder) {\n return await this.getFolder(child.id);\n }\n return await this.get(child.id);\n }\n if (child.isFolder) {\n return await this.recurseDeleteChildren(child);\n }\n return await this.delete(child.id);\n } else if (child.hasChildren) {\n return await this.recurseChildren(name, child.id, toDelete);\n }\n }\n return false;\n }\n\n private async recurseDeleteChildren(documentTypeFolder) {\n if (!documentTypeFolder.hasChildren) {\n return await this.deleteFolder(documentTypeFolder.id);\n }\n const items = await this.getChildren(documentTypeFolder.id);\n\n for (const child of items) {\n if (child.hasChildren) {\n await this.recurseDeleteChildren(child);\n } else if (child.isFolder) {\n await this.deleteFolder(child.id);\n } else {\n await this.delete(child.id);\n }\n }\n return await this.deleteFolder(documentTypeFolder.id);\n }\n\n async getChildren(id: string) {\n const response = await this.api.get(`${this.api.baseUrl}/umbraco/management/api/v1/tree/document-type/children?parentId=${id}&skip=0&take=10000&foldersOnly=false`);\n const items = await response.json();\n return items.items;\n }\n \n async create(documentType) {\n if (documentType == null) {\n return;\n }\n const response = await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/document-type', documentType)\n return response.headers().location.split(\"/\").pop();\n }\n\n async get(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/document-type/' + id);\n const json = await response.json();\n if (json !== null) {\n return json;\n }\n return null;\n }\n \n async getByName(name: string) {\n const rootDocumentTypes = await this.getAllAtRoot();\n const jsonDocumentTypes = await rootDocumentTypes.json();\n\n for (const documentType of jsonDocumentTypes.items) {\n if (documentType.name === name) {\n if (documentType.isFolder) {\n return this.getFolder(documentType.id);\n }\n return this.get(documentType.id);\n } else if (documentType.hasChildren) {\n const result = await this.recurseChildren(name, documentType.id, false);\n if (result) {\n return result;\n }\n }\n }\n return false;\n }\n \n async doesNameExist(name: string) {\n return await this.getByName(name)\n }\n\n async delete(id: string) {\n if (id == null) {\n return;\n }\n const response = await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/document-type/' + id);\n return response.status();\n }\n\n // FOLDER\n async getFolder(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/document-type/folder/' + id);\n return await response.json();\n }\n\n async deleteFolder(id: string) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/document-type/folder/' + id);\n }\n \n async createFolder(name: string, parentId? : string) {\n const folder = {\n name: name,\n parentId: parentId\n }\n return await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/document-type/folder', folder);\n }\n \n async renameFolder(folderId: string, folderName: string) {\n const folder = {\n name: folderName\n }\n return await this.api.put(this.api.baseUrl + '/umbraco/management/api/v1/document-type/folder/' + folderId, folder);\n }\n \n async createDefaultDocumentType(documentTypeName: string){\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .build();\n return await this.create(documentType);\n }\n \n async createDocumentTypeWithPropertyEditor(documentTypeName: string, dataTypeName: string, dataTypeId: string, groupName: string = \"GroupTest\", varyByCulture: boolean = false) \n {\n const crypto = require('crypto');\n const containerId = crypto.randomUUID();\n\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .addContainer()\n .withName(groupName)\n .withId(containerId)\n .withType(\"Group\")\n .done()\n .addProperty()\n .withContainerId(containerId)\n .withAlias(AliasHelper.toAlias(dataTypeName))\n .withName(dataTypeName)\n .withDataTypeId(dataTypeId)\n .done()\n .withVariesByCulture(varyByCulture)\n .build();\n return await this.create(documentType);\n }\n \n async createDocumentTypeWithTwoPropertyEditors(documentTypeName: string, dataTypeNameOne: string, dataTypeIdOne: string, dataTypeNameTwo: string, dataTypeIdTwo: string, groupName: string = \"GroupTest\")\n {\n const crypto = require('crypto');\n const containerId = crypto.randomUUID();\n\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .addContainer()\n .withName(groupName)\n .withId(containerId)\n .withType(\"Group\")\n .done()\n .addProperty()\n .withContainerId(containerId)\n .withAlias(AliasHelper.toAlias(dataTypeNameOne))\n .withName(dataTypeNameOne)\n .withDataTypeId(dataTypeIdOne)\n .done()\n .addProperty()\n .withContainerId(containerId)\n .withAlias(AliasHelper.toAlias(dataTypeNameTwo))\n .withName(dataTypeNameTwo)\n .withDataTypeId(dataTypeIdTwo)\n .done()\n .build();\n return await this.create(documentType);\n }\n \n async createDefaultDocumentTypeWithAllowAsRoot(documentTypeName: string) {\n await this.ensureNameNotExists(documentTypeName);\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .withAllowedAsRoot(true)\n .build();\n return await this.create(documentType);\n }\n \n async createDocumentTypeWithAllowedChildNode(documentTypeName: string, allowedChildNodeId: string) {\n await this.ensureNameNotExists(documentTypeName);\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .withAllowedAsRoot(true)\n .addAllowedDocumentType()\n .withId(allowedChildNodeId)\n .done()\n .build();\n return await this.create(documentType);\n }\n \n async createDocumentTypeWithAllowedTemplate(documentTypeName: string, allowedTemplateId: string) {\n await this.ensureNameNotExists(documentTypeName);\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .addAllowedTemplateId()\n .withId(allowedTemplateId)\n .done()\n .build();\n return await this.create(documentType);\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"DocumentTypeApiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/DocumentTypeApiHelper.ts"],"names":[],"mappings":";;;AACA,wEAAkE;AAClE,+CAA0C;AAE1C,MAAa,qBAAqB;IAChC,GAAG,CAAY;IAEf,YAAY,GAAe;QACzB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,mBAAmB,CAAC,IAAY;QACpC,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;QACpD,MAAM,iBAAiB,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC;QAEzD,KAAK,MAAM,YAAY,IAAI,iBAAiB,CAAC,KAAK,EAAE;YAClD,IAAI,YAAY,CAAC,IAAI,KAAK,IAAI,EAAE;gBAC9B,IAAI,YAAY,CAAC,QAAQ,EAAE;oBACzB,OAAO,MAAM,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAA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AgB,CAAC,CAAC;QAC5D,MAAM,GAAG,GAAG,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;QAClE,0BAA0B;QAC1B,IAAI,GAAG,EAAE;YACP,OAAO,GAAG,CAAC,SAAS,KAAK,SAAS,CAAC;SACpC;aAAM;YACL,gBAAgB;YAChB,OAAO,KAAK,CAAC;SACd;IACH,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,gBAAwB,EAAE,aAAqB;QAC1E,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QAC5D,MAAM,SAAS,GAAG,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;QAC9E,IAAI,SAAS,EAAE;YACb,OAAO,SAAS,CAAC,EAAE,CAAC;SACrB;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC;CACF;AArbD,sDAqbC","sourcesContent":["import {ApiHelpers} from \"./ApiHelpers\";\nimport {DocumentTypeBuilder} from \"@umbraco/json-models-builders\";\nimport {AliasHelper} from \"./AliasHelper\";\n\nexport class DocumentTypeApiHelper {\n api: ApiHelpers\n\n constructor(api: ApiHelpers) {\n this.api = api;\n }\n\n async ensureNameNotExists(name: string) {\n const rootDocumentTypes = await this.getAllAtRoot();\n const jsonDocumentTypes = await rootDocumentTypes.json();\n\n for (const documentType of jsonDocumentTypes.items) {\n if (documentType.name === name) {\n if (documentType.isFolder) {\n return await this.recurseDeleteChildren(documentType);\n }\n return await this.delete(documentType.id);\n } else if (documentType.hasChildren) {\n await this.recurseChildren(name, documentType.id, true);\n }\n }\n return null;\n }\n\n async getAllAtRoot() {\n return await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/tree/document-type/root?skip=0&take=10000&foldersOnly=false');\n }\n\n private async recurseChildren(name: string, id: string, toDelete: boolean) {\n const items = await this.getChildren(id);\n\n for (const child of items) {\n if (child.name === name) {\n if (!toDelete) {\n if (child.isFolder) {\n return await this.getFolder(child.id);\n }\n return await this.get(child.id);\n }\n if (child.isFolder) {\n return await this.recurseDeleteChildren(child);\n }\n return await this.delete(child.id);\n } else if (child.hasChildren) {\n return await this.recurseChildren(name, child.id, toDelete);\n }\n }\n return false;\n }\n\n private async recurseDeleteChildren(documentTypeFolder) {\n if (!documentTypeFolder.hasChildren) {\n return await this.deleteFolder(documentTypeFolder.id);\n }\n const items = await this.getChildren(documentTypeFolder.id);\n\n for (const child of items) {\n if (child.hasChildren) {\n await this.recurseDeleteChildren(child);\n } else if (child.isFolder) {\n await this.deleteFolder(child.id);\n } else {\n await this.delete(child.id);\n }\n }\n return await this.deleteFolder(documentTypeFolder.id);\n }\n\n async getChildren(id: string) {\n const response = await this.api.get(`${this.api.baseUrl}/umbraco/management/api/v1/tree/document-type/children?parentId=${id}&skip=0&take=10000&foldersOnly=false`);\n const items = await response.json();\n return items.items;\n }\n\n async create(documentType) {\n if (documentType == null) {\n return;\n }\n const response = await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/document-type', documentType)\n return response.headers().location.split(\"/\").pop();\n }\n\n async get(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/document-type/' + id);\n const json = await response.json();\n if (json !== null) {\n return json;\n }\n return null;\n }\n\n async getByName(name: string) {\n const rootDocumentTypes = await this.getAllAtRoot();\n const jsonDocumentTypes = await rootDocumentTypes.json();\n\n for (const documentType of jsonDocumentTypes.items) {\n if (documentType.name === name) {\n if (documentType.isFolder) {\n return this.getFolder(documentType.id);\n }\n return this.get(documentType.id);\n } else if (documentType.hasChildren) {\n const result = await this.recurseChildren(name, documentType.id, false);\n if (result) {\n return result;\n }\n }\n }\n return false;\n }\n\n async doesNameExist(name: string) {\n return await this.getByName(name);\n }\n\n async delete(id: string) {\n if (id == null) {\n return;\n }\n const response = await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/document-type/' + id);\n return response.status();\n }\n\n // FOLDER\n async getFolder(id: string) {\n const response = await this.api.get(this.api.baseUrl + '/umbraco/management/api/v1/document-type/folder/' + id);\n return await response.json();\n }\n\n async deleteFolder(id: string) {\n return await this.api.delete(this.api.baseUrl + '/umbraco/management/api/v1/document-type/folder/' + id);\n }\n\n async createFolder(name: string, parentId?: string) {\n const folder = {\n name: name,\n parent: parentId ? {id: parentId} : null\n\n }\n const response = await this.api.post(this.api.baseUrl + '/umbraco/management/api/v1/document-type/folder', folder);\n return response.headers().location.split(\"/\").pop();\n }\n\n async renameFolder(folderId: string, folderName: string) {\n const folder = {\n name: folderName\n }\n return await this.api.put(this.api.baseUrl + '/umbraco/management/api/v1/document-type/folder/' + folderId, folder);\n }\n\n async createDefaultDocumentType(documentTypeName: string) {\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .build();\n return await this.create(documentType);\n }\n\n async createDocumentTypeWithPropertyEditor(documentTypeName: string, dataTypeName: string, dataTypeId: string, groupName: string = \"TestGroup\", varyByCulture: boolean = false) {\n const crypto = require('crypto');\n const containerId = crypto.randomUUID();\n\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .addContainer()\n .withName(groupName)\n .withId(containerId)\n .withType(\"Group\")\n .done()\n .addProperty()\n .withContainerId(containerId)\n .withAlias(AliasHelper.toAlias(dataTypeName))\n .withName(dataTypeName)\n .withDataTypeId(dataTypeId)\n .done()\n .withVariesByCulture(varyByCulture)\n .build();\n return await this.create(documentType);\n }\n\n async createDocumentTypeWithPropertyEditorInTab(documentTypeName: string, dataTypeName: string, dataTypeId: string, tabName: string, groupName: string = \"TestGroup\", varyByCulture: boolean = false) {\n const crypto = require('crypto');\n const tabId = crypto.randomUUID();\n const groupId = crypto.randomUUID();\n\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .addContainer()\n .withName(tabName)\n .withId(tabId)\n .withType(\"Tab\")\n .done()\n .addContainer()\n .withName(groupName)\n .withId(groupId)\n .withType(\"Group\")\n .withParentId(tabId)\n .done()\n .addProperty()\n .withContainerId(groupId)\n .withAlias(AliasHelper.toAlias(dataTypeName))\n .withName(dataTypeName)\n .withDataTypeId(dataTypeId)\n .done()\n .withVariesByCulture(varyByCulture)\n .build();\n return await this.create(documentType);\n }\n\n async createDocumentTypeWithTwoPropertyEditors(documentTypeName: string, dataTypeNameOne: string, dataTypeIdOne: string, dataTypeNameTwo: string, dataTypeIdTwo: string, groupName: string = \"TestGroup\") {\n const crypto = require('crypto');\n const containerId = crypto.randomUUID();\n\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .addContainer()\n .withName(groupName)\n .withId(containerId)\n .withType(\"Group\")\n .done()\n .addProperty()\n .withContainerId(containerId)\n .withAlias(AliasHelper.toAlias(dataTypeNameOne))\n .withName(dataTypeNameOne)\n .withDataTypeId(dataTypeIdOne)\n .done()\n .addProperty()\n .withContainerId(containerId)\n .withAlias(AliasHelper.toAlias(dataTypeNameTwo))\n .withName(dataTypeNameTwo)\n .withDataTypeId(dataTypeIdTwo)\n .done()\n .build();\n return await this.create(documentType);\n }\n\n async createDefaultDocumentTypeWithAllowAsRoot(documentTypeName: string) {\n await this.ensureNameNotExists(documentTypeName);\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .withAllowedAsRoot(true)\n .build();\n return await this.create(documentType);\n }\n\n async createDocumentTypeWithAllowedChildNode(documentTypeName: string, allowedChildNodeId: string) {\n await this.ensureNameNotExists(documentTypeName);\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .withAllowedAsRoot(true)\n .addAllowedDocumentType()\n .withId(allowedChildNodeId)\n .done()\n .build();\n return await this.create(documentType);\n }\n\n async createDocumentTypeWithAllowedTemplate(documentTypeName: string, allowedTemplateId: string) {\n await this.ensureNameNotExists(documentTypeName);\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .addAllowedTemplateId()\n .withId(allowedTemplateId)\n .done()\n .build();\n return await this.create(documentType);\n }\n \n async createDocumentTypeWithTwoGroups(documentTypeName: string,dataType: string, dataTypeId: string, groupNameOne: string, groupNameTwo: string) {\n const crypto = require('crypto');\n const groupOneId = crypto.randomUUID();\n const groupTwoId = crypto.randomUUID();\n\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .addContainer()\n .withName(groupNameOne)\n .withId(groupOneId)\n .withType(\"Group\")\n .withSortOrder(0)\n .done()\n .addContainer()\n .withName(groupNameTwo)\n .withId(groupTwoId)\n .withType(\"Group\")\n .withSortOrder(1)\n .done()\n .addProperty()\n .withContainerId(groupOneId)\n .withAlias(AliasHelper.toAlias(dataType + \"One\"))\n .withName(dataType + \"One\")\n .withDataTypeId(dataTypeId)\n .done()\n .addProperty()\n .withContainerId(groupTwoId)\n .withAlias(AliasHelper.toAlias(dataType + \"Two\"))\n .withName(dataType + \"Two\")\n .withDataTypeId(dataTypeId)\n .done()\n .build();\n return await this.create(documentType);\n }\n \n async createDocumentTypeWithAComposition(documentTypeName: string, compositionId: string) {\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .addComposition()\n .withDocumentTypeId(compositionId)\n .done()\n .build();\n return await this.create(documentType);\n }\n \n async createDocumentTypeWithTwoTabs(documentTypeName: string, dataType: string, dataTypeId: string, tabNameOne: string, tabNameTwo: string) {\n const crypto = require('crypto');\n const tabOneId = crypto.randomUUID();\n const tabTwoId = crypto.randomUUID();\n const groupOneId = crypto.randomUUID();\n const groupTwoId = crypto.randomUUID();\n\n const documentType = new DocumentTypeBuilder()\n .withName(documentTypeName)\n .withAlias(AliasHelper.toAlias(documentTypeName))\n .addContainer()\n .withName(tabNameOne)\n .withId(tabOneId)\n .withType(\"Tab\")\n .withSortOrder(0)\n .done()\n .addContainer()\n .withName(tabNameTwo)\n .withId(tabTwoId)\n .withType(\"Tab\")\n .withSortOrder(1)\n .done()\n .addContainer()\n .withName(\"GroupTestOne\")\n .withId(groupOneId)\n .withType(\"Group\")\n .withParentId(tabOneId)\n .done()\n .addProperty()\n .withContainerId(groupOneId)\n .withAlias(AliasHelper.toAlias(dataType + \"One\"))\n .withName(dataType + \"One\")\n .withDataTypeId(dataTypeId)\n .done()\n .addContainer()\n .withName(\"GroupTestTwo\")\n .withId(groupTwoId)\n .withType(\"Group\")\n .withParentId(tabTwoId)\n .done()\n .addProperty()\n .withContainerId(groupTwoId)\n .withAlias(AliasHelper.toAlias(dataType + \"Two\"))\n .withName(dataType + \"Two\")\n .withDataTypeId(dataTypeId)\n .done()\n .build();\n return await this.create(documentType);\n }\n\n async doesGroupContainCorrectPropertyEditor(documentTypeName: string, dataTypeName: string, dataTypeId: string, groupName: string) {\n const documentType = await this.getByName(documentTypeName);\n const group = documentType.containers.find(x => x.name === groupName);\n // Check if group is defined\n if (group) {\n // Check if the document type properties include the specified property, and it belongs to the group\n return documentType.properties.find(x => x.name === dataTypeName && x.dataType.id === dataTypeId && x.container.id === group.id);\n } else {\n // Group not found\n return false;\n }\n }\n\n async doesTabContainCorrectPropertyEditorInGroup(documentTypeName: string, dataTypeName: string, dataTypeId: string, tabName: string, groupName: string) {\n const documentType = await this.getByName(documentTypeName);\n const tab = documentType.containers.find(x => x.name === tabName);\n // Check if tab is defined\n if (tab) {\n const group = documentType.containers.find(x => x.name === groupName && x.parent.id === tab.id);\n // Check if group is defined\n if (group) {\n // Check if the document type properties include the specified property, and it belongs to the group\n return documentType.properties.find(x => x.name === dataTypeName && x.dataType.id === dataTypeId && x.container.id === group.id);\n } else {\n // Group not found\n return false;\n }\n } else {\n // Tab not found\n return false;\n }\n }\n \n async doesDocumentTypeGroupNameContainCorrectSortOrder(documentTypeName: string, groupName: string, sortOrder: number) {\n const documentType = await this.getByName(documentTypeName);\n const group = documentType.containers.find(x => x.name === groupName);\n // Check if group is defined\n if (group) {\n return group.sortOrder === sortOrder;\n } else {\n // Group not found\n return false;\n }\n }\n \n async doesDocumentTypeTabNameContainCorrectSortOrder(documentTypeName: string, tabName: string, sortOrder: number) {\n const documentType = await this.getByName(documentTypeName);\n const tab = documentType.containers.find(x => x.name === tabName);\n // Check if tab is defined\n if (tab) {\n return tab.sortOrder === sortOrder;\n } else {\n // Tab not found\n return false;\n }\n }\n \n async getContainerIdWithName(documentTypeName: string, containerName: string) {\n const documentType = await this.getByName(documentTypeName);\n const container = documentType.containers.find(x => x.name === containerName);\n if (container) {\n return container.id;\n } else {\n return null;\n }\n }\n}"]}
|
|
@@ -8,6 +8,15 @@ export declare class DocumentTypeUiHelper extends UiBaseLocators {
|
|
|
8
8
|
private readonly documentTypeTemplatesTabBtn;
|
|
9
9
|
private readonly varyBySegmentsBtn;
|
|
10
10
|
private readonly varyByCultureBtn;
|
|
11
|
+
private readonly createDocumentTypeBtn;
|
|
12
|
+
private readonly createDocumentTypeWithTemplateBtn;
|
|
13
|
+
private readonly createElementTypeBtn;
|
|
14
|
+
private readonly createDocumentFolderBtn;
|
|
15
|
+
private readonly documentTypeGroupNameTxt;
|
|
16
|
+
private readonly propertySettingsModal;
|
|
17
|
+
private readonly allowedChildNodesModal;
|
|
18
|
+
private readonly configureAsACollectionBtn;
|
|
19
|
+
private readonly documentTypeGroups;
|
|
11
20
|
constructor(page: Page);
|
|
12
21
|
clickActionsMenuForDocumentType(name: string): Promise<void>;
|
|
13
22
|
clickActionsMenuAtRoot(): Promise<void>;
|
|
@@ -16,8 +25,22 @@ export declare class DocumentTypeUiHelper extends UiBaseLocators {
|
|
|
16
25
|
clickVaryByCultureSlider(): Promise<void>;
|
|
17
26
|
clickDocumentTypeSettingsTab(): Promise<void>;
|
|
18
27
|
clickDocumentTypeTemplatesTab(): Promise<void>;
|
|
28
|
+
reorderTwoGroupsInADocumentType(): Promise<{
|
|
29
|
+
firstGroupValue: string;
|
|
30
|
+
secondGroupValue: string;
|
|
31
|
+
}>;
|
|
19
32
|
clickVaryBySegmentsButton(): Promise<void>;
|
|
20
33
|
clickVaryByCultureButton(): Promise<void>;
|
|
21
34
|
goToDocumentType(documentTypeName: string): Promise<void>;
|
|
35
|
+
enterPropertyEditorDescription(description: string): Promise<void>;
|
|
22
36
|
enterDocumentTypeName(documentTypeName: string): Promise<void>;
|
|
37
|
+
clickCreateDocumentTypeButton(): Promise<void>;
|
|
38
|
+
clickCreateDocumentTypeWithTemplateButton(): Promise<void>;
|
|
39
|
+
clickCreateElementTypeButton(): Promise<void>;
|
|
40
|
+
clickCreateDocumentFolderButton(): Promise<void>;
|
|
41
|
+
deletePropertyEditorInDocumentTypeWithName(name: string): Promise<void>;
|
|
42
|
+
clickAllowedChildNodesButton(): Promise<void>;
|
|
43
|
+
clickConfigureAsACollectionButton(): Promise<void>;
|
|
44
|
+
enterDocumentTypeGroupName(groupName: string, index?: number): Promise<void>;
|
|
45
|
+
isDocumentTreeItemVisible(name: string, isVisible?: boolean): Promise<void>;
|
|
23
46
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DocumentTypeUiHelper = void 0;
|
|
4
4
|
const UiBaseLocators_1 = require("./UiBaseLocators");
|
|
5
|
+
const test_1 = require("@playwright/test");
|
|
5
6
|
class DocumentTypeUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
6
7
|
newDocumentTypeBtn;
|
|
7
8
|
documentNameTxt;
|
|
@@ -10,6 +11,15 @@ class DocumentTypeUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
10
11
|
documentTypeTemplatesTabBtn;
|
|
11
12
|
varyBySegmentsBtn;
|
|
12
13
|
varyByCultureBtn;
|
|
14
|
+
createDocumentTypeBtn;
|
|
15
|
+
createDocumentTypeWithTemplateBtn;
|
|
16
|
+
createElementTypeBtn;
|
|
17
|
+
createDocumentFolderBtn;
|
|
18
|
+
documentTypeGroupNameTxt;
|
|
19
|
+
propertySettingsModal;
|
|
20
|
+
allowedChildNodesModal;
|
|
21
|
+
configureAsACollectionBtn;
|
|
22
|
+
documentTypeGroups;
|
|
13
23
|
constructor(page) {
|
|
14
24
|
super(page);
|
|
15
25
|
this.newDocumentTypeBtn = page.getByLabel('New Document Type...');
|
|
@@ -19,6 +29,15 @@ class DocumentTypeUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
19
29
|
this.documentTypeTemplatesTabBtn = page.getByRole('tab', { name: 'Templates' });
|
|
20
30
|
this.varyBySegmentsBtn = page.getByText('Vary by segments', { exact: true });
|
|
21
31
|
this.varyByCultureBtn = page.getByText('Vary by culture', { exact: true });
|
|
32
|
+
this.createDocumentTypeBtn = page.locator('umb-ref-item').getByText('Document Type', { exact: true });
|
|
33
|
+
this.createDocumentTypeWithTemplateBtn = page.locator('umb-ref-item').getByText('Document Type with Template', { exact: true });
|
|
34
|
+
this.createElementTypeBtn = page.locator('umb-ref-item').getByText('Element Type', { exact: true });
|
|
35
|
+
this.createDocumentFolderBtn = page.locator('umb-ref-item').getByText('Folder', { exact: true });
|
|
36
|
+
this.documentTypeGroupNameTxt = page.getByLabel('Group', { exact: true });
|
|
37
|
+
this.propertySettingsModal = page.locator('umb-property-type-settings-modal');
|
|
38
|
+
this.allowedChildNodesModal = page.locator('umb-tree-picker-modal');
|
|
39
|
+
this.configureAsACollectionBtn = page.getByLabel('Configure as a collection');
|
|
40
|
+
this.documentTypeGroups = page.locator('umb-content-type-design-editor-group');
|
|
22
41
|
}
|
|
23
42
|
async clickActionsMenuForDocumentType(name) {
|
|
24
43
|
await this.clickActionsMenuForName(name);
|
|
@@ -36,13 +55,27 @@ class DocumentTypeUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
36
55
|
await this.varyByCultureSlider.click();
|
|
37
56
|
}
|
|
38
57
|
async clickDocumentTypeSettingsTab() {
|
|
58
|
+
// The wait is necessary, because we have to wait until the document is loaded, otherwise we won't be navigated to the settings tab
|
|
59
|
+
await this.page.waitForTimeout(1000);
|
|
39
60
|
await this.documentTypeSettingsTabBtn.waitFor({ state: 'visible' });
|
|
40
61
|
await this.documentTypeSettingsTabBtn.click({ force: true });
|
|
41
62
|
}
|
|
42
63
|
async clickDocumentTypeTemplatesTab() {
|
|
64
|
+
// The wait is necessary, because we have to wait until the document is loaded, otherwise we won't be navigated to the templates tab
|
|
65
|
+
await this.page.waitForTimeout(1000);
|
|
43
66
|
await this.documentTypeTemplatesTabBtn.waitFor({ state: 'visible' });
|
|
44
67
|
await this.documentTypeTemplatesTabBtn.click({ force: true });
|
|
45
68
|
}
|
|
69
|
+
async reorderTwoGroupsInADocumentType() {
|
|
70
|
+
const firstGroup = this.documentTypeGroups.nth(0);
|
|
71
|
+
const secondGroup = this.documentTypeGroups.nth(1);
|
|
72
|
+
const firstGroupValue = await firstGroup.getByLabel('Group', { exact: true }).inputValue();
|
|
73
|
+
const secondGroupValue = await secondGroup.getByLabel('Group', { exact: true }).inputValue();
|
|
74
|
+
const dragToLocator = firstGroup.locator('[name="icon-navigation"]');
|
|
75
|
+
const dragFromLocator = secondGroup.locator('[name="icon-navigation"]');
|
|
76
|
+
await this.dragAndDrop(dragFromLocator, dragToLocator, 0, 0, 10);
|
|
77
|
+
return { firstGroupValue, secondGroupValue };
|
|
78
|
+
}
|
|
46
79
|
async clickVaryBySegmentsButton() {
|
|
47
80
|
await this.varyBySegmentsBtn.click();
|
|
48
81
|
}
|
|
@@ -53,10 +86,46 @@ class DocumentTypeUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
53
86
|
await this.clickRootFolderCaretButton();
|
|
54
87
|
await this.page.getByLabel(documentTypeName).click();
|
|
55
88
|
}
|
|
89
|
+
async enterPropertyEditorDescription(description) {
|
|
90
|
+
await this.propertySettingsModal.locator(this.enterDescriptionTxt).fill(description);
|
|
91
|
+
}
|
|
56
92
|
async enterDocumentTypeName(documentTypeName) {
|
|
57
93
|
await this.documentNameTxt.waitFor({ state: 'visible' });
|
|
58
94
|
await this.documentNameTxt.fill(documentTypeName);
|
|
59
95
|
}
|
|
96
|
+
async clickCreateDocumentTypeButton() {
|
|
97
|
+
await this.createDocumentTypeBtn.click();
|
|
98
|
+
}
|
|
99
|
+
async clickCreateDocumentTypeWithTemplateButton() {
|
|
100
|
+
await this.createDocumentTypeWithTemplateBtn.click();
|
|
101
|
+
}
|
|
102
|
+
async clickCreateElementTypeButton() {
|
|
103
|
+
await this.createElementTypeBtn.click();
|
|
104
|
+
}
|
|
105
|
+
async clickCreateDocumentFolderButton() {
|
|
106
|
+
await this.createDocumentFolderBtn.click();
|
|
107
|
+
}
|
|
108
|
+
async deletePropertyEditorInDocumentTypeWithName(name) {
|
|
109
|
+
// We need to hover over the Property Editor to make the delete button visible
|
|
110
|
+
await this.page.locator('umb-content-type-design-editor-property', { hasText: name }).hover();
|
|
111
|
+
await this.page.locator('umb-content-type-design-editor-property', { hasText: name }).getByLabel('Delete').click({ force: true });
|
|
112
|
+
await this.clickConfirmToDeleteButton();
|
|
113
|
+
}
|
|
114
|
+
async clickAllowedChildNodesButton() {
|
|
115
|
+
await this.allowedChildNodesModal.locator(this.chooseBtn).click();
|
|
116
|
+
}
|
|
117
|
+
async clickConfigureAsACollectionButton() {
|
|
118
|
+
await this.configureAsACollectionBtn.click();
|
|
119
|
+
}
|
|
120
|
+
async enterDocumentTypeGroupName(groupName, index = 0) {
|
|
121
|
+
// We need this wait, otherwise the group name would sometimes not be written
|
|
122
|
+
await this.page.waitForTimeout(500);
|
|
123
|
+
await (0, test_1.expect)(this.documentTypeGroupNameTxt.nth(index)).toBeVisible();
|
|
124
|
+
await this.documentTypeGroupNameTxt.nth(index).fill(groupName);
|
|
125
|
+
}
|
|
126
|
+
async isDocumentTreeItemVisible(name, isVisible = true) {
|
|
127
|
+
await (0, test_1.expect)(this.page.locator('umb-tree-item').locator('[label="' + name + '"]')).toBeVisible({ visible: isVisible });
|
|
128
|
+
}
|
|
60
129
|
}
|
|
61
130
|
exports.DocumentTypeUiHelper = DocumentTypeUiHelper;
|
|
62
131
|
//# sourceMappingURL=DocumentTypeUiHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentTypeUiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/DocumentTypeUiHelper.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAGhD,MAAa,oBAAqB,SAAQ,+BAAc;IACrC,kBAAkB,CAAU;IAC5B,eAAe,CAAU;IACzB,mBAAmB,CAAU;IAC7B,0BAA0B,CAAU;IACpC,2BAA2B,CAAU;IACrC,iBAAiB,CAAU;IAC3B,gBAAgB,CAAU;IAE3C,YAAY,IAAU;QACpB,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;QAClE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,EAAC,OAAO,EAAE,iBAAiB,EAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACzG,IAAI,CAAC,0BAA0B,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,EAAC,IAAI,EAAE,UAAU,EAAC,CAAC,CAAC;QACvG,IAAI,CAAC,2BAA2B,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAC,IAAI,EAAE,WAAW,EAAC,CAAC,CAAA;QAC7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AiB,CAAC,KAAK,EAAE,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,wBAAwB;QAC5B,MAAM,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,gBAAwB;QAC7C,MAAM,IAAI,CAAC,0BAA0B,EAAE,CAAC;QACxC,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,CAAC;IACvD,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,gBAAwB;QAClD,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAC,KAAK,EAAE,SAAS,EAAC,CAAC,CAAC;QACvD,MAAM,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACpD,CAAC;CACF;AAnED,oDAmEC","sourcesContent":["import {UiBaseLocators} from \"./UiBaseLocators\";\nimport {Locator, Page} from \"@playwright/test\";\n\nexport class DocumentTypeUiHelper extends UiBaseLocators {\n private readonly newDocumentTypeBtn: Locator;\n private readonly documentNameTxt: Locator;\n private readonly varyByCultureSlider: Locator;\n private readonly documentTypeSettingsTabBtn: Locator;\n private readonly documentTypeTemplatesTabBtn: Locator;\n private readonly varyBySegmentsBtn: Locator;\n private readonly varyByCultureBtn: Locator;\n\n constructor(page: Page) {\n super(page);\n this.newDocumentTypeBtn = page.getByLabel('New Document Type...');\n this.documentNameTxt = page.getByLabel('name', {exact: true});\n this.varyByCultureSlider = page.locator('label').filter({hasText: 'Vary by culture'}).locator('#slider');\n this.documentTypeSettingsTabBtn = page.locator('umb-body-layout').getByRole('tab', {name: 'Settings'});\n this.documentTypeTemplatesTabBtn = page.getByRole('tab', {name: 'Templates'})\n this.varyBySegmentsBtn = page.getByText('Vary by segments', {exact: true});\n this.varyByCultureBtn = page.getByText('Vary by culture', {exact: true});\n }\n\n async clickActionsMenuForDocumentType(name: string) {\n await this.clickActionsMenuForName(name);\n }\n\n async clickActionsMenuAtRoot() {\n await this.clickActionsMenuForDocumentType(\"Document Types\");\n }\n\n async clickRootFolderCaretButton() {\n await this.clickCaretButtonForName(\"Document Types\");\n }\n\n async clickNewDocumentTypeButton() {\n await this.newDocumentTypeBtn.click();\n }\n\n async clickVaryByCultureSlider() {\n await this.varyByCultureSlider.click();\n }\n\n async clickDocumentTypeSettingsTab() {\n await this.documentTypeSettingsTabBtn.waitFor({state: 'visible'});\n await this.documentTypeSettingsTabBtn.click({force: true});\n }\n\n async clickDocumentTypeTemplatesTab() {\n await this.documentTypeTemplatesTabBtn.waitFor({state: 'visible'});\n await this.documentTypeTemplatesTabBtn.click({force: true});\n }\n\n async clickVaryBySegmentsButton() {\n await this.varyBySegmentsBtn.click();\n }\n\n async clickVaryByCultureButton() {\n await this.varyByCultureBtn.click();\n }\n\n async goToDocumentType(documentTypeName: string) {\n await this.clickRootFolderCaretButton();\n await this.page.getByLabel(documentTypeName).click();\n }\n\n async enterDocumentTypeName(documentTypeName: string) {\n await this.documentNameTxt.waitFor({state: 'visible'});\n await this.documentNameTxt.fill(documentTypeName);\n }\n}"]}
|
|
1
|
+
{"version":3,"file":"DocumentTypeUiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/DocumentTypeUiHelper.ts"],"names":[],"mappings":";;;AAAA,qDAAgD;AAChD,2CAAuD;AAEvD,MAAa,oBAAqB,SAAQ,+BAAc;IACrC,kBAAkB,CAAU;IAC5B,eAAe,CAAU;IACzB,mBAAmB,CAAU;IAC7B,0BAA0B,CAAU;IACpC,2BAA2B,CAAU;IACrC,iBAAiB,CAAU;IAC3B,gBAAgB,CAAU;IAC1B,qBAAqB,CAAU;IAC/B,iCAAiC,CAAU;IAC3C,oBAAoB,CAAU;IAC9B,uBAAuB,CAAU;IACjC,wBAAwB,CAAU;IAClC,qBAAqB,CAAU;IAC/B,sBAAsB,CAAU;IAChC,yBAAyB,CAAU;IACnC,kBAAkB,CAAU;IAE7C,YAAY,IAAU;QACpB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sourcesContent":["import {UiBaseLocators} from \"./UiBaseLocators\";\nimport {expect, Locator, Page} from \"@playwright/test\";\n\nexport class DocumentTypeUiHelper extends UiBaseLocators {\n private readonly newDocumentTypeBtn: Locator;\n private readonly documentNameTxt: Locator;\n private readonly varyByCultureSlider: Locator;\n private readonly documentTypeSettingsTabBtn: Locator;\n private readonly documentTypeTemplatesTabBtn: Locator;\n private readonly varyBySegmentsBtn: Locator;\n private readonly varyByCultureBtn: Locator;\n private readonly createDocumentTypeBtn: Locator;\n private readonly createDocumentTypeWithTemplateBtn: Locator;\n private readonly createElementTypeBtn: Locator;\n private readonly createDocumentFolderBtn: Locator;\n private readonly documentTypeGroupNameTxt: Locator;\n private readonly propertySettingsModal: Locator;\n private readonly allowedChildNodesModal: Locator;\n private readonly configureAsACollectionBtn: Locator;\n private readonly documentTypeGroups: Locator;\n\n constructor(page: Page) {\n super(page);\n this.newDocumentTypeBtn = page.getByLabel('New Document Type...');\n this.documentNameTxt = page.getByLabel('name', {exact: true});\n this.varyByCultureSlider = page.locator('label').filter({hasText: 'Vary by culture'}).locator('#slider');\n this.documentTypeSettingsTabBtn = page.locator('umb-body-layout').getByRole('tab', {name: 'Settings'});\n this.documentTypeTemplatesTabBtn = page.getByRole('tab', {name: 'Templates'})\n this.varyBySegmentsBtn = page.getByText('Vary by segments', {exact: true});\n this.varyByCultureBtn = page.getByText('Vary by culture', {exact: true});\n this.createDocumentTypeBtn = page.locator('umb-ref-item').getByText('Document Type', {exact: true});\n this.createDocumentTypeWithTemplateBtn = page.locator('umb-ref-item').getByText('Document Type with Template', {exact: true});\n this.createElementTypeBtn = page.locator('umb-ref-item').getByText('Element Type', {exact: true});\n this.createDocumentFolderBtn = page.locator('umb-ref-item').getByText('Folder', {exact: true});\n this.documentTypeGroupNameTxt = page.getByLabel('Group', {exact: true});\n this.propertySettingsModal = page.locator('umb-property-type-settings-modal');\n this.allowedChildNodesModal = page.locator('umb-tree-picker-modal');\n this.configureAsACollectionBtn = page.getByLabel('Configure as a collection');\n this.documentTypeGroups = page.locator('umb-content-type-design-editor-group');\n }\n\n async clickActionsMenuForDocumentType(name: string) {\n await this.clickActionsMenuForName(name);\n }\n\n async clickActionsMenuAtRoot() {\n await this.clickActionsMenuForDocumentType(\"Document Types\");\n }\n\n async clickRootFolderCaretButton() {\n await this.clickCaretButtonForName(\"Document Types\");\n }\n\n async clickNewDocumentTypeButton() {\n await this.newDocumentTypeBtn.click();\n }\n\n async clickVaryByCultureSlider() {\n await this.varyByCultureSlider.click();\n }\n\n async clickDocumentTypeSettingsTab() {\n // The wait is necessary, because we have to wait until the document is loaded, otherwise we won't be navigated to the settings tab\n await this.page.waitForTimeout(1000);\n await this.documentTypeSettingsTabBtn.waitFor({state: 'visible'});\n await this.documentTypeSettingsTabBtn.click({force: true});\n }\n\n async clickDocumentTypeTemplatesTab() {\n // The wait is necessary, because we have to wait until the document is loaded, otherwise we won't be navigated to the templates tab\n await this.page.waitForTimeout(1000);\n await this.documentTypeTemplatesTabBtn.waitFor({state: 'visible'});\n await this.documentTypeTemplatesTabBtn.click({force: true});\n }\n\n async reorderTwoGroupsInADocumentType() {\n const firstGroup = this.documentTypeGroups.nth(0);\n const secondGroup = this.documentTypeGroups.nth(1);\n const firstGroupValue = await firstGroup.getByLabel('Group', {exact: true}).inputValue();\n const secondGroupValue = await secondGroup.getByLabel('Group', {exact: true}).inputValue();\n const dragToLocator = firstGroup.locator('[name=\"icon-navigation\"]');\n const dragFromLocator = secondGroup.locator('[name=\"icon-navigation\"]');\n await this.dragAndDrop(dragFromLocator, dragToLocator, 0, 0, 10);\n\n return {firstGroupValue, secondGroupValue};\n }\n\n async clickVaryBySegmentsButton() {\n await this.varyBySegmentsBtn.click();\n }\n\n async clickVaryByCultureButton() {\n await this.varyByCultureBtn.click();\n }\n\n async goToDocumentType(documentTypeName: string) {\n await this.clickRootFolderCaretButton();\n await this.page.getByLabel(documentTypeName).click();\n }\n\n async enterPropertyEditorDescription(description: string) {\n await this.propertySettingsModal.locator(this.enterDescriptionTxt).fill(description);\n }\n\n async enterDocumentTypeName(documentTypeName: string) {\n await this.documentNameTxt.waitFor({state: 'visible'});\n await this.documentNameTxt.fill(documentTypeName);\n }\n\n async clickCreateDocumentTypeButton() {\n await this.createDocumentTypeBtn.click();\n }\n\n async clickCreateDocumentTypeWithTemplateButton() {\n await this.createDocumentTypeWithTemplateBtn.click();\n }\n\n async clickCreateElementTypeButton() {\n await this.createElementTypeBtn.click();\n }\n\n async clickCreateDocumentFolderButton() {\n await this.createDocumentFolderBtn.click();\n }\n\n async deletePropertyEditorInDocumentTypeWithName(name: string) {\n // We need to hover over the Property Editor to make the delete button visible\n await this.page.locator('umb-content-type-design-editor-property', {hasText: name}).hover();\n await this.page.locator('umb-content-type-design-editor-property', {hasText: name}).getByLabel('Delete').click({force: true});\n await this.clickConfirmToDeleteButton();\n }\n\n async clickAllowedChildNodesButton() {\n await this.allowedChildNodesModal.locator(this.chooseBtn).click();\n }\n\n async clickConfigureAsACollectionButton() {\n await this.configureAsACollectionBtn.click();\n }\n\n async enterDocumentTypeGroupName(groupName: string, index = 0) {\n // We need this wait, otherwise the group name would sometimes not be written\n await this.page.waitForTimeout(500);\n await expect(this.documentTypeGroupNameTxt.nth(index)).toBeVisible();\n await this.documentTypeGroupNameTxt.nth(index).fill(groupName);\n }\n\n async isDocumentTreeItemVisible(name: string, isVisible = true) {\n await expect(this.page.locator('umb-tree-item').locator('[label=\"' + name + '\"]')).toBeVisible({visible: isVisible});\n }\n}"]}
|
|
@@ -4,13 +4,11 @@ export declare class MemberGroupUiHelper extends UiBaseLocators {
|
|
|
4
4
|
private readonly memberGroupsTab;
|
|
5
5
|
private readonly memberGroupNameTxt;
|
|
6
6
|
private readonly actionsBtn;
|
|
7
|
-
private readonly leftArrowBtn;
|
|
8
7
|
private readonly memberGroupView;
|
|
9
8
|
constructor(page: Page);
|
|
10
9
|
clickMemberGroupsTab(): Promise<void>;
|
|
11
10
|
enterMemberGroupName(name: string): Promise<void>;
|
|
12
11
|
clickMemberGroupLinkByName(memberGroupName: string): Promise<void>;
|
|
13
12
|
clickActionsButton(): Promise<void>;
|
|
14
|
-
clickLeftArrowButton(): Promise<void>;
|
|
15
13
|
isMemberGroupNameVisible(memberGroupName: string, isVisible?: boolean): Promise<void>;
|
|
16
14
|
}
|
|
@@ -7,14 +7,12 @@ class MemberGroupUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
7
7
|
memberGroupsTab;
|
|
8
8
|
memberGroupNameTxt;
|
|
9
9
|
actionsBtn;
|
|
10
|
-
leftArrowBtn;
|
|
11
10
|
memberGroupView;
|
|
12
11
|
constructor(page) {
|
|
13
12
|
super(page);
|
|
14
13
|
this.memberGroupsTab = page.locator('uui-tab[label="Member Groups"]');
|
|
15
14
|
this.memberGroupNameTxt = page.locator('input#input');
|
|
16
15
|
this.actionsBtn = page.getByLabel('Actions', { exact: true });
|
|
17
|
-
this.leftArrowBtn = page.locator('[name="icon-arrow-left"] svg');
|
|
18
16
|
this.memberGroupView = page.locator('umb-member-group-table-collection-view');
|
|
19
17
|
}
|
|
20
18
|
async clickMemberGroupsTab() {
|
|
@@ -31,9 +29,6 @@ class MemberGroupUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
31
29
|
async clickActionsButton() {
|
|
32
30
|
await this.actionsBtn.click();
|
|
33
31
|
}
|
|
34
|
-
async clickLeftArrowButton() {
|
|
35
|
-
await this.leftArrowBtn.click();
|
|
36
|
-
}
|
|
37
32
|
async isMemberGroupNameVisible(memberGroupName, isVisible = true) {
|
|
38
33
|
return (0, test_1.expect)(this.memberGroupView.filter({ hasText: memberGroupName })).toBeVisible({ visible: isVisible, timeout: 500 });
|
|
39
34
|
}
|