@umbraco/playwright-testhelpers 16.0.29 → 16.0.30

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.
@@ -14,9 +14,11 @@ class ProfilingUiHelper extends UiBaseLocators_1.UiBaseLocators {
14
14
  this.activateProfilerByDefaultCheckbox = page.getByLabel('Activate the profiler by default');
15
15
  }
16
16
  async clickProfilingTab() {
17
+ await (0, test_1.expect)(this.profilingTab).toBeVisible();
17
18
  await this.profilingTab.click();
18
19
  }
19
20
  async clickActivateProfilerByDefaultToggle() {
21
+ await (0, test_1.expect)(this.activateProfilerByDefaultToggle).toBeVisible();
20
22
  await this.activateProfilerByDefaultToggle.click();
21
23
  }
22
24
  async isActivateProfilerByDefaultToggleChecked(isChecked) {
@@ -1 +1 @@
1
- {"version":3,"file":"ProfilingUiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/ProfilingUiHelper.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AACvD,qDAAgD;AAEhD,MAAa,iBAAkB,SAAQ,+BAAc;IAClC,YAAY,CAAU;IACtB,+BAA+B,CAAU;IACzC,iCAAiC,CAAU;IAE5D,YAAY,IAAU;QACpB,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAC,IAAI,EAAE,WAAW,EAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,+BAA+B,GAAG,IAAI,CAAC,OAAO,CAAC,oDAAoD,CAAC,CAAC;QAC1G,IAAI,CAAC,iCAAiC,GAAG,IAAI,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC;IAC/F,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,oCAAoC;QACxC,MAAM,IAAI,CAAC,+BAA+B,CAAC,KAAK,EAAE,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,wCAAwC,CAAC,SAAkB;QAC/D,OAAO,IAAA,aAAM,EAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC,WAAW,CAAC,EAAC,OAAO,EAAE,SAAS,EAAC,CAAC,CAAC;IAC1F,CAAC;CACF;AAvBD,8CAuBC","sourcesContent":["import {Page, Locator, expect} from \"@playwright/test\";\nimport {UiBaseLocators} from \"./UiBaseLocators\";\n\nexport class ProfilingUiHelper extends UiBaseLocators {\n private readonly profilingTab: Locator;\n private readonly activateProfilerByDefaultToggle: Locator;\n private readonly activateProfilerByDefaultCheckbox: Locator;\n\n constructor(page: Page) {\n super(page);\n this.profilingTab = page.getByRole('tab', {name: 'Profiling'});\n this.activateProfilerByDefaultToggle = page.locator(\"[label='Activate the profiler by default'] #toggle\");\n this.activateProfilerByDefaultCheckbox = page.getByLabel('Activate the profiler by default');\n }\n\n async clickProfilingTab() {\n await this.profilingTab.click();\n }\n\n async clickActivateProfilerByDefaultToggle() {\n await this.activateProfilerByDefaultToggle.click();\n }\n\n async isActivateProfilerByDefaultToggleChecked(isChecked: boolean) {\n return expect(this.activateProfilerByDefaultCheckbox).toBeChecked({checked: isChecked});\n }\n}\n"]}
1
+ {"version":3,"file":"ProfilingUiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/ProfilingUiHelper.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AACvD,qDAAgD;AAEhD,MAAa,iBAAkB,SAAQ,+BAAc;IAClC,YAAY,CAAU;IACtB,+BAA+B,CAAU;IACzC,iCAAiC,CAAU;IAE5D,YAAY,IAAU;QACpB,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAC,IAAI,EAAE,WAAW,EAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,+BAA+B,GAAG,IAAI,CAAC,OAAO,CAAC,oDAAoD,CAAC,CAAC;QAC1G,IAAI,CAAC,iCAAiC,GAAG,IAAI,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC;IAC/F,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,MAAM,IAAA,aAAM,EAAC,IAAI,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9C,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,oCAAoC;QACxC,MAAM,IAAA,aAAM,EAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC,WAAW,EAAE,CAAC;QACjE,MAAM,IAAI,CAAC,+BAA+B,CAAC,KAAK,EAAE,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,wCAAwC,CAAC,SAAkB;QAC/D,OAAO,IAAA,aAAM,EAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC,WAAW,CAAC,EAAC,OAAO,EAAE,SAAS,EAAC,CAAC,CAAC;IAC1F,CAAC;CACF;AAzBD,8CAyBC","sourcesContent":["import {Page, Locator, expect} from \"@playwright/test\";\nimport {UiBaseLocators} from \"./UiBaseLocators\";\n\nexport class ProfilingUiHelper extends UiBaseLocators {\n private readonly profilingTab: Locator;\n private readonly activateProfilerByDefaultToggle: Locator;\n private readonly activateProfilerByDefaultCheckbox: Locator;\n\n constructor(page: Page) {\n super(page);\n this.profilingTab = page.getByRole('tab', {name: 'Profiling'});\n this.activateProfilerByDefaultToggle = page.locator(\"[label='Activate the profiler by default'] #toggle\");\n this.activateProfilerByDefaultCheckbox = page.getByLabel('Activate the profiler by default');\n }\n\n async clickProfilingTab() {\n await expect(this.profilingTab).toBeVisible();\n await this.profilingTab.click();\n }\n\n async clickActivateProfilerByDefaultToggle() {\n await expect(this.activateProfilerByDefaultToggle).toBeVisible();\n await this.activateProfilerByDefaultToggle.click();\n }\n\n async isActivateProfilerByDefaultToggleChecked(isChecked: boolean) {\n return expect(this.activateProfilerByDefaultCheckbox).toBeChecked({checked: isChecked});\n }\n}\n"]}
@@ -418,6 +418,7 @@ class UiBaseLocators {
418
418
  await this.selectPropertyEditorBtn.click();
419
419
  }
420
420
  async clickCreateFolderButton() {
421
+ await (0, test_1.expect)(this.createFolderBtn).toBeVisible();
421
422
  await this.createFolderBtn.click();
422
423
  }
423
424
  async enterAPropertyName(name) {
@@ -425,9 +426,11 @@ class UiBaseLocators {
425
426
  await this.propertyNameTxt.fill(name);
426
427
  }
427
428
  async clickConfirmButton() {
429
+ await (0, test_1.expect)(this.confirmBtn).toBeVisible();
428
430
  await this.confirmBtn.click();
429
431
  }
430
432
  async clickBreadcrumbButton() {
433
+ await (0, test_1.expect)(this.breadcrumbBtn).toBeVisible();
431
434
  await this.breadcrumbBtn.click();
432
435
  }
433
436
  async clickInsertButton() {
@@ -435,20 +438,26 @@ class UiBaseLocators {
435
438
  await this.insertBtn.click();
436
439
  }
437
440
  async clickConfirmToDeleteButton() {
441
+ await (0, test_1.expect)(this.confirmToDeleteBtn).toBeVisible();
438
442
  await this.confirmToDeleteBtn.click();
439
- await this.page.waitForTimeout(500);
440
443
  }
441
444
  async clickConfirmCreateFolderButton() {
445
+ await (0, test_1.expect)(this.confirmCreateFolderBtn).toBeVisible();
442
446
  await this.confirmCreateFolderBtn.click();
443
447
  }
444
448
  async clickRemoveExactButton() {
449
+ await (0, test_1.expect)(this.removeExactBtn).toBeVisible();
445
450
  await this.removeExactBtn.click();
446
451
  }
447
452
  async clickRemoveButtonForName(name) {
448
- await this.page.locator('[name="' + name + '"] [label="Remove"]').click();
453
+ const removeButtonWithNameLocator = this.page.locator('[name="' + name + '"] [label="Remove"]');
454
+ await (0, test_1.expect)(removeButtonWithNameLocator).toBeVisible();
455
+ await removeButtonWithNameLocator.click();
449
456
  }
450
457
  async clickTrashIconButtonForName(name) {
451
- await this.page.locator('[name="' + name + '"] [name="icon-trash"]').click();
458
+ const trashIconButtonWithNameLocator = this.page.locator('[name="' + name + '"] [name="icon-trash"]');
459
+ await (0, test_1.expect)(trashIconButtonWithNameLocator).toBeVisible();
460
+ await trashIconButtonWithNameLocator.click();
452
461
  }
453
462
  async clickRemoveWithName(name) {
454
463
  const removeLabelWithNameLocator = this.page.locator('[label="Remove ' + name + '"]');
@@ -456,18 +465,23 @@ class UiBaseLocators {
456
465
  await removeLabelWithNameLocator.click();
457
466
  }
458
467
  async clickDisableButton() {
468
+ await (0, test_1.expect)(this.disableBtn).toBeVisible();
459
469
  await this.disableBtn.click();
460
470
  }
461
471
  async clickConfirmDisableButton() {
472
+ await (0, test_1.expect)(this.confirmDisableBtn).toBeVisible();
462
473
  await this.confirmDisableBtn.click();
463
474
  }
464
475
  async clickConfirmRemoveButton() {
476
+ await (0, test_1.expect)(this.confirmToRemoveBtn).toBeVisible();
465
477
  await this.confirmToRemoveBtn.click();
466
478
  }
467
479
  async clickEnableButton() {
480
+ await (0, test_1.expect)(this.enableBtn).toBeVisible();
468
481
  await this.enableBtn.click();
469
482
  }
470
483
  async clickConfirmEnableButton() {
484
+ await (0, test_1.expect)(this.confirmEnableBtn).toBeVisible();
471
485
  await this.confirmEnableBtn.click();
472
486
  }
473
487
  async insertDictionaryItem(dictionaryName) {
@@ -476,6 +490,7 @@ class UiBaseLocators {
476
490
  await this.insertDictionaryItemBtn.click();
477
491
  await (0, test_1.expect)(this.page.getByLabel(dictionaryName)).toBeVisible();
478
492
  await this.page.getByLabel(dictionaryName).click();
493
+ await (0, test_1.expect)(this.chooseBtn).toBeVisible();
479
494
  await this.chooseBtn.click();
480
495
  }
481
496
  async addQueryBuilderWithOrderByStatement(propertyAlias, isAscending) {
@@ -545,6 +560,7 @@ class UiBaseLocators {
545
560
  await this.clickConfirmToDeleteButton();
546
561
  }
547
562
  async clickDeleteExactButton() {
563
+ await (0, test_1.expect)(this.deleteExactBtn).toBeVisible();
548
564
  await this.deleteExactBtn.click();
549
565
  }
550
566
  async isTreeItemVisible(name, isVisible = true) {
@@ -598,6 +614,7 @@ class UiBaseLocators {
598
614
  return await (0, test_1.expect)(this.page.getByText(message)).toBeVisible({ visible: isVisible });
599
615
  }
600
616
  async clickCreateThreeDotsButton() {
617
+ await (0, test_1.expect)(this.createThreeDotsBtn).toBeVisible();
601
618
  await this.createThreeDotsBtn.click();
602
619
  }
603
620
  async clickCreateButton() {
@@ -610,12 +627,16 @@ class UiBaseLocators {
610
627
  }
611
628
  ;
612
629
  async clickNewFolderThreeDotsButton() {
630
+ await (0, test_1.expect)(this.newFolderThreeDotsBtn).toBeVisible();
613
631
  await this.newFolderThreeDotsBtn.click();
614
632
  }
615
633
  async clickEditorSettingsButton(index = 0) {
634
+ await (0, test_1.expect)(this.editorSettingsBtn.nth(index)).toBeVisible();
616
635
  return this.editorSettingsBtn.nth(index).click();
617
636
  }
618
637
  async enterDescription(description) {
638
+ await (0, test_1.expect)(this.enterDescriptionTxt).toBeVisible();
639
+ await this.enterDescriptionTxt.clear();
619
640
  await this.enterDescriptionTxt.fill(description);
620
641
  }
621
642
  async doesDescriptionHaveValue(value, index = 0) {
@@ -623,13 +644,15 @@ class UiBaseLocators {
623
644
  }
624
645
  async clickStructureTab() {
625
646
  await this.page.waitForTimeout(1000);
626
- await this.structureTabBtn.waitFor({ state: 'visible' });
647
+ await (0, test_1.expect)(this.structureTabBtn).toBeVisible();
627
648
  await this.structureTabBtn.click();
628
649
  }
629
650
  async clickAllowAtRootButton() {
651
+ await (0, test_1.expect)(this.allowAtRootBtn).toBeVisible();
630
652
  await this.allowAtRootBtn.click();
631
653
  }
632
654
  async clickIAmDoneReorderingButton() {
655
+ await (0, test_1.expect)(this.iAmDoneReorderingBtn).toBeVisible();
633
656
  await this.iAmDoneReorderingBtn.click();
634
657
  }
635
658
  async clickReorderButton() {
@@ -637,12 +660,15 @@ class UiBaseLocators {
637
660
  await this.reorderBtn.click();
638
661
  }
639
662
  async clickLabelAboveButton() {
663
+ await (0, test_1.expect)(this.labelAboveBtn).toBeVisible();
640
664
  await this.labelAboveBtn.click();
641
665
  }
642
666
  async clickMandatoryToggle() {
667
+ await (0, test_1.expect)(this.mandatoryToggle).toBeVisible();
643
668
  await this.mandatoryToggle.click();
644
669
  }
645
670
  async selectValidationOption(option) {
671
+ await (0, test_1.expect)(this.validation).toBeVisible();
646
672
  await this.validation.selectOption(option);
647
673
  }
648
674
  async enterRegEx(regEx) {
@@ -696,6 +722,7 @@ class UiBaseLocators {
696
722
  await this.enterPropertyEditorDescriptionTxt.fill(description);
697
723
  }
698
724
  async clickAddGroupButton() {
725
+ await (0, test_1.expect)(this.addGroupBtn).toBeVisible();
699
726
  await this.addGroupBtn.click();
700
727
  }
701
728
  async clickChooseModalButton() {
@@ -756,8 +783,11 @@ class UiBaseLocators {
756
783
  await this.insertValueBtn.click();
757
784
  await (0, test_1.expect)(this.chooseFieldDropDown).toBeVisible();
758
785
  await this.chooseFieldDropDown.click();
786
+ await (0, test_1.expect)(this.systemFieldsOption).toBeVisible();
759
787
  await this.systemFieldsOption.click();
788
+ await (0, test_1.expect)(this.chooseFieldValueDropDown).toBeVisible();
760
789
  await this.chooseFieldValueDropDown.click();
790
+ await (0, test_1.expect)(this.page.getByText(fieldValue)).toBeVisible();
761
791
  await this.page.getByText(fieldValue).click();
762
792
  await this.clickSubmitButton();
763
793
  }
@@ -767,7 +797,7 @@ class UiBaseLocators {
767
797
  await this.insertPartialViewBtn.click();
768
798
  await (0, test_1.expect)(this.page.getByLabel(partialViewName)).toBeVisible();
769
799
  await this.page.getByLabel(partialViewName).click();
770
- await this.chooseBtn.click();
800
+ await this.clickChooseButton();
771
801
  }
772
802
  async deletePropertyEditorWithName(name) {
773
803
  // We need to hover over the Property Editor to make the delete button visible
@@ -799,8 +829,7 @@ class UiBaseLocators {
799
829
  async chooseRootContentInQueryBuilder(contentName) {
800
830
  await (0, test_1.expect)(this.chooseRootContentBtn).toBeVisible();
801
831
  await this.chooseRootContentBtn.click();
802
- await (0, test_1.expect)(this.page.getByText(contentName)).toBeVisible();
803
- await this.page.getByText(contentName).click();
832
+ await this.clickModalMenuItemWithName(contentName);
804
833
  await this.clickChooseButton();
805
834
  }
806
835
  async reorderTwoGroups(firstGroupName, secondGroupName) {
@@ -889,12 +918,12 @@ class UiBaseLocators {
889
918
  await (0, test_1.expect)(this.recycleBinMenuItem).toBeVisible();
890
919
  // If the Recycle Bin does not contain any items,0 the caret button should not be visible. and we should not try to click it
891
920
  if (!containsItems) {
892
- await this.clickReloadChildrenButton();
921
+ await this.clickReloadChildrenActionMenuOption();
893
922
  await (0, test_1.expect)(this.recycleBinMenuItemCaretBtn).not.toBeVisible();
894
923
  return;
895
924
  }
896
925
  await this.clickActionsMenuForName('Recycle Bin');
897
- await this.clickReloadChildrenButton();
926
+ await this.clickReloadChildrenActionMenuOption();
898
927
  await (0, test_1.expect)(this.recycleBinMenuItem).toBeVisible();
899
928
  await (0, test_1.expect)(this.recycleBinMenuItemCaretBtn.first()).toBeVisible();
900
929
  const isCaretButtonOpen = await this.recycleBinMenuItem.first().getAttribute('show-children');