@umbraco/playwright-testhelpers 17.0.19 → 17.1.0-beta.1
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/BasePage.d.ts +447 -0
- package/dist/lib/helpers/BasePage.js +543 -0
- package/dist/lib/helpers/BasePage.js.map +1 -0
- package/dist/lib/helpers/ConstantHelper.d.ts +17 -0
- package/dist/lib/helpers/ConstantHelper.js +17 -0
- package/dist/lib/helpers/ConstantHelper.js.map +1 -1
- package/dist/lib/helpers/ContentRenderUiHelper.js +3 -3
- package/dist/lib/helpers/ContentRenderUiHelper.js.map +1 -1
- package/dist/lib/helpers/ContentUiHelper.d.ts +0 -6
- package/dist/lib/helpers/ContentUiHelper.js +333 -495
- package/dist/lib/helpers/ContentUiHelper.js.map +1 -1
- package/dist/lib/helpers/CurrentUserProfileUiHelper.js +4 -10
- package/dist/lib/helpers/CurrentUserProfileUiHelper.js.map +1 -1
- package/dist/lib/helpers/DataTypeUiHelper.js +189 -328
- package/dist/lib/helpers/DataTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/DictionaryUiHelper.js +16 -21
- package/dist/lib/helpers/DictionaryUiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentBlueprintUiHelper.js +7 -8
- package/dist/lib/helpers/DocumentBlueprintUiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentTypeApiHelper.d.ts +1 -4
- package/dist/lib/helpers/DocumentTypeApiHelper.js +1 -121
- package/dist/lib/helpers/DocumentTypeApiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentTypeUiHelper.js +18 -33
- package/dist/lib/helpers/DocumentTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/ExamineManagementUiHelper.js +4 -4
- package/dist/lib/helpers/ExamineManagementUiHelper.js.map +1 -1
- package/dist/lib/helpers/FormsUiHelper.js +119 -158
- package/dist/lib/helpers/FormsUiHelper.js.map +1 -1
- package/dist/lib/helpers/HealthCheckUiHelper.js +3 -3
- package/dist/lib/helpers/HealthCheckUiHelper.js.map +1 -1
- package/dist/lib/helpers/LanguageUiHelper.js +15 -17
- package/dist/lib/helpers/LanguageUiHelper.js.map +1 -1
- package/dist/lib/helpers/LogViewerUiHelper.js +21 -30
- package/dist/lib/helpers/LogViewerUiHelper.js.map +1 -1
- package/dist/lib/helpers/LoginUiHelper.js +5 -7
- package/dist/lib/helpers/LoginUiHelper.js.map +1 -1
- package/dist/lib/helpers/MediaTypeUiHelper.js +11 -17
- package/dist/lib/helpers/MediaTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/MediaUiHelper.js +34 -43
- package/dist/lib/helpers/MediaUiHelper.js.map +1 -1
- package/dist/lib/helpers/MemberGroupUiHelper.js +12 -15
- package/dist/lib/helpers/MemberGroupUiHelper.js.map +1 -1
- package/dist/lib/helpers/MemberTypeUiHelper.js +2 -3
- package/dist/lib/helpers/MemberTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/MemberUiHelper.js +24 -42
- package/dist/lib/helpers/MemberUiHelper.js.map +1 -1
- package/dist/lib/helpers/ModelsBuilderUiHelper.js +2 -3
- package/dist/lib/helpers/ModelsBuilderUiHelper.js.map +1 -1
- package/dist/lib/helpers/PackageUiHelper.js +29 -34
- package/dist/lib/helpers/PackageUiHelper.js.map +1 -1
- package/dist/lib/helpers/PartialViewUiHelper.js +13 -15
- package/dist/lib/helpers/PartialViewUiHelper.js.map +1 -1
- package/dist/lib/helpers/ProfilingUiHelper.js +2 -4
- package/dist/lib/helpers/ProfilingUiHelper.js.map +1 -1
- package/dist/lib/helpers/PublishedStatusUiHelper.js +6 -6
- package/dist/lib/helpers/PublishedStatusUiHelper.js.map +1 -1
- package/dist/lib/helpers/RedirectManagementUiHelper.js +7 -12
- package/dist/lib/helpers/RedirectManagementUiHelper.js.map +1 -1
- package/dist/lib/helpers/RelationTypeUiHelper.js +12 -14
- package/dist/lib/helpers/RelationTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/ScriptUiHelper.js +8 -11
- package/dist/lib/helpers/ScriptUiHelper.js.map +1 -1
- package/dist/lib/helpers/StylesheetUiHelper.js +8 -12
- package/dist/lib/helpers/StylesheetUiHelper.js.map +1 -1
- package/dist/lib/helpers/TelemetryDataUiHelper.js +2 -3
- package/dist/lib/helpers/TelemetryDataUiHelper.js.map +1 -1
- package/dist/lib/helpers/TemplateUiHelper.js +17 -22
- package/dist/lib/helpers/TemplateUiHelper.js.map +1 -1
- package/dist/lib/helpers/UiBaseLocators.d.ts +230 -228
- package/dist/lib/helpers/UiBaseLocators.js +832 -869
- package/dist/lib/helpers/UiBaseLocators.js.map +1 -1
- package/dist/lib/helpers/UserGroupUiHelper.js +27 -44
- package/dist/lib/helpers/UserGroupUiHelper.js.map +1 -1
- package/dist/lib/helpers/UserUiHelper.js +43 -46
- package/dist/lib/helpers/UserUiHelper.js.map +1 -1
- package/dist/lib/helpers/WebhookUiHelper.js +11 -27
- package/dist/lib/helpers/WebhookUiHelper.js.map +1 -1
- package/dist/lib/helpers/WelcomeDashboardUiHelper.js +1 -1
- package/dist/lib/helpers/WelcomeDashboardUiHelper.js.map +1 -1
- package/dist/lib/helpers/differentAppSettingsHelpers/ExternalLoginUiHelpers.js +4 -9
- package/dist/lib/helpers/differentAppSettingsHelpers/ExternalLoginUiHelpers.js.map +1 -1
- package/dist/lib/helpers/differentAppSettingsHelpers/InstallUiHelper.js +5 -10
- package/dist/lib/helpers/differentAppSettingsHelpers/InstallUiHelper.js.map +1 -1
- package/dist/lib/helpers/index.d.ts +1 -0
- package/dist/lib/helpers/index.js +3 -1
- package/dist/lib/helpers/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -241,7 +241,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
241
241
|
// Culture and Hostname
|
|
242
242
|
this.cultureAndHostnamesBtn = page.getByLabel(/^Culture and Hostnames(…)?$/);
|
|
243
243
|
this.hostNameItem = page.locator('.hostname-item');
|
|
244
|
-
this.cultureLanguageDropdownBox = this.
|
|
244
|
+
this.cultureLanguageDropdownBox = this.page.locator('[label="Culture"]').getByLabel('combobox-input');
|
|
245
245
|
this.hostnameTxt = page.getByLabel('Hostname', { exact: true });
|
|
246
246
|
this.hostnameLanguageDropdownBox = this.hostNameItem.locator('[label="Culture"]').getByLabel('combobox-input');
|
|
247
247
|
this.deleteHostnameBtn = this.hostNameItem.locator('[name="icon-trash"] svg');
|
|
@@ -370,37 +370,32 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
370
370
|
this.blockProperty = page.locator('umb-block-workspace-view-edit-property');
|
|
371
371
|
}
|
|
372
372
|
async enterContentName(name) {
|
|
373
|
-
await
|
|
374
|
-
await this.contentNameTxt.clear();
|
|
375
|
-
await this.contentNameTxt.fill(name);
|
|
376
|
-
await (0, test_1.expect)(this.contentNameTxt).toHaveValue(name);
|
|
373
|
+
await this.enterText(this.contentNameTxt, name, { verify: true });
|
|
377
374
|
}
|
|
378
375
|
async clickSaveAndPublishButton() {
|
|
379
|
-
await
|
|
380
|
-
await this.
|
|
381
|
-
await this.page.waitForTimeout(500);
|
|
376
|
+
await this.click(this.saveAndPublishBtn);
|
|
377
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
|
|
382
378
|
}
|
|
383
379
|
async isSuccessStateVisibleForSaveAndPublishButton(isVisible = true) {
|
|
384
380
|
const saveAndPublishBtn = this.workspaceAction.filter({ has: this.saveAndPublishBtn });
|
|
385
|
-
await
|
|
381
|
+
await this.isVisible(saveAndPublishBtn.locator(this.successState), isVisible, ConstantHelper_1.ConstantHelper.timeout.long);
|
|
386
382
|
}
|
|
387
383
|
async clickPublishButton() {
|
|
388
|
-
await this.
|
|
389
|
-
await this.page.waitForTimeout(
|
|
384
|
+
await this.click(this.publishBtn);
|
|
385
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
|
|
390
386
|
}
|
|
391
387
|
async clickUnpublishButton() {
|
|
392
|
-
await this.
|
|
388
|
+
await this.click(this.unpublishBtn);
|
|
393
389
|
}
|
|
394
390
|
async clickReloadChildrenThreeDotsButton() {
|
|
395
|
-
await this.
|
|
391
|
+
await this.click(this.reloadChildrenThreeDotsBtn);
|
|
396
392
|
}
|
|
397
393
|
async clickActionsMenuAtRoot() {
|
|
398
|
-
await this.
|
|
394
|
+
await this.click(this.actionMenuForContentBtn, { force: true });
|
|
399
395
|
}
|
|
400
396
|
async goToContentWithName(contentName) {
|
|
401
397
|
const contentWithNameLocator = this.menuItemTree.getByText(contentName, { exact: true });
|
|
402
|
-
await
|
|
403
|
-
await contentWithNameLocator.click();
|
|
398
|
+
await this.click(contentWithNameLocator);
|
|
404
399
|
}
|
|
405
400
|
async clickActionsMenuForContent(name) {
|
|
406
401
|
await this.clickActionsMenuForName(name);
|
|
@@ -413,8 +408,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
413
408
|
}
|
|
414
409
|
}
|
|
415
410
|
async clickCaretButtonForContentName(name) {
|
|
416
|
-
await
|
|
417
|
-
await this.menuItemTree.filter({ hasText: name }).last().locator('#caret-button').last().click();
|
|
411
|
+
await this.click(this.menuItemTree.filter({ hasText: name }).last().locator('#caret-button').last());
|
|
418
412
|
}
|
|
419
413
|
async waitForModalVisible() {
|
|
420
414
|
await this.openedModal.waitFor({ state: 'attached' });
|
|
@@ -423,188 +417,167 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
423
417
|
await this.openedModal.waitFor({ state: 'hidden' });
|
|
424
418
|
}
|
|
425
419
|
async clickSaveButtonForContent() {
|
|
426
|
-
await
|
|
427
|
-
await this.
|
|
428
|
-
await this.page.waitForTimeout(500);
|
|
420
|
+
await this.click(this.saveContentBtn);
|
|
421
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
|
|
429
422
|
}
|
|
430
423
|
async enterTextstring(text) {
|
|
431
|
-
await
|
|
432
|
-
await this.textstringTxt.clear();
|
|
433
|
-
await this.textstringTxt.fill(text);
|
|
434
|
-
}
|
|
435
|
-
async isTextstringPropertyVisible(isVisible = true) {
|
|
436
|
-
if (isVisible) {
|
|
437
|
-
await (0, test_1.expect)(this.textstringTxt).toBeVisible();
|
|
438
|
-
}
|
|
439
|
-
else {
|
|
440
|
-
await (0, test_1.expect)(this.textstringTxt).not.toBeVisible();
|
|
441
|
-
}
|
|
424
|
+
await this.enterText(this.textstringTxt, text);
|
|
442
425
|
}
|
|
443
426
|
async doesContentTreeHaveName(contentName) {
|
|
444
|
-
await
|
|
427
|
+
await this.containsText(this.contentTree, contentName);
|
|
445
428
|
}
|
|
446
429
|
async enterRichTextArea(value) {
|
|
447
|
-
await
|
|
430
|
+
await this.waitForVisible(this.richTextAreaTxt);
|
|
448
431
|
await this.richTextAreaTxt.fill(value);
|
|
449
432
|
}
|
|
450
433
|
async enterTextArea(value) {
|
|
451
|
-
await
|
|
452
|
-
await this.
|
|
453
|
-
await this.textAreaTxt.clear();
|
|
454
|
-
await this.textAreaTxt.fill(value);
|
|
434
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.minimal);
|
|
435
|
+
await this.enterText(this.textAreaTxt, value);
|
|
455
436
|
}
|
|
456
437
|
async clickConfirmToUnpublishButton() {
|
|
457
|
-
await this.
|
|
438
|
+
await this.click(this.confirmToUnpublishBtn);
|
|
458
439
|
}
|
|
459
440
|
async clickCreateDocumentBlueprintButton() {
|
|
460
|
-
await this.
|
|
441
|
+
await this.click(this.createDocumentBlueprintBtn);
|
|
461
442
|
}
|
|
462
443
|
// Info Tab
|
|
463
444
|
async clickInfoTab() {
|
|
464
|
-
await
|
|
465
|
-
await this.infoTab.click();
|
|
445
|
+
await this.click(this.infoTab);
|
|
466
446
|
}
|
|
467
447
|
async doesDocumentHaveLink(link) {
|
|
468
|
-
await
|
|
448
|
+
await this.containsText(this.linkContent, link);
|
|
469
449
|
}
|
|
470
450
|
async doesHistoryHaveText(text) {
|
|
471
|
-
await
|
|
451
|
+
await this.hasText(this.historyItems, text);
|
|
472
452
|
}
|
|
473
453
|
async doesDocumentStateHaveText(text) {
|
|
474
|
-
await
|
|
454
|
+
await this.hasText(this.documentState, text);
|
|
475
455
|
}
|
|
476
456
|
async doesCreatedDateHaveText(text) {
|
|
477
|
-
await
|
|
457
|
+
await this.hasText(this.createdDate, text);
|
|
478
458
|
}
|
|
479
459
|
async doesIdHaveText(text) {
|
|
480
|
-
await
|
|
460
|
+
await this.hasText(this.id, text);
|
|
481
461
|
}
|
|
482
462
|
async clickEditDocumentTypeButton() {
|
|
483
|
-
await this.
|
|
463
|
+
await this.click(this.editDocumentTypeBtn);
|
|
484
464
|
}
|
|
485
465
|
async clickAddTemplateButton() {
|
|
486
|
-
await this.
|
|
466
|
+
await this.click(this.addTemplateBtn);
|
|
487
467
|
}
|
|
488
468
|
async waitForContentToBeCreated() {
|
|
489
|
-
await this.
|
|
469
|
+
await this.waitForLoadState();
|
|
490
470
|
}
|
|
491
471
|
async waitForContentToBeDeleted() {
|
|
492
|
-
await this.
|
|
472
|
+
await this.waitForLoadState();
|
|
493
473
|
}
|
|
494
474
|
async waitForContentToBeRenamed() {
|
|
495
|
-
await this.
|
|
475
|
+
await this.waitForLoadState();
|
|
496
476
|
}
|
|
497
477
|
async waitForDomainToBeCreated() {
|
|
498
|
-
await this.
|
|
478
|
+
await this.waitForLoadState();
|
|
499
479
|
}
|
|
500
480
|
async waitForDomainToBeUpdated() {
|
|
501
|
-
await this.
|
|
481
|
+
await this.waitForLoadState();
|
|
502
482
|
}
|
|
503
483
|
async waitForDomainToBeDeleted() {
|
|
504
|
-
await this.
|
|
484
|
+
await this.waitForLoadState();
|
|
505
485
|
}
|
|
506
486
|
async waitForContentToBeTrashed() {
|
|
507
|
-
await this.
|
|
487
|
+
await this.waitForLoadState();
|
|
508
488
|
}
|
|
509
489
|
async clickDocumentTypeByName(documentTypeName) {
|
|
510
|
-
await this.page.locator(
|
|
490
|
+
await this.click(this.page.locator(`uui-ref-node-document-type[name="${documentTypeName}"]`));
|
|
511
491
|
}
|
|
512
492
|
async clickTemplateByName(templateName) {
|
|
513
|
-
await this.page.locator(
|
|
493
|
+
await this.click(this.page.locator(`uui-ref-node[name="${templateName}"]`));
|
|
514
494
|
}
|
|
515
495
|
async isDocumentTypeModalVisible(documentTypeName) {
|
|
516
|
-
await
|
|
496
|
+
await this.isVisible(this.documentTypeWorkspace.filter({ hasText: documentTypeName }));
|
|
517
497
|
}
|
|
518
498
|
async isTemplateModalVisible(templateName) {
|
|
519
|
-
await
|
|
499
|
+
await this.isVisible(this.breadcrumbsTemplateModal.getByText(templateName));
|
|
520
500
|
}
|
|
521
501
|
async clickEditTemplateByName(templateName) {
|
|
522
|
-
await this.page.locator(
|
|
502
|
+
await this.click(this.page.locator(`uui-ref-node[name="${templateName}"]`).getByLabel('Choose'));
|
|
523
503
|
}
|
|
524
504
|
async changeTemplate(oldTemplate, newTemplate) {
|
|
525
505
|
await this.clickEditTemplateByName(oldTemplate);
|
|
526
|
-
await this.sidebarModal.getByLabel(newTemplate)
|
|
506
|
+
await this.click(this.sidebarModal.getByLabel(newTemplate));
|
|
527
507
|
await this.clickChooseModalButton();
|
|
528
508
|
}
|
|
529
509
|
async isTemplateNameDisabled(templateName) {
|
|
530
|
-
await
|
|
531
|
-
await
|
|
510
|
+
await this.isVisible(this.sidebarModal.getByLabel(templateName));
|
|
511
|
+
await this.isDisabled(this.sidebarModal.getByLabel(templateName));
|
|
532
512
|
}
|
|
533
513
|
// Culture and Hostnames
|
|
534
514
|
async clickCultureAndHostnamesButton() {
|
|
535
|
-
await this.
|
|
515
|
+
await this.click(this.cultureAndHostnamesBtn);
|
|
536
516
|
}
|
|
537
517
|
async clickAddNewHostnameButton() {
|
|
538
|
-
await
|
|
539
|
-
await this.addNewHostnameBtn.click();
|
|
518
|
+
await this.click(this.addNewHostnameBtn);
|
|
540
519
|
}
|
|
541
520
|
async selectCultureLanguageOption(option) {
|
|
542
|
-
await
|
|
543
|
-
await this.
|
|
544
|
-
await (0, test_1.expect)(this.hostNameItem.getByText(option, { exact: true })).toBeVisible();
|
|
545
|
-
await this.hostNameItem.getByText(option, { exact: true }).click();
|
|
521
|
+
await this.click(this.cultureLanguageDropdownBox);
|
|
522
|
+
await this.click(this.page.getByText(option, { exact: true }));
|
|
546
523
|
}
|
|
547
524
|
async selectHostnameLanguageOption(option, index = 0) {
|
|
548
|
-
await this.hostnameLanguageDropdownBox.nth(index)
|
|
549
|
-
await this.hostnameComboBox.getByText(option).nth(index)
|
|
525
|
+
await this.click(this.hostnameLanguageDropdownBox.nth(index));
|
|
526
|
+
await this.click(this.hostnameComboBox.getByText(option).nth(index));
|
|
550
527
|
}
|
|
551
528
|
async enterDomain(value, index = 0) {
|
|
552
|
-
await
|
|
553
|
-
await this.hostnameTxt.nth(index).clear();
|
|
554
|
-
await this.hostnameTxt.nth(index).fill(value);
|
|
555
|
-
await (0, test_1.expect)(this.hostnameTxt.nth(index)).toHaveValue(value);
|
|
529
|
+
await this.enterText(this.hostnameTxt.nth(index), value, { verify: true });
|
|
556
530
|
}
|
|
557
531
|
async clickDeleteHostnameButton() {
|
|
558
|
-
await this.deleteHostnameBtn.first()
|
|
532
|
+
await this.click(this.deleteHostnameBtn.first());
|
|
559
533
|
}
|
|
560
534
|
async clickSaveModalButton() {
|
|
561
|
-
await this.
|
|
562
|
-
await this.page.waitForTimeout(
|
|
535
|
+
await this.click(this.saveModalBtn);
|
|
536
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
|
|
563
537
|
}
|
|
564
538
|
async chooseDocumentType(documentTypeName) {
|
|
565
|
-
await this.documentTypeNode.filter({ hasText: documentTypeName })
|
|
539
|
+
await this.click(this.documentTypeNode.filter({ hasText: documentTypeName }));
|
|
566
540
|
}
|
|
567
541
|
// Approved Color
|
|
568
542
|
async clickApprovedColorByValue(value) {
|
|
569
|
-
await this.page.locator(
|
|
543
|
+
await this.click(this.page.locator(`uui-color-swatch[value="#${value}"] #swatch`));
|
|
570
544
|
}
|
|
571
545
|
// Checkbox list
|
|
572
546
|
async chooseCheckboxListOption(optionValue) {
|
|
573
|
-
await this.page.locator(
|
|
547
|
+
await this.click(this.page.locator(`uui-checkbox[value="${optionValue}"] svg`));
|
|
574
548
|
}
|
|
575
549
|
// Content Picker
|
|
576
550
|
async addContentPicker(contentName) {
|
|
577
551
|
await this.clickChooseButton();
|
|
578
|
-
await this.sidebarModal.getByText(contentName)
|
|
579
|
-
await this.
|
|
552
|
+
await this.click(this.sidebarModal.getByText(contentName));
|
|
553
|
+
await this.click(this.chooseModalBtn);
|
|
580
554
|
}
|
|
581
555
|
async isOpenButtonVisibleInContentPicker(contentPickerName, isVisible = true) {
|
|
582
|
-
return
|
|
556
|
+
return await this.isVisible(this.page.getByLabel('Open ' + contentPickerName), isVisible);
|
|
583
557
|
}
|
|
584
558
|
async clickContentPickerOpenButton(contentPickerName) {
|
|
585
|
-
await this.page.getByLabel('Open ' + contentPickerName)
|
|
559
|
+
await this.click(this.page.getByLabel('Open ' + contentPickerName));
|
|
586
560
|
}
|
|
587
561
|
async isNodeOpenForContentPicker(contentPickerName) {
|
|
588
|
-
return
|
|
562
|
+
return await this.isVisible(this.openedModal.getByText(contentPickerName));
|
|
589
563
|
}
|
|
590
564
|
async isContentNameVisible(contentName, isVisible = true) {
|
|
591
|
-
return
|
|
565
|
+
return await this.isVisible(this.sidebarModal.getByText(contentName), isVisible);
|
|
592
566
|
}
|
|
593
567
|
async isContentInTreeVisible(name, isVisible = true) {
|
|
594
|
-
await
|
|
568
|
+
await this.isVisible(this.documentTreeItem.locator('[label="' + name + '"]'), isVisible);
|
|
595
569
|
}
|
|
596
570
|
async isChildContentInTreeVisible(parentName, childName, isVisible = true) {
|
|
597
|
-
await
|
|
571
|
+
await this.isVisible(this.documentTreeItem.locator('[label="' + parentName + '"]').locator('[uui-menu-item[label="' + childName + '"]'), isVisible);
|
|
598
572
|
}
|
|
599
573
|
async removeContentPicker(contentPickerName) {
|
|
600
|
-
const contentPickerLocator = this.entityItem.filter({ has: this.page.locator(
|
|
601
|
-
await contentPickerLocator.
|
|
602
|
-
await contentPickerLocator.getByLabel('Remove').click();
|
|
574
|
+
const contentPickerLocator = this.entityItem.filter({ has: this.page.locator(`[name="${contentPickerName}"]`) });
|
|
575
|
+
await this.hoverAndClick(contentPickerLocator, contentPickerLocator.getByLabel('Remove'));
|
|
603
576
|
await this.clickConfirmRemoveButton();
|
|
604
577
|
}
|
|
605
578
|
// Dropdown
|
|
606
579
|
async chooseDropdownOption(optionValues) {
|
|
607
|
-
await this.dropdown
|
|
580
|
+
await this.selectMultiple(this.dropdown, optionValues);
|
|
608
581
|
}
|
|
609
582
|
// Date Picker
|
|
610
583
|
async enterADate(date) {
|
|
@@ -612,7 +585,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
612
585
|
}
|
|
613
586
|
// Media Picker
|
|
614
587
|
async clickChooseMediaPickerButton() {
|
|
615
|
-
await this.
|
|
588
|
+
await this.click(this.chooseMediaPickerBtn);
|
|
616
589
|
}
|
|
617
590
|
async clickChooseButtonAndSelectMediaWithName(mediaName) {
|
|
618
591
|
await this.clickChooseMediaPickerButton();
|
|
@@ -623,17 +596,17 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
623
596
|
await this.selectMediaWithTestId(mediaKey);
|
|
624
597
|
}
|
|
625
598
|
async removeMediaPickerByName(mediaPickerName) {
|
|
626
|
-
await this.page.locator(
|
|
599
|
+
await this.click(this.page.locator(`[name="${mediaPickerName}"] [label="Remove"] svg`));
|
|
627
600
|
await this.clickConfirmRemoveButton();
|
|
628
601
|
}
|
|
629
602
|
async isMediaNameVisible(mediaName, isVisible = true) {
|
|
630
|
-
return
|
|
603
|
+
return await this.isVisible(this.mediaCardItems.filter({ hasText: mediaName }), isVisible);
|
|
631
604
|
}
|
|
632
605
|
async clickResetFocalPointButton() {
|
|
633
|
-
await this.
|
|
606
|
+
await this.click(this.resetFocalPointBtn);
|
|
634
607
|
}
|
|
635
608
|
async setFocalPoint(widthPercentage = 50, heightPercentage = 50) {
|
|
636
|
-
await this.page.waitForTimeout(
|
|
609
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.medium);
|
|
637
610
|
const element = await this.page.locator('#image').boundingBox();
|
|
638
611
|
if (!element) {
|
|
639
612
|
throw new Error('Element not found');
|
|
@@ -642,111 +615,104 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
642
615
|
const centerY = element.y + element.height / 2;
|
|
643
616
|
const x = element.x + (element.width * widthPercentage) / 100;
|
|
644
617
|
const y = element.y + (element.height * heightPercentage) / 100;
|
|
645
|
-
await this.page.waitForTimeout(
|
|
618
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.minimal);
|
|
646
619
|
await this.page.mouse.move(centerX, centerY, { steps: 5 });
|
|
647
|
-
await this.page.waitForTimeout(
|
|
620
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.minimal);
|
|
648
621
|
await this.page.mouse.down();
|
|
649
|
-
await this.page.waitForTimeout(
|
|
622
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.minimal);
|
|
650
623
|
await this.page.mouse.move(x, y);
|
|
651
|
-
await this.page.waitForTimeout(
|
|
624
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.minimal);
|
|
652
625
|
await this.page.mouse.up();
|
|
653
626
|
}
|
|
654
627
|
// Member Picker
|
|
655
628
|
async clickChooseMemberPickerButton() {
|
|
656
|
-
await this.
|
|
629
|
+
await this.click(this.chooseMemberPickerBtn);
|
|
657
630
|
}
|
|
658
631
|
async selectMemberByName(memberName) {
|
|
659
|
-
await this.sidebarModal.getByText(memberName, { exact: true })
|
|
632
|
+
await this.click(this.sidebarModal.getByText(memberName, { exact: true }));
|
|
660
633
|
}
|
|
661
634
|
async removeMemberPickerByName(memberName) {
|
|
662
|
-
const mediaPickerLocator = this.entityItem.filter({ has: this.page.locator(
|
|
663
|
-
await mediaPickerLocator.
|
|
664
|
-
await mediaPickerLocator.getByLabel('Remove').click();
|
|
635
|
+
const mediaPickerLocator = this.entityItem.filter({ has: this.page.locator(`[name="${memberName}"]`) });
|
|
636
|
+
await this.hoverAndClick(mediaPickerLocator, mediaPickerLocator.getByLabel('Remove'));
|
|
665
637
|
await this.clickConfirmRemoveButton();
|
|
666
638
|
}
|
|
667
639
|
// Numeric
|
|
668
640
|
async enterNumeric(number) {
|
|
669
|
-
await this.numericTxt.
|
|
670
|
-
await this.numericTxt.fill(number.toString());
|
|
641
|
+
await this.enterText(this.numericTxt, number.toString());
|
|
671
642
|
}
|
|
672
643
|
// Radiobox
|
|
673
644
|
async chooseRadioboxOption(optionValue) {
|
|
674
|
-
await this.page.locator(
|
|
645
|
+
await this.click(this.page.locator(`uui-radio[value="${optionValue}"] #button`));
|
|
675
646
|
}
|
|
676
647
|
// Tags
|
|
677
648
|
async clickPlusIconButton() {
|
|
678
|
-
await this.
|
|
649
|
+
await this.click(this.plusIconBtn);
|
|
679
650
|
}
|
|
680
651
|
async enterTag(tagName) {
|
|
681
|
-
await this.enterTagTxt
|
|
682
|
-
await this.enterTagTxt
|
|
652
|
+
await this.enterText(this.enterTagTxt, tagName);
|
|
653
|
+
await this.pressKey(this.enterTagTxt, 'Enter');
|
|
683
654
|
}
|
|
684
655
|
async removeTagByName(tagName) {
|
|
685
|
-
await
|
|
686
|
-
await this.tagItems.filter({ hasText: tagName }).locator('svg').click();
|
|
656
|
+
await this.click(this.tagItems.filter({ hasText: tagName }).locator('svg'));
|
|
687
657
|
}
|
|
688
658
|
// Multi URL Picker
|
|
689
659
|
async clickAddMultiURLPickerButton() {
|
|
690
|
-
await this.
|
|
660
|
+
await this.click(this.addMultiURLPickerBtn);
|
|
691
661
|
}
|
|
692
662
|
async selectLinkByName(linkName) {
|
|
693
|
-
await
|
|
694
|
-
await this.sidebarModal.getByText(linkName, { exact: true }).click();
|
|
663
|
+
await this.click(this.sidebarModal.getByText(linkName, { exact: true }));
|
|
695
664
|
}
|
|
696
665
|
async enterLink(value, toPress = false) {
|
|
697
|
-
await this.linkTxt.clear();
|
|
698
666
|
if (toPress) {
|
|
699
|
-
await this.linkTxt
|
|
667
|
+
await this.enterText(this.linkTxt, '');
|
|
668
|
+
await this.pressKey(this.linkTxt, value);
|
|
700
669
|
}
|
|
701
670
|
else {
|
|
702
|
-
await this.linkTxt
|
|
671
|
+
await this.enterText(this.linkTxt, value);
|
|
703
672
|
}
|
|
704
673
|
}
|
|
705
674
|
async enterAnchorOrQuerystring(value, toPress = false) {
|
|
706
|
-
await this.anchorQuerystringTxt.clear();
|
|
707
675
|
if (toPress) {
|
|
708
|
-
await this.anchorQuerystringTxt
|
|
676
|
+
await this.enterText(this.anchorQuerystringTxt, '');
|
|
677
|
+
await this.pressKey(this.anchorQuerystringTxt, value);
|
|
709
678
|
}
|
|
710
679
|
else {
|
|
711
|
-
await this.anchorQuerystringTxt
|
|
680
|
+
await this.enterText(this.anchorQuerystringTxt, value);
|
|
712
681
|
}
|
|
713
682
|
}
|
|
714
683
|
async enterLinkTitle(value, toPress = false) {
|
|
715
|
-
await this.linkTitleTxt.clear();
|
|
716
684
|
if (toPress) {
|
|
717
|
-
await this.linkTitleTxt
|
|
685
|
+
await this.enterText(this.linkTitleTxt, '');
|
|
686
|
+
await this.pressKey(this.linkTitleTxt, value);
|
|
718
687
|
}
|
|
719
688
|
else {
|
|
720
|
-
await this.linkTitleTxt
|
|
689
|
+
await this.enterText(this.linkTitleTxt, value);
|
|
721
690
|
}
|
|
722
691
|
}
|
|
723
692
|
async removeUrlPickerByName(linkName) {
|
|
724
|
-
await this.page.locator(
|
|
693
|
+
await this.click(this.page.locator(`[name="${linkName}"]`).getByLabel('Remove'));
|
|
725
694
|
await this.clickConfirmRemoveButton();
|
|
726
695
|
}
|
|
727
696
|
async clickEditUrlPickerButtonByName(linkName) {
|
|
728
|
-
await this.page.locator(
|
|
697
|
+
await this.click(this.page.locator(`[name="${linkName}"]`).getByLabel('Edit'));
|
|
729
698
|
}
|
|
730
699
|
// Upload
|
|
731
700
|
async clickRemoveFilesButton() {
|
|
732
|
-
await
|
|
733
|
-
await this.removeFilesBtn.click();
|
|
701
|
+
await this.click(this.removeFilesBtn);
|
|
734
702
|
}
|
|
735
703
|
// True/false
|
|
736
704
|
async clickToggleButton() {
|
|
737
|
-
await
|
|
738
|
-
await this.toggleBtn.click({ force: true });
|
|
705
|
+
await this.click(this.toggleBtn, { force: true });
|
|
739
706
|
}
|
|
740
707
|
async doesToggleHaveLabel(label) {
|
|
741
|
-
|
|
708
|
+
await this.hasText(this.toggleInput, label);
|
|
742
709
|
}
|
|
743
710
|
// Multiple Text String
|
|
744
711
|
async clickAddMultipleTextStringButton() {
|
|
745
|
-
await this.
|
|
712
|
+
await this.click(this.addMultipleTextStringBtn);
|
|
746
713
|
}
|
|
747
714
|
async enterMultipleTextStringValue(value) {
|
|
748
|
-
await this.multipleTextStringValueTxt
|
|
749
|
-
await this.multipleTextStringValueTxt.fill(value);
|
|
715
|
+
await this.enterText(this.multipleTextStringValueTxt, value);
|
|
750
716
|
}
|
|
751
717
|
async addMultipleTextStringItem(value) {
|
|
752
718
|
await this.clickAddMultipleTextStringButton();
|
|
@@ -765,134 +731,115 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
765
731
|
await this.sliderInput.fill(value);
|
|
766
732
|
}
|
|
767
733
|
async isDocumentTypeNameVisible(contentName, isVisible = true) {
|
|
768
|
-
return
|
|
734
|
+
return await this.isVisible(this.sidebarModal.getByText(contentName), isVisible);
|
|
769
735
|
}
|
|
770
736
|
async doesModalHaveText(text) {
|
|
771
|
-
|
|
737
|
+
await this.containsText(this.openedModal, text);
|
|
772
738
|
}
|
|
773
739
|
// Collection tab
|
|
774
740
|
async isTabNameVisible(tabName) {
|
|
775
|
-
return
|
|
776
|
-
}
|
|
777
|
-
async clickTabWithName(tabName) {
|
|
778
|
-
const tabLocator = this.tabItems.filter({ hasText: tabName });
|
|
779
|
-
await (0, test_1.expect)(tabLocator).toBeVisible();
|
|
780
|
-
await tabLocator.click();
|
|
741
|
+
return await this.isVisible(this.tabItems.filter({ hasText: tabName }));
|
|
781
742
|
}
|
|
782
743
|
async doesDocumentHaveName(name) {
|
|
783
|
-
|
|
744
|
+
await this.hasValue(this.enterAName, name);
|
|
784
745
|
}
|
|
785
746
|
async doesDocumentTableColumnNameValuesMatch(expectedValues) {
|
|
786
|
-
await
|
|
747
|
+
await this.waitForVisible(this.documentListView);
|
|
787
748
|
return expectedValues.forEach((text, index) => {
|
|
788
749
|
(0, test_1.expect)(this.documentTableColumnName.nth(index)).toHaveText(text);
|
|
789
750
|
});
|
|
790
751
|
}
|
|
791
752
|
async searchByKeywordInCollection(keyword) {
|
|
792
|
-
await this.searchTxt
|
|
793
|
-
await this.searchTxt
|
|
794
|
-
await this.
|
|
795
|
-
await this.page.waitForTimeout(500);
|
|
753
|
+
await this.enterText(this.searchTxt, keyword);
|
|
754
|
+
await this.pressKey(this.searchTxt, 'Enter');
|
|
755
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
|
|
796
756
|
}
|
|
797
757
|
async clickSelectVariantButton() {
|
|
798
|
-
await
|
|
799
|
-
await this.selectAVariantBtn.click();
|
|
758
|
+
await this.click(this.selectAVariantBtn);
|
|
800
759
|
}
|
|
801
760
|
async clickVariantAddModeButtonForLanguageName(language) {
|
|
802
|
-
await this.variantAddModeBtn.getByText(language)
|
|
803
|
-
await this.page.waitForTimeout(
|
|
761
|
+
await this.click(this.variantAddModeBtn.getByText(language));
|
|
762
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
|
|
804
763
|
}
|
|
805
764
|
async clickSaveAndCloseButton() {
|
|
806
|
-
await this.
|
|
807
|
-
await this.page.waitForTimeout(
|
|
765
|
+
await this.click(this.saveAndCloseBtn);
|
|
766
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
|
|
808
767
|
}
|
|
809
768
|
// List View
|
|
810
769
|
async clickCreateContentWithName(name) {
|
|
811
|
-
await
|
|
812
|
-
await this.page.getByLabel('Create ' + name).click();
|
|
770
|
+
await this.click(this.page.getByLabel(`Create ${name}`));
|
|
813
771
|
}
|
|
814
772
|
async enterNameInContainer(name) {
|
|
815
|
-
await
|
|
816
|
-
await this.enterNameInContainerTxt.clear();
|
|
817
|
-
await this.enterNameInContainerTxt.fill(name);
|
|
773
|
+
await this.enterText(this.enterNameInContainerTxt, name);
|
|
818
774
|
}
|
|
819
775
|
async goToContentInListViewWithName(contentName) {
|
|
820
|
-
await this.listView.getByLabel(contentName)
|
|
776
|
+
await this.click(this.listView.getByLabel(contentName));
|
|
821
777
|
}
|
|
822
778
|
async doesListViewHaveNoItemsInList() {
|
|
823
|
-
await
|
|
779
|
+
await this.isVisible(this.listView.filter({ hasText: 'There are no items to show in the list.' }));
|
|
824
780
|
}
|
|
825
781
|
async doesContentListHaveNoItemsInList() {
|
|
826
|
-
await
|
|
782
|
+
await this.isVisible(this.umbDocumentCollection.filter({ hasText: 'No items' }));
|
|
827
783
|
}
|
|
828
784
|
async clickNameButtonInListView() {
|
|
829
|
-
await this.
|
|
785
|
+
await this.click(this.nameBtn);
|
|
830
786
|
}
|
|
831
787
|
async doesFirstItemInListViewHaveName(name) {
|
|
832
788
|
await (0, test_1.expect)(this.listViewTableRow.first()).toContainText(name);
|
|
833
789
|
}
|
|
834
790
|
async doesListViewContainCount(count) {
|
|
835
|
-
await
|
|
791
|
+
await this.hasCount(this.listViewTableRow, count);
|
|
836
792
|
}
|
|
837
793
|
async selectContentWithNameInListView(name) {
|
|
838
|
-
|
|
839
|
-
await (0, test_1.expect)(contentInListViewLocator).toBeVisible();
|
|
840
|
-
await contentInListViewLocator.click();
|
|
794
|
+
await this.click(this.listViewTableRow.filter({ hasText: name }));
|
|
841
795
|
}
|
|
842
796
|
async clickPublishSelectedListItems() {
|
|
843
|
-
await this.
|
|
797
|
+
await this.click(this.publishSelectedListItems);
|
|
844
798
|
}
|
|
845
799
|
async clickUnpublishSelectedListItems() {
|
|
846
|
-
await this.
|
|
800
|
+
await this.click(this.unpublishSelectedListItems);
|
|
847
801
|
}
|
|
848
802
|
async clickDuplicateToSelectedListItems() {
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
await this.duplicateToSelectedListItems.click({ force: true });
|
|
803
|
+
// Force click is needed
|
|
804
|
+
await this.click(this.duplicateToSelectedListItems, { force: true });
|
|
852
805
|
}
|
|
853
806
|
async clickMoveToSelectedListItems() {
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
await this.moveToSelectedListItems.click({ force: true });
|
|
807
|
+
// Force click is needed
|
|
808
|
+
await this.click(this.moveToSelectedListItems, { force: true });
|
|
857
809
|
}
|
|
858
810
|
async clickTrashSelectedListItems() {
|
|
859
|
-
await this.
|
|
811
|
+
await this.click(this.trashSelectedListItems);
|
|
860
812
|
}
|
|
861
813
|
async selectDocumentWithNameAtRoot(name) {
|
|
862
814
|
await this.openCaretButtonForName('Content');
|
|
863
|
-
|
|
864
|
-
await (0, test_1.expect)(documentWithNameLocator).toBeVisible();
|
|
865
|
-
await documentWithNameLocator.click();
|
|
815
|
+
await this.click(this.modalContent.getByLabel(name));
|
|
866
816
|
await this.clickChooseButton();
|
|
867
817
|
}
|
|
868
818
|
async clickTrashButton() {
|
|
869
|
-
await
|
|
870
|
-
await this.trashBtn.click();
|
|
819
|
+
await this.click(this.trashBtn);
|
|
871
820
|
}
|
|
872
821
|
async clickExactTrashButton() {
|
|
873
|
-
await this.
|
|
822
|
+
await this.click(this.exactTrashBtn);
|
|
874
823
|
}
|
|
875
824
|
async isDocumentListViewVisible(isVisible = true) {
|
|
876
|
-
await
|
|
825
|
+
await this.isVisible(this.documentListView, isVisible);
|
|
877
826
|
}
|
|
878
827
|
async isDocumentGridViewVisible(isVisible = true) {
|
|
879
|
-
await
|
|
828
|
+
await this.isVisible(this.documentGridView, isVisible);
|
|
880
829
|
}
|
|
881
830
|
async changeDocumentSectionLanguage(newLanguageName) {
|
|
882
|
-
await this.
|
|
883
|
-
const documentSectionLanguageLocator = this.documentLanguageSelectPopover.getByText(newLanguageName);
|
|
884
|
-
await (0, test_1.expect)(documentSectionLanguageLocator).toBeVisible();
|
|
831
|
+
await this.click(this.documentLanguageSelect);
|
|
885
832
|
// Force click is needed
|
|
886
|
-
await
|
|
833
|
+
await this.click(this.documentLanguageSelectPopover.getByText(newLanguageName), { force: true });
|
|
887
834
|
}
|
|
888
835
|
async doesDocumentSectionHaveLanguageSelected(languageName) {
|
|
889
|
-
await
|
|
836
|
+
await this.hasText(this.documentLanguageSelect, languageName);
|
|
890
837
|
}
|
|
891
838
|
async isDocumentReadOnly(isVisible = true) {
|
|
892
|
-
await
|
|
839
|
+
await this.isVisible(this.documentReadOnly, isVisible);
|
|
893
840
|
}
|
|
894
841
|
async isDocumentNameInputEditable(isEditable = true) {
|
|
895
|
-
await
|
|
842
|
+
await this.waitForVisible(this.contentNameTxt);
|
|
896
843
|
await (0, test_1.expect)(this.contentNameTxt).toBeEditable({ editable: isEditable });
|
|
897
844
|
}
|
|
898
845
|
async isActionsMenuForRecycleBinVisible(isVisible = true) {
|
|
@@ -902,270 +849,225 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
902
849
|
await this.isActionsMenuForNameVisible('Content', isVisible);
|
|
903
850
|
}
|
|
904
851
|
async clickEmptyRecycleBinButton() {
|
|
905
|
-
await this.
|
|
906
|
-
await (0, test_1.expect)(this.emptyRecycleBinBtn).toBeVisible();
|
|
852
|
+
await this.hover(this.recycleBinMenuItem);
|
|
907
853
|
// Force click is needed
|
|
908
|
-
await this.
|
|
854
|
+
await this.click(this.emptyRecycleBinBtn, { force: true });
|
|
909
855
|
}
|
|
910
856
|
async clickConfirmEmptyRecycleBinButton() {
|
|
911
|
-
await this.
|
|
857
|
+
await this.click(this.confirmEmptyRecycleBinBtn);
|
|
912
858
|
}
|
|
913
859
|
async isDocumentPropertyEditable(propertyName, isEditable = true) {
|
|
914
860
|
const propertyLocator = this.documentWorkspace.locator(this.property).filter({ hasText: propertyName }).locator('#input');
|
|
915
|
-
await
|
|
861
|
+
await this.waitForVisible(propertyLocator);
|
|
916
862
|
await (0, test_1.expect)(propertyLocator).toBeEditable({ editable: isEditable });
|
|
917
863
|
}
|
|
918
864
|
async doesDocumentPropertyHaveValue(propertyName, value) {
|
|
919
865
|
const propertyLocator = this.documentWorkspace.locator(this.property).filter({ hasText: propertyName }).locator('#input');
|
|
920
|
-
await (
|
|
866
|
+
await this.hasValue(propertyLocator, value);
|
|
921
867
|
}
|
|
922
868
|
async clickContentTab() {
|
|
923
|
-
await this.splitView.getByRole('tab', { name: 'Content' })
|
|
869
|
+
await this.click(this.splitView.getByRole('tab', { name: 'Content' }));
|
|
924
870
|
}
|
|
925
871
|
async isDocumentTreeEmpty() {
|
|
926
|
-
await
|
|
872
|
+
await this.hasCount(this.documentTreeItem, 0);
|
|
927
873
|
}
|
|
928
874
|
async doesDocumentWorkspaceContainName(name) {
|
|
929
875
|
await (0, test_1.expect)(this.documentWorkspaceEditor.locator('#input')).toHaveValue(name);
|
|
930
876
|
}
|
|
931
877
|
async doesDocumentWorkspaceHaveText(text) {
|
|
932
|
-
|
|
878
|
+
await this.containsText(this.documentWorkspace, text);
|
|
933
879
|
}
|
|
934
880
|
async enterDocumentBlueprintName(name) {
|
|
935
|
-
await this.documentBlueprintModalEnterNameTxt
|
|
936
|
-
await this.documentBlueprintModalEnterNameTxt.fill(name);
|
|
881
|
+
await this.enterText(this.documentBlueprintModalEnterNameTxt, name);
|
|
937
882
|
}
|
|
938
883
|
async clickSaveDocumentBlueprintButton() {
|
|
939
|
-
await this.
|
|
884
|
+
await this.click(this.documentBlueprintSaveBtn);
|
|
940
885
|
}
|
|
941
886
|
async clickDuplicateToButton() {
|
|
942
|
-
await this.
|
|
887
|
+
await this.click(this.duplicateToBtn);
|
|
943
888
|
}
|
|
944
889
|
async clickDuplicateButton() {
|
|
945
|
-
await this.
|
|
890
|
+
await this.click(this.duplicateBtn);
|
|
946
891
|
}
|
|
947
892
|
async clickMoveToButton() {
|
|
948
|
-
await this.
|
|
893
|
+
await this.click(this.moveToBtn);
|
|
949
894
|
}
|
|
950
895
|
async moveToContentWithName(parentNames, moveTo) {
|
|
951
896
|
for (const contentName of parentNames) {
|
|
952
|
-
await this.container.getByLabel(
|
|
897
|
+
await this.click(this.container.getByLabel(`Expand child items for ${contentName}`));
|
|
953
898
|
}
|
|
954
|
-
await this.container.getByLabel(moveTo)
|
|
899
|
+
await this.click(this.container.getByLabel(moveTo));
|
|
955
900
|
await this.clickChooseContainerButton();
|
|
956
901
|
}
|
|
957
902
|
async isCaretButtonVisibleForContentName(contentName, isVisible = true) {
|
|
958
|
-
await
|
|
903
|
+
await this.isVisible(this.page.locator(`[label="${contentName}"]`).getByLabel('Expand child items for '), isVisible);
|
|
959
904
|
}
|
|
960
905
|
async reloadContentTree() {
|
|
961
|
-
await (0, test_1.expect)(this.contentTreeRefreshBtn).toBeVisible();
|
|
962
906
|
// Force click is needed
|
|
963
|
-
await this.
|
|
907
|
+
await this.click(this.contentTreeRefreshBtn, { force: true });
|
|
964
908
|
}
|
|
965
909
|
async clickSortChildrenButton() {
|
|
966
|
-
await
|
|
967
|
-
await this.sortChildrenBtn.click();
|
|
910
|
+
await this.click(this.sortChildrenBtn);
|
|
968
911
|
}
|
|
969
912
|
async clickRollbackButton() {
|
|
970
|
-
await
|
|
971
|
-
await this.rollbackBtn.click();
|
|
913
|
+
await this.click(this.rollbackBtn);
|
|
972
914
|
}
|
|
973
915
|
async clickRollbackContainerButton() {
|
|
974
|
-
await
|
|
975
|
-
await this.rollbackContainerBtn.click();
|
|
916
|
+
await this.click(this.rollbackContainerBtn);
|
|
976
917
|
}
|
|
977
918
|
async clickLatestRollBackItem() {
|
|
978
|
-
await
|
|
979
|
-
await this.rollbackItem.last().click();
|
|
919
|
+
await this.click(this.rollbackItem.last());
|
|
980
920
|
}
|
|
981
921
|
async clickPublicAccessButton() {
|
|
982
|
-
await
|
|
983
|
-
await this.publicAccessBtn.click();
|
|
922
|
+
await this.click(this.publicAccessBtn);
|
|
984
923
|
}
|
|
985
924
|
async addGroupBasedPublicAccess(memberGroupName, documentName) {
|
|
986
|
-
await
|
|
987
|
-
await this.groupBasedProtectionBtn.click();
|
|
925
|
+
await this.click(this.groupBasedProtectionBtn);
|
|
988
926
|
await this.clickNextButton();
|
|
989
|
-
await this.
|
|
990
|
-
await this.page.getByLabel(memberGroupName)
|
|
927
|
+
await this.click(this.chooseMemberGroupBtn);
|
|
928
|
+
await this.click(this.page.getByLabel(memberGroupName));
|
|
991
929
|
await this.clickChooseModalButton();
|
|
992
|
-
await this.
|
|
993
|
-
await this.container.getByLabel(documentName, { exact: true })
|
|
930
|
+
await this.click(this.selectLoginPageDocument);
|
|
931
|
+
await this.click(this.container.getByLabel(documentName, { exact: true }));
|
|
994
932
|
await this.clickChooseModalButton();
|
|
995
|
-
await this.
|
|
996
|
-
await this.container.getByLabel(documentName, { exact: true })
|
|
933
|
+
await this.click(this.selectErrorPageDocument);
|
|
934
|
+
await this.click(this.container.getByLabel(documentName, { exact: true }));
|
|
997
935
|
await this.clickChooseModalButton();
|
|
998
|
-
await this.
|
|
936
|
+
await this.click(this.containerSaveBtn);
|
|
999
937
|
}
|
|
1000
938
|
async sortChildrenDragAndDrop(dragFromSelector, dragToSelector, verticalOffset = 0, horizontalOffset = 0, steps = 5) {
|
|
1001
|
-
await
|
|
1002
|
-
await
|
|
939
|
+
await this.waitForVisible(dragFromSelector);
|
|
940
|
+
await this.waitForVisible(dragToSelector);
|
|
1003
941
|
const targetLocation = await dragToSelector.boundingBox();
|
|
1004
942
|
const elementCenterX = targetLocation.x + targetLocation.width / 2;
|
|
1005
943
|
const elementCenterY = targetLocation.y + targetLocation.height / 2;
|
|
1006
|
-
await
|
|
944
|
+
await this.hover(dragFromSelector);
|
|
1007
945
|
await this.page.mouse.move(10, 10);
|
|
1008
|
-
await
|
|
946
|
+
await this.hover(dragFromSelector);
|
|
1009
947
|
await this.page.mouse.down();
|
|
1010
|
-
await this.page.waitForTimeout(
|
|
948
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.debounce);
|
|
1011
949
|
await this.page.mouse.move(elementCenterX + horizontalOffset, elementCenterY + verticalOffset, { steps: steps });
|
|
1012
|
-
await this.page.waitForTimeout(
|
|
950
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.debounce);
|
|
1013
951
|
// If we do not have this, the drag and drop will not work
|
|
1014
|
-
await
|
|
952
|
+
await this.hover(dragToSelector);
|
|
1015
953
|
await this.page.mouse.up();
|
|
1016
954
|
}
|
|
1017
955
|
async clickSortButton() {
|
|
1018
|
-
await
|
|
1019
|
-
await this.sortBtn.click();
|
|
956
|
+
await this.click(this.sortBtn);
|
|
1020
957
|
}
|
|
1021
958
|
async doesIndexDocumentInTreeContainName(parentName, childName, index) {
|
|
1022
|
-
await (0, test_1.expect)(this.documentTreeItem.locator(
|
|
959
|
+
await (0, test_1.expect)(this.documentTreeItem.locator(`[label="${parentName}"]`).locator('umb-tree-item').nth(index).locator('#label')).toHaveText(childName);
|
|
1023
960
|
}
|
|
1024
961
|
async selectMemberGroup(memberGroupName) {
|
|
1025
|
-
await
|
|
1026
|
-
await this.uuiCheckbox.getByLabel(memberGroupName).click();
|
|
962
|
+
await this.click(this.uuiCheckbox.getByLabel(memberGroupName));
|
|
1027
963
|
}
|
|
1028
964
|
async isPermissionInActionsMenuVisible(permissionName, isVisible = true) {
|
|
1029
|
-
await
|
|
965
|
+
await this.isVisible(this.actionsMenu.getByRole('button', {
|
|
1030
966
|
name: permissionName,
|
|
1031
967
|
exact: true
|
|
1032
|
-
})
|
|
968
|
+
}), isVisible);
|
|
1033
969
|
}
|
|
1034
970
|
async clickDocumentLinkButton() {
|
|
1035
|
-
await
|
|
1036
|
-
await this.linkToDocumentBtn.click();
|
|
971
|
+
await this.click(this.linkToDocumentBtn);
|
|
1037
972
|
}
|
|
1038
973
|
async clickMediaLinkButton() {
|
|
1039
|
-
await
|
|
1040
|
-
await this.linkToMediaBtn.click();
|
|
974
|
+
await this.click(this.linkToMediaBtn);
|
|
1041
975
|
}
|
|
1042
976
|
async clickManualLinkButton() {
|
|
1043
|
-
await
|
|
1044
|
-
await this.linkToManualBtn.click();
|
|
977
|
+
await this.click(this.linkToManualBtn);
|
|
1045
978
|
}
|
|
1046
979
|
// Block Grid - Block List
|
|
1047
980
|
async clickAddBlockElementButton() {
|
|
1048
|
-
await
|
|
1049
|
-
await this.addBlockElementBtn.click();
|
|
981
|
+
await this.click(this.addBlockElementBtn);
|
|
1050
982
|
}
|
|
1051
983
|
async clickAddBlockWithNameButton(name) {
|
|
1052
|
-
await
|
|
1053
|
-
await this.page.getByLabel('Add ' + name).click();
|
|
984
|
+
await this.click(this.page.getByLabel(`Add ${name}`));
|
|
1054
985
|
}
|
|
1055
986
|
async clickCreateForModalWithHeadline(headline) {
|
|
1056
|
-
await
|
|
1057
|
-
await this.page.locator('[headline="' + headline + '"]').getByLabel('Create').click();
|
|
987
|
+
await this.click(this.page.locator(`[headline="${headline}"]`).getByLabel('Create'));
|
|
1058
988
|
}
|
|
1059
989
|
async isAddBlockElementButtonVisible(isVisible = true) {
|
|
1060
|
-
await
|
|
990
|
+
await this.isVisible(this.addBlockElementBtn, isVisible);
|
|
1061
991
|
}
|
|
1062
992
|
async isAddBlockElementButtonWithLabelVisible(blockName, label, isVisible = true) {
|
|
1063
|
-
await
|
|
993
|
+
await this.isVisible(this.property.filter({ hasText: blockName }).locator(this.addBlockElementBtn).filter({ hasText: label }), isVisible);
|
|
1064
994
|
}
|
|
1065
995
|
async doesFormValidationMessageContainText(text) {
|
|
1066
|
-
await
|
|
996
|
+
await this.containsText(this.formValidationMessage, text);
|
|
1067
997
|
}
|
|
1068
998
|
async doesBlockElementHaveName(name) {
|
|
1069
|
-
await
|
|
999
|
+
await this.containsText(this.blockName, name);
|
|
1070
1000
|
}
|
|
1071
1001
|
async clickAddBlockSettingsTabButton() {
|
|
1072
|
-
await
|
|
1073
|
-
await this.addBlockSettingsTabBtn.click();
|
|
1002
|
+
await this.click(this.addBlockSettingsTabBtn);
|
|
1074
1003
|
}
|
|
1075
1004
|
async clickEditBlockGridBlockButton() {
|
|
1076
|
-
await
|
|
1077
|
-
await this.blockGridEntry.hover();
|
|
1078
|
-
await (0, test_1.expect)(this.editBlockEntryBtn).toBeVisible();
|
|
1079
|
-
await this.editBlockEntryBtn.click();
|
|
1005
|
+
await this.hoverAndClick(this.blockGridEntry, this.editBlockEntryBtn);
|
|
1080
1006
|
}
|
|
1081
1007
|
async clickDeleteBlockGridBlockButton() {
|
|
1082
|
-
await
|
|
1083
|
-
await this.blockGridEntry.hover();
|
|
1084
|
-
await (0, test_1.expect)(this.deleteBlockEntryBtn).toBeVisible();
|
|
1085
|
-
await this.deleteBlockEntryBtn.click();
|
|
1008
|
+
await this.hoverAndClick(this.blockGridEntry, this.deleteBlockEntryBtn);
|
|
1086
1009
|
}
|
|
1087
1010
|
async clickEditBlockListBlockButton() {
|
|
1088
|
-
await
|
|
1089
|
-
await this.blockListEntry.hover();
|
|
1090
|
-
await (0, test_1.expect)(this.editBlockEntryBtn).toBeVisible();
|
|
1091
|
-
await this.editBlockEntryBtn.click();
|
|
1011
|
+
await this.hoverAndClick(this.blockListEntry, this.editBlockEntryBtn);
|
|
1092
1012
|
}
|
|
1093
1013
|
async clickDeleteBlockListBlockButton() {
|
|
1094
|
-
await
|
|
1095
|
-
await this.blockListEntry.hover();
|
|
1096
|
-
await (0, test_1.expect)(this.deleteBlockEntryBtn).toBeVisible();
|
|
1097
|
-
await this.deleteBlockEntryBtn.click();
|
|
1014
|
+
await this.hoverAndClick(this.blockListEntry, this.deleteBlockEntryBtn);
|
|
1098
1015
|
}
|
|
1099
1016
|
async clickCopyBlockListBlockButton(groupName, propertyName, blockName, index = 0) {
|
|
1100
1017
|
const blockListBlock = this.workspaceEditTab.filter({ hasText: groupName }).locator(this.workspaceEditProperties).filter({ hasText: propertyName }).locator(this.blockListEntry).nth(index).filter({ hasText: blockName });
|
|
1101
|
-
await blockListBlock.
|
|
1102
|
-
await
|
|
1103
|
-
await blockListBlock.locator(this.copyBlockEntryBtn).click({ force: true });
|
|
1104
|
-
await this.page.waitForTimeout(500);
|
|
1018
|
+
await this.hoverAndClick(blockListBlock, blockListBlock.locator(this.copyBlockEntryBtn), { force: true });
|
|
1019
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
|
|
1105
1020
|
}
|
|
1106
1021
|
async clickCopyBlockGridBlockButton(groupName, propertyName, blockName, index = 0) {
|
|
1107
1022
|
const blockGridBlock = this.workspaceEditTab.filter({ hasText: groupName }).locator(this.workspaceEditProperties).filter({ hasText: propertyName }).locator(this.blockGridEntry).nth(index).filter({ hasText: blockName });
|
|
1108
|
-
await blockGridBlock.
|
|
1109
|
-
await
|
|
1110
|
-
await blockGridBlock.locator(this.copyBlockEntryBtn).click({ force: true });
|
|
1111
|
-
await this.page.waitForTimeout(500);
|
|
1023
|
+
await this.hoverAndClick(blockGridBlock, blockGridBlock.locator(this.copyBlockEntryBtn), { force: true });
|
|
1024
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
|
|
1112
1025
|
}
|
|
1113
1026
|
async clickPasteFromClipboardButtonForProperty(groupName, propertyName) {
|
|
1114
|
-
await this.page.waitForTimeout(
|
|
1027
|
+
await this.page.waitForTimeout(ConstantHelper_1.ConstantHelper.wait.short);
|
|
1115
1028
|
const property = this.workspaceEditTab.filter({ hasText: groupName }).locator(this.property).filter({ hasText: propertyName });
|
|
1116
|
-
await
|
|
1117
|
-
await (0, test_1.expect)(property.locator(this.pasteFromClipboardBtn)).toBeVisible();
|
|
1118
|
-
await property.locator(this.pasteFromClipboardBtn).click({ force: true });
|
|
1029
|
+
await this.click(property.locator(this.pasteFromClipboardBtn), { force: true });
|
|
1119
1030
|
}
|
|
1120
1031
|
async clickActionsMenuForProperty(groupName, propertyName) {
|
|
1121
1032
|
const property = this.workspaceEditTab.filter({ hasText: groupName }).locator(this.workspaceEditProperties).filter({ hasText: propertyName });
|
|
1122
|
-
await property.
|
|
1123
|
-
await (0, test_1.expect)(property.locator(this.openActionsMenu)).toBeVisible();
|
|
1124
|
-
await property.locator(this.openActionsMenu).click({ force: true });
|
|
1033
|
+
await this.hoverAndClick(property, property.locator(this.openActionsMenu), { force: true });
|
|
1125
1034
|
}
|
|
1126
1035
|
async clickAddBlockGridElementWithName(elementTypeName) {
|
|
1127
|
-
await
|
|
1128
|
-
await this.page.getByRole('link', { name: 'Add ' + elementTypeName, exact: true }).click();
|
|
1036
|
+
await this.click(this.page.getByRole('link', { name: `Add ${elementTypeName}`, exact: true }));
|
|
1129
1037
|
}
|
|
1130
1038
|
async clickEditBlockListEntryWithName(blockListElementName) {
|
|
1131
|
-
await
|
|
1132
|
-
await this.blockListEntry.filter({ hasText: blockListElementName }).getByLabel('edit').click({ force: true });
|
|
1039
|
+
await this.click(this.blockListEntry.filter({ hasText: blockListElementName }).getByLabel('edit'), { force: true });
|
|
1133
1040
|
}
|
|
1134
1041
|
async clickSelectBlockElementWithName(elementTypeName) {
|
|
1135
|
-
await
|
|
1136
|
-
await this.page.getByRole('button', { name: elementTypeName, exact: true }).click();
|
|
1042
|
+
await this.click(this.page.getByRole('button', { name: elementTypeName, exact: true }));
|
|
1137
1043
|
}
|
|
1138
1044
|
async clickSelectBlockElementInAreaWithName(elementTypeName) {
|
|
1139
|
-
await
|
|
1140
|
-
await this.container.getByRole('button', { name: elementTypeName, exact: true }).click();
|
|
1045
|
+
await this.click(this.container.getByRole('button', { name: elementTypeName, exact: true }));
|
|
1141
1046
|
}
|
|
1142
1047
|
async clickBlockElementWithName(elementTypeName) {
|
|
1143
|
-
await
|
|
1144
|
-
await this.page.getByRole('link', { name: elementTypeName, exact: true }).click({ force: true });
|
|
1048
|
+
await this.click(this.page.getByRole('link', { name: elementTypeName, exact: true }), { force: true });
|
|
1145
1049
|
}
|
|
1146
1050
|
async enterPropertyValue(propertyName, value) {
|
|
1147
1051
|
const property = this.property.filter({ hasText: propertyName });
|
|
1148
|
-
await
|
|
1149
|
-
await property.locator('input').clear();
|
|
1150
|
-
await property.locator('input').fill(value);
|
|
1052
|
+
await this.enterText(property.locator('input'), value);
|
|
1151
1053
|
}
|
|
1152
1054
|
async doesBlockContainBlockInAreaWithName(blockWithAreaName, areaName, blockInAreaName, index = 0) {
|
|
1153
1055
|
const blockWithArea = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: blockWithAreaName })).nth(index);
|
|
1154
|
-
const area = blockWithArea.locator(this.blockGridAreasContainer).locator(
|
|
1056
|
+
const area = blockWithArea.locator(this.blockGridAreasContainer).locator(`[data-area-alias="${areaName}"]`);
|
|
1155
1057
|
const blockInArea = area.locator(this.blockGridEntry.filter({ hasText: blockInAreaName }));
|
|
1156
|
-
await
|
|
1058
|
+
await this.waitForVisible(blockInArea);
|
|
1157
1059
|
}
|
|
1158
1060
|
async doesBlockContainBlockCountInArea(blockWithAreaName, areaName, blocksInAreaCount, index = 0) {
|
|
1159
1061
|
const blockWithArea = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: blockWithAreaName })).nth(index);
|
|
1160
|
-
const area = blockWithArea.locator(this.blockGridAreasContainer).locator(
|
|
1062
|
+
const area = blockWithArea.locator(this.blockGridAreasContainer).locator(`[data-area-alias="${areaName}"]`);
|
|
1161
1063
|
const blocks = area.locator(this.blockGridEntry);
|
|
1162
|
-
await (
|
|
1064
|
+
await this.hasCount(blocks, blocksInAreaCount);
|
|
1163
1065
|
}
|
|
1164
1066
|
async doesBlockContainCountOfBlockInArea(blockWithAreaName, areaName, blockInAreaName, count, index = 0) {
|
|
1165
1067
|
const blockWithArea = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: blockWithAreaName })).nth(index);
|
|
1166
|
-
const area = blockWithArea.locator(this.blockGridAreasContainer).locator(
|
|
1068
|
+
const area = blockWithArea.locator(this.blockGridAreasContainer).locator(`[data-area-alias="${areaName}"]`);
|
|
1167
1069
|
const blockInArea = area.locator(this.blockGridEntry.filter({ hasText: blockInAreaName }));
|
|
1168
|
-
await (
|
|
1070
|
+
await this.hasCount(blockInArea, count);
|
|
1169
1071
|
}
|
|
1170
1072
|
async getBlockAtRootDataElementKey(blockName, index = 0) {
|
|
1171
1073
|
const blockGridEntrySelector = 'umb-block-grid-entry';
|
|
@@ -1177,149 +1079,132 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
1177
1079
|
}
|
|
1178
1080
|
async getBlockDataElementKeyInArea(parentBlockName, areaName, blockName, parentIndex = 0, childIndex = 0) {
|
|
1179
1081
|
const parentBlock = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: parentBlockName })).nth(parentIndex);
|
|
1180
|
-
const area = parentBlock.locator(this.blockGridAreasContainer).locator(
|
|
1082
|
+
const area = parentBlock.locator(this.blockGridAreasContainer).locator(`[data-area-alias="${areaName}"]`);
|
|
1181
1083
|
const block = area.locator(this.blockGridEntry.filter({ hasText: blockName })).nth(childIndex);
|
|
1182
1084
|
return block.getAttribute('data-element-key');
|
|
1183
1085
|
}
|
|
1184
1086
|
async removeBlockFromArea(parentBlockName, areaName, blockName, parentIndex = 0, childIndex = 0) {
|
|
1185
1087
|
const parentBlock = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: parentBlockName })).nth(parentIndex);
|
|
1186
|
-
const area = parentBlock.locator(this.blockGridAreasContainer).locator(
|
|
1088
|
+
const area = parentBlock.locator(this.blockGridAreasContainer).locator(`[data-area-alias="${areaName}"]`);
|
|
1187
1089
|
const block = area.locator(this.blockGridEntry.filter({ hasText: blockName })).nth(childIndex);
|
|
1188
|
-
await block.
|
|
1189
|
-
await block.getByLabel('delete').click({ force: true });
|
|
1090
|
+
await this.hoverAndClick(block, block.getByLabel('delete'), { force: true });
|
|
1190
1091
|
}
|
|
1191
1092
|
async doesBlockAreaContainColumnSpan(blockWithAreaName, areaName, columnSpan, index = 0) {
|
|
1192
1093
|
const blockWithArea = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: blockWithAreaName })).nth(index);
|
|
1193
|
-
const area = blockWithArea.locator(this.blockGridAreasContainer).locator(
|
|
1194
|
-
await (
|
|
1094
|
+
const area = blockWithArea.locator(this.blockGridAreasContainer).locator(`[data-area-alias="${areaName}"]`);
|
|
1095
|
+
await this.hasAttribute(area, 'data-area-col-span', columnSpan.toString());
|
|
1195
1096
|
}
|
|
1196
1097
|
async doesBlockAreaContainRowSpan(blockWithAreaName, areaName, rowSpan, index = 0) {
|
|
1197
1098
|
const blockWithArea = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: blockWithAreaName })).nth(index);
|
|
1198
|
-
const area = blockWithArea.locator(this.blockGridAreasContainer).locator(
|
|
1199
|
-
await (
|
|
1099
|
+
const area = blockWithArea.locator(this.blockGridAreasContainer).locator(`[data-area-alias="${areaName}"]`);
|
|
1100
|
+
await this.hasAttribute(area, 'data-area-row-span', rowSpan.toString());
|
|
1200
1101
|
}
|
|
1201
1102
|
async clickInlineAddToAreaButton(parentBlockName, areaName, parentIndex = 0, buttonIndex = 1) {
|
|
1202
1103
|
const parentBlock = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: parentBlockName })).nth(parentIndex);
|
|
1203
|
-
const area = parentBlock.locator(this.blockGridAreasContainer).locator(
|
|
1204
|
-
await area.locator(this.inlineCreateBtn).nth(buttonIndex)
|
|
1104
|
+
const area = parentBlock.locator(this.blockGridAreasContainer).locator(`[data-area-alias="${areaName}"]`);
|
|
1105
|
+
await this.click(area.locator(this.inlineCreateBtn).nth(buttonIndex));
|
|
1205
1106
|
}
|
|
1206
1107
|
async addBlockToAreasWithExistingBlock(blockWithAreaName, areaName, parentIndex = 0, addToIndex = 0) {
|
|
1207
1108
|
const blockWithArea = this.blockGridEntry.locator(this.blockGridBlock).filter({ hasText: blockWithAreaName }).nth(parentIndex);
|
|
1208
|
-
await
|
|
1209
|
-
|
|
1210
|
-
const area = blockWithArea.locator(this.blockGridAreasContainer).locator('[data-area-alias="' + areaName + '"]');
|
|
1109
|
+
await this.hover(blockWithArea);
|
|
1110
|
+
const area = blockWithArea.locator(this.blockGridAreasContainer).locator(`[data-area-alias="${areaName}"]`);
|
|
1211
1111
|
const addBlockBtn = area.locator(this.inlineCreateBtn).nth(addToIndex);
|
|
1212
|
-
await
|
|
1213
|
-
await
|
|
1112
|
+
await this.hover(addBlockBtn, { force: true });
|
|
1113
|
+
await this.click(addBlockBtn, { force: true });
|
|
1214
1114
|
}
|
|
1215
1115
|
async doesBlockGridBlockWithAreaContainCreateLabel(blockWithAreaName, createLabel, index = 0) {
|
|
1216
1116
|
const blockWithArea = this.blockGridEntry.locator(this.blockGridBlock.filter({ hasText: blockWithAreaName })).nth(index);
|
|
1217
|
-
return
|
|
1117
|
+
return await this.isVisible(blockWithArea.locator(this.blockGridAreasContainer).getByLabel(createLabel));
|
|
1218
1118
|
}
|
|
1219
1119
|
async doesPropertyContainValue(propertyName, value) {
|
|
1220
1120
|
await (0, test_1.expect)(this.property.filter({ hasText: propertyName }).locator('input')).toHaveValue(value);
|
|
1221
1121
|
}
|
|
1222
1122
|
async clickCreateButtonForModalWithElementTypeNameAndGroupName(headlineName, groupName) {
|
|
1223
|
-
await
|
|
1224
|
-
await this.blockWorkspace.filter({ hasText: 'Add ' + headlineName }).filter({ hasText: groupName }).getByLabel('Create').click();
|
|
1123
|
+
await this.click(this.blockWorkspace.filter({ hasText: `Add ${headlineName}` }).filter({ hasText: groupName }).getByLabel('Create'));
|
|
1225
1124
|
}
|
|
1226
1125
|
async clickUpdateButtonForModalWithElementTypeNameAndGroupName(headlineName, groupName) {
|
|
1227
|
-
await
|
|
1228
|
-
await this.blockWorkspace.filter({ hasText: 'Edit ' + headlineName }).filter({ hasText: groupName }).locator(this.updateBtn).click();
|
|
1126
|
+
await this.click(this.blockWorkspace.filter({ hasText: `Edit ${headlineName}` }).filter({ hasText: groupName }).locator(this.updateBtn));
|
|
1229
1127
|
}
|
|
1230
1128
|
async clickExactCopyButton() {
|
|
1231
|
-
await
|
|
1232
|
-
await this.exactCopyBtn.click();
|
|
1129
|
+
await this.click(this.exactCopyBtn);
|
|
1233
1130
|
}
|
|
1234
1131
|
async clickExactReplaceButton() {
|
|
1235
|
-
await
|
|
1236
|
-
await this.replaceExactBtn.click();
|
|
1132
|
+
await this.click(this.replaceExactBtn);
|
|
1237
1133
|
}
|
|
1238
1134
|
async doesClipboardHaveCopiedBlockWithName(contentName, propertyName, blockName, index = 0) {
|
|
1239
|
-
await
|
|
1135
|
+
await this.isVisible(this.clipboardEntryPicker.getByLabel(`${contentName} - ${propertyName} - ${blockName}`).nth(index));
|
|
1240
1136
|
}
|
|
1241
1137
|
async doesClipboardHaveCopiedBlocks(contentName, propertyName, index = 0) {
|
|
1242
|
-
await
|
|
1138
|
+
await this.isVisible(this.clipboardEntryPicker.getByLabel(`${contentName} - ${propertyName}`).nth(index));
|
|
1243
1139
|
}
|
|
1244
1140
|
async doesClipboardContainCopiedBlocksCount(count) {
|
|
1245
|
-
await
|
|
1141
|
+
await this.hasCount(this.clipboardEntryPicker.locator(this.menuItem), count);
|
|
1246
1142
|
}
|
|
1247
1143
|
async selectClipboardEntryWithName(contentName, propertyName, blockName, index = 0) {
|
|
1248
1144
|
await this.doesClipboardHaveCopiedBlockWithName(contentName, propertyName, blockName, index);
|
|
1249
|
-
await this.clipboardEntryPicker.getByLabel(`${contentName} - ${propertyName} - ${blockName}`).nth(index)
|
|
1145
|
+
await this.click(this.clipboardEntryPicker.getByLabel(`${contentName} - ${propertyName} - ${blockName}`).nth(index));
|
|
1250
1146
|
}
|
|
1251
1147
|
async selectClipboardEntriesWithName(contentName, propertyName, index = 0) {
|
|
1252
1148
|
await this.doesClipboardHaveCopiedBlocks(contentName, propertyName, index);
|
|
1253
|
-
await this.clipboardEntryPicker.getByLabel(`${contentName} - ${propertyName}`).nth(index)
|
|
1149
|
+
await this.click(this.clipboardEntryPicker.getByLabel(`${contentName} - ${propertyName}`).nth(index));
|
|
1254
1150
|
}
|
|
1255
1151
|
async goToBlockGridBlockWithName(groupName, propertyName, blockName, index = 0) {
|
|
1256
1152
|
const blockGridBlock = this.workspaceEditTab.filter({ hasText: groupName }).locator(this.workspaceEditProperties).filter({ hasText: propertyName }).locator(this.blockGridEntry).nth(index).filter({ hasText: blockName });
|
|
1257
|
-
await
|
|
1258
|
-
await blockGridBlock.click();
|
|
1153
|
+
await this.click(blockGridBlock);
|
|
1259
1154
|
}
|
|
1260
1155
|
async goToBlockListBlockWithName(groupName, propertyName, blockName, index = 0) {
|
|
1261
1156
|
const blocklistBlock = this.workspaceEditTab.filter({ hasText: groupName }).locator(this.workspaceEditProperties).filter({ hasText: propertyName }).locator(this.blockListEntry).nth(index).filter({ hasText: blockName });
|
|
1262
|
-
await
|
|
1263
|
-
await blocklistBlock.click();
|
|
1157
|
+
await this.click(blocklistBlock);
|
|
1264
1158
|
}
|
|
1265
1159
|
async doesBlockEditorBlockWithNameContainValue(groupName, propertyName, inputType = ConstantHelper_1.ConstantHelper.inputTypes.general, value) {
|
|
1266
1160
|
await (0, test_1.expect)(this.blockWorkspaceEditTab.filter({ hasText: groupName }).locator(this.property).filter({ hasText: propertyName }).locator(inputType)).toContainText(value);
|
|
1267
1161
|
}
|
|
1268
1162
|
async clickCloseButton() {
|
|
1269
|
-
await
|
|
1270
|
-
await this.closeBtn.click();
|
|
1163
|
+
await this.click(this.closeBtn);
|
|
1271
1164
|
}
|
|
1272
1165
|
async clickPasteButton() {
|
|
1273
|
-
await
|
|
1274
|
-
await this.pasteBtn.click({ force: true });
|
|
1166
|
+
await this.click(this.pasteBtn, { force: true });
|
|
1275
1167
|
}
|
|
1276
1168
|
async doesBlockListPropertyHaveBlockAmount(groupName, propertyName, amount) {
|
|
1277
|
-
await
|
|
1169
|
+
await this.hasCount(this.workspaceEditTab.filter({ hasText: groupName }).locator(this.workspaceEditProperties).filter({ hasText: propertyName }).locator(this.blockListEntry), amount);
|
|
1278
1170
|
}
|
|
1279
1171
|
async doesBlockGridPropertyHaveBlockAmount(groupName, propertyName, amount) {
|
|
1280
|
-
await
|
|
1172
|
+
await this.hasCount(this.workspaceEditTab.filter({ hasText: groupName }).locator(this.workspaceEditProperties).filter({ hasText: propertyName }).locator(this.blockGridEntry), amount);
|
|
1281
1173
|
}
|
|
1282
1174
|
async doesPropertyContainValidationMessage(groupName, propertyName, message) {
|
|
1283
1175
|
await (0, test_1.expect)(this.blockWorkspaceEditTab.filter({ hasText: groupName }).locator(this.property).filter({ hasText: propertyName }).locator(this.validationMessage)).toContainText(message);
|
|
1284
1176
|
}
|
|
1285
1177
|
async clickInsertBlockButton() {
|
|
1286
|
-
await
|
|
1287
|
-
await this.insertBlockBtn.click();
|
|
1178
|
+
await this.click(this.insertBlockBtn);
|
|
1288
1179
|
}
|
|
1289
1180
|
// TipTap
|
|
1290
1181
|
async enterRTETipTapEditor(value) {
|
|
1291
|
-
await
|
|
1292
|
-
await this.tipTapEditor.clear();
|
|
1293
|
-
await this.tipTapEditor.fill(value);
|
|
1182
|
+
await this.enterText(this.tipTapEditor, value);
|
|
1294
1183
|
}
|
|
1295
1184
|
async enterRTETipTapEditorWithName(name, value) {
|
|
1296
|
-
const tipTapEditorLocator = this.page.locator(
|
|
1297
|
-
await (
|
|
1298
|
-
await tipTapEditorLocator.clear();
|
|
1299
|
-
await tipTapEditorLocator.fill(value);
|
|
1185
|
+
const tipTapEditorLocator = this.page.locator(`[data-mark="property:${name}"]`).locator(this.tipTapEditor);
|
|
1186
|
+
await this.enterText(tipTapEditorLocator, value);
|
|
1300
1187
|
}
|
|
1301
1188
|
async clickTipTapToolbarIconWithTitle(iconTitle) {
|
|
1302
|
-
await
|
|
1303
|
-
await this.tipTapPropertyEditor.getByTitle(iconTitle, { exact: true }).locator('svg').click();
|
|
1189
|
+
await this.click(this.tipTapPropertyEditor.getByTitle(iconTitle, { exact: true }).locator('svg'));
|
|
1304
1190
|
}
|
|
1305
1191
|
async doesUploadedSvgThumbnailHaveSrc(imageSrc) {
|
|
1306
|
-
await
|
|
1307
|
-
await (0, test_1.expect)(this.uploadedSvgThumbnail).toHaveAttribute('src', imageSrc);
|
|
1192
|
+
await this.hasAttribute(this.uploadedSvgThumbnail, 'src', imageSrc);
|
|
1308
1193
|
}
|
|
1309
1194
|
async doesRichTextEditorBlockContainLabel(richTextEditorAlias, label) {
|
|
1310
|
-
await (0, test_1.expect)(this.page.getByTestId(
|
|
1195
|
+
await (0, test_1.expect)(this.page.getByTestId(`property:${richTextEditorAlias}`).locator(this.rteBlock)).toContainText(label);
|
|
1311
1196
|
}
|
|
1312
1197
|
async doesBlockEditorModalContainEditorSize(editorSize, elementName) {
|
|
1313
|
-
await
|
|
1198
|
+
await this.isVisible(this.backofficeModalContainer.locator(`[size="${editorSize}"]`).locator(`[headline="Add ${elementName}"]`));
|
|
1314
1199
|
}
|
|
1315
1200
|
async doesBlockEditorModalContainInline(richTextEditorAlias, elementName) {
|
|
1316
|
-
await
|
|
1201
|
+
await this.containsText(this.page.getByTestId(`property:${richTextEditorAlias}`).locator(this.tiptapInput).locator(this.rteBlockInline), elementName);
|
|
1317
1202
|
}
|
|
1318
1203
|
async doesBlockHaveBackgroundColor(elementName, backgroundColor) {
|
|
1319
|
-
await
|
|
1204
|
+
await this.isVisible(this.page.locator('umb-block-type-card', { hasText: elementName }).locator(`[style="background-color:${backgroundColor};"]`));
|
|
1320
1205
|
}
|
|
1321
1206
|
async doesBlockHaveIconColor(elementName, backgroundColor) {
|
|
1322
|
-
await
|
|
1207
|
+
await this.isVisible(this.page.locator('umb-block-type-card', { hasText: elementName }).locator(`svg[fill="${backgroundColor}"]`));
|
|
1323
1208
|
}
|
|
1324
1209
|
async addDocumentDomain(domainName, languageName) {
|
|
1325
1210
|
await this.clickCultureAndHostnamesButton();
|
|
@@ -1330,161 +1215,142 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
1330
1215
|
}
|
|
1331
1216
|
// Scheduled Publishing
|
|
1332
1217
|
async clickViewMoreOptionsButton() {
|
|
1333
|
-
await
|
|
1334
|
-
await this.viewMoreOptionsBtn.click();
|
|
1218
|
+
await this.click(this.viewMoreOptionsBtn);
|
|
1335
1219
|
}
|
|
1336
1220
|
async clickSchedulePublishButton() {
|
|
1337
|
-
await
|
|
1338
|
-
await this.schedulePublishBtn.click();
|
|
1221
|
+
await this.click(this.schedulePublishBtn);
|
|
1339
1222
|
}
|
|
1340
1223
|
async clickSchedulePublishModalButton() {
|
|
1341
|
-
await
|
|
1342
|
-
await this.schedulePublishModalBtn.click();
|
|
1224
|
+
await this.click(this.schedulePublishModalBtn);
|
|
1343
1225
|
}
|
|
1344
1226
|
async enterPublishTime(time, index = 0) {
|
|
1345
1227
|
const publishAtTxt = this.documentScheduleModal.locator('.publish-date').nth(index).locator('uui-form-layout-item').first().locator('#input');
|
|
1346
|
-
await (
|
|
1347
|
-
await publishAtTxt.fill(time);
|
|
1228
|
+
await this.enterText(publishAtTxt, time);
|
|
1348
1229
|
}
|
|
1349
1230
|
async enterUnpublishTime(time, index = 0) {
|
|
1350
1231
|
const unpublishAtTxt = this.documentScheduleModal.locator('.publish-date').nth(index).locator('uui-form-layout-item').last().locator('#input');
|
|
1351
|
-
await (
|
|
1352
|
-
await unpublishAtTxt.fill(time);
|
|
1232
|
+
await this.enterText(unpublishAtTxt, time);
|
|
1353
1233
|
}
|
|
1354
1234
|
async doesPublishAtValidationMessageContainText(text) {
|
|
1355
|
-
await
|
|
1235
|
+
await this.containsText(this.publishAtValidationMessage, text);
|
|
1356
1236
|
}
|
|
1357
1237
|
async doesUnpublishAtValidationMessageContainText(text) {
|
|
1358
|
-
await
|
|
1238
|
+
await this.containsText(this.unpublishAtValidationMessage, text);
|
|
1359
1239
|
}
|
|
1360
1240
|
async doesLastPublishedContainText(text) {
|
|
1361
|
-
await
|
|
1241
|
+
await this.containsText(this.lastPublished, text);
|
|
1362
1242
|
}
|
|
1363
1243
|
async doesPublishAtContainText(text) {
|
|
1364
|
-
await
|
|
1244
|
+
await this.containsText(this.publishAt, text);
|
|
1365
1245
|
}
|
|
1366
1246
|
async doesRemoveAtContainText(text) {
|
|
1367
|
-
await
|
|
1247
|
+
await this.containsText(this.removeAt, text);
|
|
1368
1248
|
}
|
|
1369
1249
|
async clickSelectAllCheckbox() {
|
|
1370
|
-
await
|
|
1371
|
-
await this.selectAllCheckbox.click();
|
|
1250
|
+
await this.click(this.selectAllCheckbox);
|
|
1372
1251
|
}
|
|
1373
1252
|
async doesSchedulePublishModalButtonContainDisabledTag(hasDisabledTag = false) {
|
|
1374
1253
|
if (!hasDisabledTag) {
|
|
1375
|
-
|
|
1254
|
+
await (0, test_1.expect)(this.schedulePublishModalBtn).not.toHaveAttribute('disabled', '');
|
|
1255
|
+
}
|
|
1256
|
+
else {
|
|
1257
|
+
await this.hasAttribute(this.schedulePublishModalBtn, 'disabled', '');
|
|
1376
1258
|
}
|
|
1377
|
-
return await (0, test_1.expect)(this.schedulePublishModalBtn).toHaveAttribute('disabled', '');
|
|
1378
1259
|
}
|
|
1379
1260
|
async clickInlineBlockCaretButtonForName(blockEditorName, index = 0) {
|
|
1380
1261
|
const caretButtonLocator = this.blockListEntry.filter({ hasText: blockEditorName }).nth(index).locator('uui-symbol-expand svg');
|
|
1381
|
-
await
|
|
1382
|
-
await caretButtonLocator.click();
|
|
1262
|
+
await this.click(caretButtonLocator);
|
|
1383
1263
|
}
|
|
1384
1264
|
async doesTiptapHaveWordCount(count) {
|
|
1385
|
-
await
|
|
1265
|
+
await this.hasText(this.tiptapStatusbarWordCount, `${count} words`);
|
|
1386
1266
|
}
|
|
1387
1267
|
async doesTiptapHaveCharacterCount(count) {
|
|
1388
|
-
await
|
|
1268
|
+
await this.hasText(this.tiptapStatusbarWordCount, `${count} characters`);
|
|
1389
1269
|
}
|
|
1390
1270
|
async clickTiptapWordCountButton() {
|
|
1391
|
-
await
|
|
1392
|
-
await this.tiptapStatusbarWordCount.click();
|
|
1271
|
+
await this.click(this.tiptapStatusbarWordCount);
|
|
1393
1272
|
}
|
|
1394
1273
|
async doesElementPathHaveText(text) {
|
|
1395
|
-
await
|
|
1274
|
+
await this.hasText(this.tiptapStatusbarElementPath, text);
|
|
1396
1275
|
}
|
|
1397
1276
|
async clickConfirmToPublishButton() {
|
|
1398
|
-
await this.
|
|
1277
|
+
await this.click(this.confirmToPublishBtn);
|
|
1399
1278
|
}
|
|
1400
1279
|
async clickPublishWithDescendantsButton() {
|
|
1401
|
-
await
|
|
1402
|
-
await this.publishWithDescendantsBtn.click();
|
|
1280
|
+
await this.click(this.publishWithDescendantsBtn);
|
|
1403
1281
|
}
|
|
1404
1282
|
async clickIncludeUnpublishedDescendantsToggle() {
|
|
1405
|
-
await
|
|
1406
|
-
await this.includeUnpublishedDescendantsToggle.click();
|
|
1283
|
+
await this.click(this.includeUnpublishedDescendantsToggle);
|
|
1407
1284
|
}
|
|
1408
1285
|
async clickPublishWithDescendantsModalButton() {
|
|
1409
|
-
await
|
|
1410
|
-
await this.publishWithDescendantsModalBtn.click();
|
|
1286
|
+
await this.click(this.publishWithDescendantsModalBtn);
|
|
1411
1287
|
}
|
|
1412
1288
|
async doesDocumentVariantLanguageItemHaveCount(count) {
|
|
1413
|
-
await
|
|
1289
|
+
await this.hasCount(this.documentVariantLanguageItem, count);
|
|
1414
1290
|
}
|
|
1415
1291
|
async doesDocumentVariantLanguageItemHaveName(name) {
|
|
1416
|
-
await
|
|
1292
|
+
await this.containsText(this.documentVariantLanguagePicker, name);
|
|
1417
1293
|
}
|
|
1418
1294
|
async clickSchedulePublishLanguageButton(languageName) {
|
|
1419
|
-
await
|
|
1420
|
-
await this.page.getByRole('menu').filter({ hasText: languageName }).click();
|
|
1295
|
+
await this.click(this.page.getByRole('menu').filter({ hasText: languageName }));
|
|
1421
1296
|
}
|
|
1422
1297
|
async clickBlockCardWithName(name, toForce = false) {
|
|
1423
1298
|
const blockWithNameLocator = this.page.locator('uui-card-block-type', { hasText: name });
|
|
1424
|
-
await (
|
|
1425
|
-
await blockWithNameLocator.click({ force: toForce });
|
|
1299
|
+
await this.click(blockWithNameLocator, { force: toForce });
|
|
1426
1300
|
}
|
|
1427
1301
|
async clickStyleSelectButton() {
|
|
1428
|
-
await
|
|
1429
|
-
await this.styleSelectBtn.click();
|
|
1302
|
+
await this.click(this.styleSelectBtn);
|
|
1430
1303
|
}
|
|
1431
1304
|
async clickCascadingMenuItemWithName(name) {
|
|
1432
|
-
const menuItemLocator = this.cascadingMenuContainer.locator(
|
|
1433
|
-
await
|
|
1434
|
-
await menuItemLocator.click();
|
|
1305
|
+
const menuItemLocator = this.cascadingMenuContainer.locator(`uui-menu-item[label="${name}"]`);
|
|
1306
|
+
await this.click(menuItemLocator);
|
|
1435
1307
|
}
|
|
1436
1308
|
async hoverCascadingMenuItemWithName(name) {
|
|
1437
|
-
const menuItemLocator = this.cascadingMenuContainer.locator(
|
|
1438
|
-
await
|
|
1439
|
-
await menuItemLocator.hover();
|
|
1309
|
+
const menuItemLocator = this.cascadingMenuContainer.locator(`uui-menu-item[label="${name}"]`);
|
|
1310
|
+
await this.hover(menuItemLocator);
|
|
1440
1311
|
}
|
|
1441
1312
|
async selectAllRTETipTapEditorText() {
|
|
1442
|
-
await
|
|
1443
|
-
await this.tipTapEditor
|
|
1444
|
-
await this.page.keyboard.press('Control+A');
|
|
1313
|
+
await this.click(this.tipTapEditor);
|
|
1314
|
+
await this.pressKey(this.tipTapEditor, 'Control+A');
|
|
1445
1315
|
}
|
|
1446
1316
|
async waitForContentToBePublished() {
|
|
1447
|
-
await this.
|
|
1317
|
+
await this.waitForLoadState();
|
|
1448
1318
|
}
|
|
1449
1319
|
async waitForRecycleBinToBeEmptied() {
|
|
1450
|
-
await this.
|
|
1320
|
+
await this.waitForLoadState();
|
|
1451
1321
|
}
|
|
1452
1322
|
async clearTipTapEditor() {
|
|
1453
|
-
await
|
|
1323
|
+
await this.waitForVisible(this.tipTapEditor);
|
|
1454
1324
|
// We use the middle mouse button click so we don't accidentally open a block in the RTE. This solution avoids that.
|
|
1455
1325
|
await this.tipTapEditor.click({ button: "middle" });
|
|
1456
|
-
await this.
|
|
1457
|
-
await this.
|
|
1326
|
+
await this.pressKey(this.tipTapEditor, 'Control+A');
|
|
1327
|
+
await this.pressKey(this.tipTapEditor, 'Backspace');
|
|
1458
1328
|
}
|
|
1459
1329
|
async clickBlockElementInRTEWithName(elementTypeName) {
|
|
1460
1330
|
const blockElementLocator = this.page.locator('uui-ref-node umb-ufm-render').filter({ hasText: elementTypeName });
|
|
1461
|
-
await (
|
|
1462
|
-
await blockElementLocator.click({ force: true });
|
|
1331
|
+
await this.click(blockElementLocator, { force: true });
|
|
1463
1332
|
}
|
|
1464
1333
|
async doesModalFormValidationMessageContainText(text) {
|
|
1465
|
-
await
|
|
1334
|
+
await this.containsText(this.modalFormValidationMessage, text);
|
|
1466
1335
|
}
|
|
1467
1336
|
async enterSearchKeywordInTreePickerModal(keyword) {
|
|
1468
|
-
await
|
|
1469
|
-
await this.treePickerSearchTxt
|
|
1470
|
-
await this.page.keyboard.press('Enter');
|
|
1337
|
+
await this.enterText(this.treePickerSearchTxt, keyword);
|
|
1338
|
+
await this.pressKey(this.treePickerSearchTxt, 'Enter');
|
|
1471
1339
|
}
|
|
1472
1340
|
async enterSearchKeywordInMediaPickerModal(keyword) {
|
|
1473
|
-
await
|
|
1474
|
-
await this.mediaPickerSearchTxt
|
|
1475
|
-
await this.page.keyboard.press('Enter');
|
|
1341
|
+
await this.enterText(this.mediaPickerSearchTxt, keyword);
|
|
1342
|
+
await this.pressKey(this.mediaPickerSearchTxt, 'Enter');
|
|
1476
1343
|
}
|
|
1477
1344
|
async enterSearchKeywordInMemberPickerModal(keyword) {
|
|
1478
|
-
await
|
|
1479
|
-
await this.memberPickerSearchTxt
|
|
1480
|
-
await this.page.keyboard.press('Enter');
|
|
1345
|
+
await this.enterText(this.memberPickerSearchTxt, keyword);
|
|
1346
|
+
await this.pressKey(this.memberPickerSearchTxt, 'Enter');
|
|
1481
1347
|
}
|
|
1482
1348
|
async isContentNameReadOnly() {
|
|
1483
1349
|
await (0, test_1.expect)(this.contentNameTxt).toHaveAttribute('readonly');
|
|
1484
1350
|
}
|
|
1485
1351
|
// Block Custom View
|
|
1486
1352
|
async isBlockCustomViewVisible(blockCustomViewLocator, isVisible = true) {
|
|
1487
|
-
await
|
|
1353
|
+
await this.isVisible(this.page.locator(blockCustomViewLocator), isVisible);
|
|
1488
1354
|
}
|
|
1489
1355
|
async isSingleBlockElementVisible(isVisible = true) {
|
|
1490
1356
|
const count = await this.refListBlock.count();
|
|
@@ -1494,112 +1360,84 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
1494
1360
|
else {
|
|
1495
1361
|
(0, test_1.expect)(count, `Expected only one element, but found ${count}`).toBe(0);
|
|
1496
1362
|
}
|
|
1497
|
-
await
|
|
1363
|
+
await this.isVisible(this.refListBlock, isVisible);
|
|
1498
1364
|
}
|
|
1499
1365
|
async doesBlockCustomViewHaveValue(customBlockViewLocator, valueText) {
|
|
1500
1366
|
const locator = this.page.locator(`${customBlockViewLocator} p`);
|
|
1501
|
-
await
|
|
1502
|
-
await (
|
|
1367
|
+
await this.waitForVisible(locator);
|
|
1368
|
+
await this.hasText(locator, valueText);
|
|
1503
1369
|
}
|
|
1504
1370
|
async clickPropertyActionWithName(name) {
|
|
1505
|
-
const actionLocator = this.propertyActionMenu.locator(
|
|
1506
|
-
await
|
|
1507
|
-
await actionLocator.click();
|
|
1371
|
+
const actionLocator = this.propertyActionMenu.locator(`umb-property-action uui-menu-item[label="${name}"]`);
|
|
1372
|
+
await this.click(actionLocator);
|
|
1508
1373
|
}
|
|
1509
1374
|
async isContentWithNameVisibleInList(contentName, isVisible = true) {
|
|
1510
|
-
await
|
|
1375
|
+
await this.isVisible(this.documentTableColumnName.filter({ hasText: contentName }), isVisible);
|
|
1511
1376
|
}
|
|
1512
1377
|
async selectDocumentBlueprintWithName(blueprintName) {
|
|
1513
|
-
await
|
|
1514
|
-
await this.documentCreateOptionsModal.locator('uui-menu-item', { hasText: blueprintName }).click();
|
|
1378
|
+
await this.click(this.documentCreateOptionsModal.locator('uui-menu-item', { hasText: blueprintName }));
|
|
1515
1379
|
}
|
|
1516
1380
|
async doesDocumentModalHaveText(text) {
|
|
1517
|
-
await
|
|
1381
|
+
await this.containsText(this.documentCreateOptionsModal, text);
|
|
1518
1382
|
}
|
|
1519
1383
|
async doesListViewItemsHaveCount(pageSize) {
|
|
1520
|
-
await
|
|
1384
|
+
await this.hasCount(this.listViewCustomRows, pageSize);
|
|
1521
1385
|
}
|
|
1522
1386
|
async isListViewItemWithNameVisible(itemName, index = 0) {
|
|
1523
1387
|
await (0, test_1.expect)(this.listViewCustomRows.nth(index)).toContainText(itemName);
|
|
1524
1388
|
}
|
|
1525
1389
|
async clickPaginationNextButton() {
|
|
1526
|
-
await
|
|
1527
|
-
await this.nextPaginationBtn.click();
|
|
1390
|
+
await this.click(this.nextPaginationBtn);
|
|
1528
1391
|
}
|
|
1529
1392
|
// Entity Data Picker
|
|
1530
1393
|
async chooseCollectionMenuItemWithName(name) {
|
|
1531
1394
|
await this.clickChooseButton();
|
|
1532
|
-
await this.collectionMenu.locator('umb-collection-menu-item', { hasText: name })
|
|
1395
|
+
await this.click(this.collectionMenu.locator('umb-collection-menu-item', { hasText: name }));
|
|
1533
1396
|
await this.clickChooseContainerButton();
|
|
1534
1397
|
}
|
|
1535
1398
|
async chooseTreeMenuItemWithName(name, parentNames = []) {
|
|
1536
1399
|
await this.clickChooseButton();
|
|
1537
1400
|
for (const itemName of parentNames) {
|
|
1538
|
-
await this.entityPickerTree.locator('umb-tree-item').getByLabel(
|
|
1401
|
+
await this.click(this.entityPickerTree.locator('umb-tree-item').getByLabel(`Expand child items for ${itemName}`));
|
|
1539
1402
|
}
|
|
1540
|
-
await this.container.getByLabel(name)
|
|
1403
|
+
await this.click(this.container.getByLabel(name));
|
|
1541
1404
|
await this.clickChooseContainerButton();
|
|
1542
1405
|
}
|
|
1543
1406
|
async isChooseButtonVisible(isVisible = true) {
|
|
1544
|
-
await
|
|
1407
|
+
await this.isVisible(this.chooseBtn, isVisible);
|
|
1545
1408
|
}
|
|
1546
1409
|
async clickDocumentNotificationOptionWithName(name) {
|
|
1547
|
-
const notificationOptionLocator = this.page.locator(
|
|
1548
|
-
await
|
|
1549
|
-
await notificationOptionLocator.click();
|
|
1410
|
+
const notificationOptionLocator = this.page.locator(`umb-document-notifications-modal [id$="${name}"]`).locator('#toggle');
|
|
1411
|
+
await this.click(notificationOptionLocator);
|
|
1550
1412
|
}
|
|
1551
1413
|
async switchLanguage(languageName) {
|
|
1552
|
-
await
|
|
1553
|
-
await this.languageToggle.click();
|
|
1414
|
+
await this.click(this.languageToggle);
|
|
1554
1415
|
const languageOptionLocator = this.contentVariantDropdown.locator('.culture-variant').filter({ hasText: languageName });
|
|
1555
|
-
await
|
|
1556
|
-
await languageOptionLocator.click();
|
|
1416
|
+
await this.click(languageOptionLocator);
|
|
1557
1417
|
await (0, test_1.expect)(languageOptionLocator).toContainClass('selected');
|
|
1558
1418
|
}
|
|
1559
1419
|
async clickAddBlockListElementWithName(blockName) {
|
|
1560
|
-
const createNewButtonLocator = this.page.getByTestId(
|
|
1561
|
-
await
|
|
1562
|
-
await createNewButtonLocator.click();
|
|
1420
|
+
const createNewButtonLocator = this.page.getByTestId(`property:${blockName.toLowerCase()}`).getByLabel('Create new');
|
|
1421
|
+
await this.click(createNewButtonLocator);
|
|
1563
1422
|
}
|
|
1564
1423
|
async isAddBlockListElementWithNameDisabled(blockName) {
|
|
1565
|
-
const createNewButtonLocator = this.page.getByTestId(
|
|
1424
|
+
const createNewButtonLocator = this.page.getByTestId(`property:${blockName.toLowerCase()}`).locator('uui-button[label="Create new"]');
|
|
1566
1425
|
await (0, test_1.expect)(createNewButtonLocator).toHaveAttribute('disabled');
|
|
1567
1426
|
}
|
|
1568
1427
|
async isAddBlockListElementWithNameVisible(blockName) {
|
|
1569
|
-
const createNewButtonLocator = this.page.getByTestId(
|
|
1570
|
-
await
|
|
1428
|
+
const createNewButtonLocator = this.page.getByTestId(`property:${blockName.toLowerCase()}`).locator('uui-button[label="Create new"]');
|
|
1429
|
+
await this.waitForVisible(createNewButtonLocator);
|
|
1571
1430
|
await (0, test_1.expect)(createNewButtonLocator).not.toHaveAttribute('disabled');
|
|
1572
1431
|
}
|
|
1573
1432
|
async enterBlockPropertyValue(propertyName, value) {
|
|
1574
1433
|
const property = this.blockProperty.filter({ hasText: propertyName });
|
|
1575
|
-
await
|
|
1576
|
-
await property.locator('input').clear();
|
|
1577
|
-
await property.locator('input').fill(value);
|
|
1434
|
+
await this.enterText(property.locator('input'), value);
|
|
1578
1435
|
}
|
|
1579
1436
|
async isBlockPropertyEditable(propertyName, isEditable = true) {
|
|
1580
1437
|
const propertyLocator = this.blockProperty.filter({ hasText: propertyName }).locator('#input');
|
|
1581
|
-
await
|
|
1438
|
+
await this.waitForVisible(propertyLocator);
|
|
1582
1439
|
await (0, test_1.expect)(propertyLocator).toBeEditable({ editable: isEditable });
|
|
1583
1440
|
}
|
|
1584
|
-
async isInlineBlockPropertyVisible(propertyName, isVisible = true) {
|
|
1585
|
-
const propertyLocator = this.blockListEntry.locator(this.blockProperty).filter({ hasText: propertyName });
|
|
1586
|
-
await (0, test_1.expect)(propertyLocator).toBeVisible({ visible: isVisible });
|
|
1587
|
-
}
|
|
1588
|
-
async isInlineBlockPropertyVisibleForBlockWithName(blockName, propertyName, isVisible = true, index = 0) {
|
|
1589
|
-
const blockEntryLocator = this.blockListEntry.filter({ hasText: blockName }).nth(index);
|
|
1590
|
-
const propertyLocator = blockEntryLocator.locator(this.blockProperty).filter({ hasText: propertyName });
|
|
1591
|
-
await (0, test_1.expect)(propertyLocator).toBeVisible({ visible: isVisible });
|
|
1592
|
-
}
|
|
1593
|
-
async enterInlineBlockPropertyValue(propertyName, value, index = 0) {
|
|
1594
|
-
const propertyLocator = this.blockListEntry.nth(index).locator(this.blockProperty).filter({ hasText: propertyName });
|
|
1595
|
-
await (0, test_1.expect)(propertyLocator).toBeVisible();
|
|
1596
|
-
await propertyLocator.locator('input').clear();
|
|
1597
|
-
await propertyLocator.locator('input').fill(value);
|
|
1598
|
-
}
|
|
1599
|
-
async doesInlineBlockPropertyHaveValue(propertyName, value, index = 0) {
|
|
1600
|
-
const propertyLocator = this.blockListEntry.nth(index).locator(this.blockProperty).filter({ hasText: propertyName }).locator('input');
|
|
1601
|
-
await (0, test_1.expect)(propertyLocator).toHaveValue(value);
|
|
1602
|
-
}
|
|
1603
1441
|
}
|
|
1604
1442
|
exports.ContentUiHelper = ContentUiHelper;
|
|
1605
1443
|
//# sourceMappingURL=ContentUiHelper.js.map
|