@umbraco/playwright-testhelpers 16.0.52 → 16.0.53

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.
@@ -170,6 +170,7 @@ export declare class ContentUiHelper extends UiBaseLocators {
170
170
  private readonly treePickerSearchTxt;
171
171
  private readonly mediaPickerSearchTxt;
172
172
  private readonly memberPickerSearchTxt;
173
+ private readonly refListBlock;
173
174
  private readonly propertyActionMenu;
174
175
  constructor(page: Page);
175
176
  enterContentName(name: string): Promise<void>;
@@ -430,5 +431,8 @@ export declare class ContentUiHelper extends UiBaseLocators {
430
431
  enterSearchKeywordInMediaPickerModal(keyword: string): Promise<void>;
431
432
  enterSearchKeywordInMemberPickerModal(keyword: string): Promise<void>;
432
433
  isContentNameReadOnly(): Promise<void>;
434
+ isBlockCustomViewVisible(blockCustomViewLocator: string, isVisible?: boolean): Promise<void>;
435
+ isSingleBlockElementVisible(isVisible?: boolean): Promise<void>;
436
+ doesBlockCustomViewHaveValue(customBlockViewLocator: string, valueText: string): Promise<void>;
433
437
  clickPropertyActionWithName(name: string): Promise<void>;
434
438
  }
@@ -174,6 +174,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
174
174
  treePickerSearchTxt;
175
175
  mediaPickerSearchTxt;
176
176
  memberPickerSearchTxt;
177
+ refListBlock;
177
178
  propertyActionMenu;
178
179
  constructor(page) {
179
180
  super(page);
@@ -312,6 +313,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
312
313
  this.blockGridAreasContainer = page.locator('umb-block-grid-areas-container');
313
314
  this.blockGridEntries = page.locator('umb-block-grid-entries');
314
315
  this.inlineCreateBtn = page.locator('uui-button-inline-create');
316
+ this.refListBlock = page.locator('umb-ref-list-block');
315
317
  // TipTap
316
318
  this.tipTapPropertyEditor = page.locator('umb-property-editor-ui-tiptap');
317
319
  this.tipTapEditor = this.tipTapPropertyEditor.locator('#editor .tiptap');
@@ -1459,6 +1461,25 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
1459
1461
  async isContentNameReadOnly() {
1460
1462
  await (0, test_1.expect)(this.contentNameTxt).toHaveAttribute('readonly');
1461
1463
  }
1464
+ // Block Custom View
1465
+ async isBlockCustomViewVisible(blockCustomViewLocator, isVisible = true) {
1466
+ await (0, test_1.expect)(this.page.locator(blockCustomViewLocator)).toBeVisible({ visible: isVisible });
1467
+ }
1468
+ async isSingleBlockElementVisible(isVisible = true) {
1469
+ const count = await this.refListBlock.count();
1470
+ if (isVisible) {
1471
+ (0, test_1.expect)(count, `Expected only one element, but found ${count}`).toBe(1);
1472
+ }
1473
+ else {
1474
+ (0, test_1.expect)(count, `Expected only one element, but found ${count}`).toBe(0);
1475
+ }
1476
+ await (0, test_1.expect)(this.refListBlock).toBeVisible({ visible: isVisible });
1477
+ }
1478
+ async doesBlockCustomViewHaveValue(customBlockViewLocator, valueText) {
1479
+ const locator = this.page.locator(`${customBlockViewLocator} p`);
1480
+ await (0, test_1.expect)(locator).toBeVisible();
1481
+ await (0, test_1.expect)(locator).toHaveText(valueText);
1482
+ }
1462
1483
  async clickPropertyActionWithName(name) {
1463
1484
  const actionLocator = this.propertyActionMenu.locator('umb-property-action uui-menu-item[label="' + name + '"]');
1464
1485
  await (0, test_1.expect)(actionLocator).toBeVisible();