@umbraco/playwright-testhelpers 15.0.21 → 15.0.23

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.
@@ -136,6 +136,10 @@ export declare class ContentUiHelper extends UiBaseLocators {
136
136
  private readonly blockWorkspace;
137
137
  private readonly saveContentBtn;
138
138
  private readonly splitView;
139
+ private readonly tiptapInput;
140
+ private readonly rteBlockInline;
141
+ private readonly backofficeModalContainer;
142
+ private readonly rteBlock;
139
143
  constructor(page: Page);
140
144
  enterContentName(name: string): Promise<void>;
141
145
  clickSaveAndPublishButton(): Promise<void>;
@@ -157,7 +161,7 @@ export declare class ContentUiHelper extends UiBaseLocators {
157
161
  clickConfirmToUnpublishButton(): Promise<void>;
158
162
  clickCreateDocumentBlueprintButton(): Promise<void>;
159
163
  clickInfoTab(): Promise<void>;
160
- doesLinkHaveText(text: string): Promise<void>;
164
+ doesDocumentHaveLink(link: string): Promise<void>;
161
165
  doesHistoryHaveText(text: string): Promise<void>;
162
166
  doesPublicationStatusHaveText(text: string): Promise<void>;
163
167
  doesCreatedDateHaveText(text: string): Promise<void>;
@@ -327,4 +331,10 @@ export declare class ContentUiHelper extends UiBaseLocators {
327
331
  enterRTETipTapEditor(value: string): Promise<void>;
328
332
  clickTipTapToolbarIconWithTitle(iconTitle: string): Promise<void>;
329
333
  doesUploadedSvgThumbnailHaveSrc(imageSrc: string): Promise<void>;
334
+ doesRichTextEditorBlockContainLabel(richTextEditorAlias: string, label: string): Promise<void>;
335
+ doesBlockEditorModalContainEditorSize(editorSize: string, elementName: string): Promise<void>;
336
+ doesBlockEditorModalContainInline(richTextEditorAlias: string, elementName: string): Promise<void>;
337
+ doesBlockHaveBackgroundColor(elementName: string, backgroundColor: string): Promise<void>;
338
+ doesBlockHaveIconColor(elementName: string, backgroundColor: string): Promise<void>;
339
+ addDocumentDomain(domainName: string, languageName: string): Promise<void>;
330
340
  }
@@ -140,6 +140,10 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
140
140
  blockWorkspace;
141
141
  saveContentBtn;
142
142
  splitView;
143
+ tiptapInput;
144
+ rteBlockInline;
145
+ backofficeModalContainer;
146
+ rteBlock;
143
147
  constructor(page) {
144
148
  super(page);
145
149
  this.saveContentBtn = page.locator('[data-mark="workspace-action:Umb.WorkspaceAction.Document.Save"]');
@@ -191,8 +195,8 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
191
195
  this.documentLanguageSelectPopover = page.locator('umb-popover-layout');
192
196
  this.documentReadOnly = this.documentWorkspace.locator('#name-input').getByText('Read-only');
193
197
  // Info tab
194
- this.infoTab = page.getByRole('tab', { name: 'Info' });
195
- this.linkContent = page.locator('.link-item');
198
+ this.infoTab = page.locator('uui-tab[data-mark="workspace:view-link:Umb.WorkspaceView.Document.Info"]');
199
+ this.linkContent = page.locator('umb-document-links-workspace-info-app');
196
200
  this.historyItems = page.locator('umb-history-item');
197
201
  this.generalItem = page.locator('.general-item');
198
202
  this.publicationStatus = this.generalItem.filter({ hasText: 'Publication Status' }).locator('uui-tag');
@@ -209,7 +213,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
209
213
  this.deleteDomainBtn = page.locator('[headline="Domains"] [name="icon-trash"] svg');
210
214
  this.domainComboBox = page.locator('#domains uui-combobox');
211
215
  this.saveModalBtn = this.sidebarModal.getByLabel('Save', { exact: true });
212
- this.resetFocalPointBtn = this.page.getByLabel('Reset focal point');
216
+ this.resetFocalPointBtn = page.getByLabel('Reset focal point');
213
217
  // List View
214
218
  this.enterNameInContainerTxt = this.container.getByLabel('Enter a name…');
215
219
  this.listView = page.locator('umb-document-table-collection-view');
@@ -230,7 +234,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
230
234
  this.documentBlueprintModalEnterNameTxt = this.documentBlueprintModal.locator('input');
231
235
  this.documentBlueprintSaveBtn = this.documentBlueprintModal.getByLabel('Save');
232
236
  this.emptyRecycleBinBtn = page.getByLabel('Empty Recycle Bin');
233
- this.confirmEmptyRecycleBinBtn = this.page.locator('#confirm').getByLabel('Empty Recycle Bin', { exact: true });
237
+ this.confirmEmptyRecycleBinBtn = page.locator('#confirm').getByLabel('Empty Recycle Bin', { exact: true });
234
238
  this.duplicateToBtn = page.getByRole('button', { name: 'Duplicate to' });
235
239
  this.moveToBtn = page.getByRole('button', { name: 'Move to' });
236
240
  this.duplicateBtn = page.getByLabel('Duplicate', { exact: true });
@@ -278,10 +282,14 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
278
282
  // TipTap
279
283
  this.tipTapPropertyEditor = page.locator('umb-property-editor-ui-tiptap');
280
284
  this.tipTapEditor = this.tipTapPropertyEditor.locator('#editor .tiptap');
281
- this.uploadedSvgThumbnail = this.page.locator('umb-input-upload-field-svg img');
282
- this.insertBlockBtn = this.page.locator('[title="Insert Block"]');
283
- this.validationMessage = this.page.locator('umb-form-validation-message').locator('#messages');
285
+ this.uploadedSvgThumbnail = page.locator('umb-input-upload-field-svg img');
286
+ this.insertBlockBtn = page.locator('[title="Insert Block"]');
287
+ this.validationMessage = page.locator('umb-form-validation-message').locator('#messages');
284
288
  this.blockWorkspace = page.locator('umb-block-workspace-editor');
289
+ this.tiptapInput = page.locator('umb-input-tiptap');
290
+ this.rteBlockInline = page.locator('umb-rte-block-inline');
291
+ this.backofficeModalContainer = page.locator('umb-backoffice-modal-container');
292
+ this.rteBlock = page.locator('umb-rte-block');
285
293
  }
286
294
  async enterContentName(name) {
287
295
  await (0, test_1.expect)(this.contentNameTxt).toBeVisible();
@@ -359,8 +367,8 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
359
367
  await (0, test_1.expect)(this.infoTab).toBeVisible();
360
368
  await this.infoTab.click();
361
369
  }
362
- async doesLinkHaveText(text) {
363
- await (0, test_1.expect)(this.linkContent).toHaveText(text);
370
+ async doesDocumentHaveLink(link) {
371
+ await (0, test_1.expect)(this.linkContent).toContainText(link);
364
372
  }
365
373
  async doesHistoryHaveText(text) {
366
374
  await (0, test_1.expect)(this.historyItems).toHaveText(text);
@@ -1089,6 +1097,28 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
1089
1097
  await (0, test_1.expect)(this.uploadedSvgThumbnail).toBeVisible();
1090
1098
  await (0, test_1.expect)(this.uploadedSvgThumbnail).toHaveAttribute('src', imageSrc);
1091
1099
  }
1100
+ async doesRichTextEditorBlockContainLabel(richTextEditorAlias, label) {
1101
+ await (0, test_1.expect)(this.page.locator('[data-mark="property:' + richTextEditorAlias + '"]').locator(this.rteBlock)).toContainText(label);
1102
+ }
1103
+ async doesBlockEditorModalContainEditorSize(editorSize, elementName) {
1104
+ await (0, test_1.expect)(this.backofficeModalContainer.locator('[size="' + editorSize + '"]').locator('[headline="Add ' + elementName + '"]')).toBeVisible();
1105
+ }
1106
+ async doesBlockEditorModalContainInline(richTextEditorAlias, elementName) {
1107
+ await (0, test_1.expect)(this.page.locator('[data-mark="property:' + richTextEditorAlias + '"]').locator(this.tiptapInput).locator(this.rteBlockInline)).toContainText(elementName);
1108
+ }
1109
+ async doesBlockHaveBackgroundColor(elementName, backgroundColor) {
1110
+ await (0, test_1.expect)(this.page.locator('umb-block-type-card', { hasText: elementName }).locator('[style="background-color:' + backgroundColor + ';"]')).toBeVisible();
1111
+ }
1112
+ async doesBlockHaveIconColor(elementName, backgroundColor) {
1113
+ await (0, test_1.expect)(this.page.locator('umb-block-type-card', { hasText: elementName }).locator('[color="' + backgroundColor + '"]')).toBeVisible();
1114
+ }
1115
+ async addDocumentDomain(domainName, languageName) {
1116
+ await this.clickCultureAndHostnamesButton();
1117
+ await this.clickAddNewDomainButton();
1118
+ await this.enterDomain(domainName);
1119
+ await this.selectDomainLanguageOption(languageName);
1120
+ await this.clickSaveModalButton();
1121
+ }
1092
1122
  }
1093
1123
  exports.ContentUiHelper = ContentUiHelper;
1094
1124
  //# sourceMappingURL=ContentUiHelper.js.map