@umbraco/playwright-testhelpers 16.0.18 → 16.0.20
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/ContentUiHelper.d.ts +10 -0
- package/dist/lib/helpers/ContentUiHelper.js +45 -0
- package/dist/lib/helpers/ContentUiHelper.js.map +1 -1
- package/dist/lib/helpers/DataTypeApiHelper.d.ts +1 -0
- package/dist/lib/helpers/DataTypeApiHelper.js +13 -0
- package/dist/lib/helpers/DataTypeApiHelper.js.map +1 -1
- package/dist/lib/helpers/DataTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentTypeApiHelper.d.ts +1 -0
- package/dist/lib/helpers/DocumentTypeApiHelper.js +11 -0
- package/dist/lib/helpers/DocumentTypeApiHelper.js.map +1 -1
- package/dist/lib/helpers/UiBaseLocators.d.ts +1 -1
- package/dist/lib/helpers/UiBaseLocators.js +4 -3
- package/dist/lib/helpers/UiBaseLocators.js.map +1 -1
- package/dist/lib/helpers/UserGroupApiHelper.d.ts +1 -0
- package/dist/lib/helpers/UserGroupApiHelper.js +39 -1
- package/dist/lib/helpers/UserGroupApiHelper.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -164,6 +164,8 @@ export declare class ContentUiHelper extends UiBaseLocators {
|
|
|
164
164
|
private readonly publishWithDescendantsModalBtn;
|
|
165
165
|
private readonly documentVariantLanguagePicker;
|
|
166
166
|
private readonly documentVariantLanguageItem;
|
|
167
|
+
private readonly styleSelectBtn;
|
|
168
|
+
private readonly cascadingMenuContainer;
|
|
167
169
|
constructor(page: Page);
|
|
168
170
|
enterContentName(name: string): Promise<void>;
|
|
169
171
|
clickSaveAndPublishButton(): Promise<void>;
|
|
@@ -314,6 +316,8 @@ export declare class ContentUiHelper extends UiBaseLocators {
|
|
|
314
316
|
clickMediaLinkButton(): Promise<void>;
|
|
315
317
|
clickManualLinkButton(): Promise<void>;
|
|
316
318
|
clickAddBlockElementButton(): Promise<void>;
|
|
319
|
+
clickAddBlockWithNameButton(name: string): Promise<void>;
|
|
320
|
+
clickCreateForModalWithHeadline(headline: string): Promise<void>;
|
|
317
321
|
isAddBlockElementButtonVisible(isVisible?: boolean): Promise<void>;
|
|
318
322
|
isAddBlockElementButtonWithLabelVisible(blockName: string, label: string, isVisible?: boolean): Promise<void>;
|
|
319
323
|
doesFormValidationMessageContainText(text: string): Promise<void>;
|
|
@@ -365,6 +369,7 @@ export declare class ContentUiHelper extends UiBaseLocators {
|
|
|
365
369
|
doesPropertyContainValidationMessage(groupName: string, propertyName: string, message: string): Promise<void>;
|
|
366
370
|
clickInsertBlockButton(): Promise<void>;
|
|
367
371
|
enterRTETipTapEditor(value: string): Promise<void>;
|
|
372
|
+
enterRTETipTapEditorWithName(name: string, value: string): Promise<void>;
|
|
368
373
|
clickTipTapToolbarIconWithTitle(iconTitle: string): Promise<void>;
|
|
369
374
|
doesUploadedSvgThumbnailHaveSrc(imageSrc: string): Promise<void>;
|
|
370
375
|
doesRichTextEditorBlockContainLabel(richTextEditorAlias: string, label: string): Promise<void>;
|
|
@@ -397,4 +402,9 @@ export declare class ContentUiHelper extends UiBaseLocators {
|
|
|
397
402
|
doesDocumentVariantLanguageItemHaveCount(count: number): Promise<void>;
|
|
398
403
|
doesDocumentVariantLanguageItemHaveName(name: string): Promise<void>;
|
|
399
404
|
clickSchedulePublishLanguageButton(languageName: string): Promise<void>;
|
|
405
|
+
clickBlockCardWithName(name: string, toForce?: boolean): Promise<void>;
|
|
406
|
+
clickStyleSelectButton(): Promise<void>;
|
|
407
|
+
clickCascadingMenuItemWithName(name: string): Promise<void>;
|
|
408
|
+
hoverCascadingMenuItemWithName(name: string): Promise<void>;
|
|
409
|
+
selectAllRTETipTapEditorText(): Promise<void>;
|
|
400
410
|
}
|
|
@@ -168,6 +168,8 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
168
168
|
publishWithDescendantsModalBtn;
|
|
169
169
|
documentVariantLanguagePicker;
|
|
170
170
|
documentVariantLanguageItem;
|
|
171
|
+
styleSelectBtn;
|
|
172
|
+
cascadingMenuContainer;
|
|
171
173
|
constructor(page) {
|
|
172
174
|
super(page);
|
|
173
175
|
this.saveContentBtn = page.getByTestId('workspace-action:Umb.WorkspaceAction.Document.Save');
|
|
@@ -340,6 +342,9 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
340
342
|
this.publishWithDescendantsModalBtn = this.documentPublishWithDescendantsModal.getByLabel('Publish with descendants', { exact: true });
|
|
341
343
|
this.documentVariantLanguagePicker = page.locator('umb-document-variant-language-picker');
|
|
342
344
|
this.documentVariantLanguageItem = this.documentVariantLanguagePicker.locator('uui-menu-item');
|
|
345
|
+
// Tiptap - Style Select
|
|
346
|
+
this.styleSelectBtn = page.locator('uui-button[label="Style Select"]');
|
|
347
|
+
this.cascadingMenuContainer = page.locator('umb-cascading-menu-popover uui-scroll-container');
|
|
343
348
|
}
|
|
344
349
|
async enterContentName(name) {
|
|
345
350
|
await (0, test_1.expect)(this.contentNameTxt).toBeVisible();
|
|
@@ -350,6 +355,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
350
355
|
async clickSaveAndPublishButton() {
|
|
351
356
|
await (0, test_1.expect)(this.saveAndPublishBtn).toBeVisible();
|
|
352
357
|
await this.saveAndPublishBtn.click();
|
|
358
|
+
await this.page.waitForTimeout(500);
|
|
353
359
|
}
|
|
354
360
|
async isSuccessStateVisibleForSaveAndPublishButton(isVisible = true) {
|
|
355
361
|
const saveAndPublishBtn = this.workspaceAction.filter({ has: this.saveAndPublishBtn });
|
|
@@ -389,6 +395,7 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
389
395
|
async clickSaveButtonForContent() {
|
|
390
396
|
await (0, test_1.expect)(this.saveContentBtn).toBeVisible();
|
|
391
397
|
await this.saveContentBtn.click();
|
|
398
|
+
await this.page.waitForTimeout(500);
|
|
392
399
|
}
|
|
393
400
|
async enterTextstring(text) {
|
|
394
401
|
await (0, test_1.expect)(this.textstringTxt).toBeVisible();
|
|
@@ -974,6 +981,14 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
974
981
|
await (0, test_1.expect)(this.addBlockElementBtn).toBeVisible();
|
|
975
982
|
await this.addBlockElementBtn.click();
|
|
976
983
|
}
|
|
984
|
+
async clickAddBlockWithNameButton(name) {
|
|
985
|
+
await (0, test_1.expect)(this.page.getByLabel('Add ' + name)).toBeVisible();
|
|
986
|
+
await this.page.getByLabel('Add ' + name).click();
|
|
987
|
+
}
|
|
988
|
+
async clickCreateForModalWithHeadline(headline) {
|
|
989
|
+
await (0, test_1.expect)(this.page.locator('[headline="' + headline + '"]').getByLabel('Create')).toBeVisible();
|
|
990
|
+
await this.page.locator('[headline="' + headline + '"]').getByLabel('Create').click();
|
|
991
|
+
}
|
|
977
992
|
async isAddBlockElementButtonVisible(isVisible = true) {
|
|
978
993
|
await (0, test_1.expect)(this.addBlockElementBtn).toBeVisible({ visible: isVisible });
|
|
979
994
|
}
|
|
@@ -1210,6 +1225,12 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
1210
1225
|
await this.tipTapEditor.clear();
|
|
1211
1226
|
await this.tipTapEditor.fill(value);
|
|
1212
1227
|
}
|
|
1228
|
+
async enterRTETipTapEditorWithName(name, value) {
|
|
1229
|
+
const tipTapEditorLocator = this.page.locator('[data-mark="property:' + name + '"]').locator(this.tipTapEditor);
|
|
1230
|
+
await (0, test_1.expect)(tipTapEditorLocator).toBeVisible();
|
|
1231
|
+
await tipTapEditorLocator.clear();
|
|
1232
|
+
await tipTapEditorLocator.fill(value);
|
|
1233
|
+
}
|
|
1213
1234
|
async clickTipTapToolbarIconWithTitle(iconTitle) {
|
|
1214
1235
|
await (0, test_1.expect)(this.tipTapPropertyEditor.getByTitle(iconTitle, { exact: true }).locator('svg')).toBeVisible();
|
|
1215
1236
|
await this.tipTapPropertyEditor.getByTitle(iconTitle, { exact: true }).locator('svg').click();
|
|
@@ -1331,6 +1352,30 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
1331
1352
|
await (0, test_1.expect)(this.page.getByRole('menu').filter({ hasText: languageName })).toBeVisible();
|
|
1332
1353
|
await this.page.getByRole('menu').filter({ hasText: languageName }).click();
|
|
1333
1354
|
}
|
|
1355
|
+
async clickBlockCardWithName(name, toForce = false) {
|
|
1356
|
+
const blockWithNameLocator = this.page.locator('umb-block-type-card', { hasText: name });
|
|
1357
|
+
await (0, test_1.expect)(blockWithNameLocator).toBeVisible();
|
|
1358
|
+
await blockWithNameLocator.click({ force: toForce });
|
|
1359
|
+
}
|
|
1360
|
+
async clickStyleSelectButton() {
|
|
1361
|
+
await (0, test_1.expect)(this.styleSelectBtn).toBeVisible();
|
|
1362
|
+
await this.styleSelectBtn.click();
|
|
1363
|
+
}
|
|
1364
|
+
async clickCascadingMenuItemWithName(name) {
|
|
1365
|
+
const menuItemLocator = this.cascadingMenuContainer.locator('uui-menu-item[label="' + name + '"]');
|
|
1366
|
+
await (0, test_1.expect)(menuItemLocator).toBeVisible();
|
|
1367
|
+
await menuItemLocator.click();
|
|
1368
|
+
}
|
|
1369
|
+
async hoverCascadingMenuItemWithName(name) {
|
|
1370
|
+
const menuItemLocator = this.cascadingMenuContainer.locator('uui-menu-item[label="' + name + '"]');
|
|
1371
|
+
await (0, test_1.expect)(menuItemLocator).toBeVisible();
|
|
1372
|
+
await menuItemLocator.hover();
|
|
1373
|
+
}
|
|
1374
|
+
async selectAllRTETipTapEditorText() {
|
|
1375
|
+
await (0, test_1.expect)(this.tipTapEditor).toBeVisible();
|
|
1376
|
+
await this.tipTapEditor.click();
|
|
1377
|
+
await this.page.keyboard.press('Control+A');
|
|
1378
|
+
}
|
|
1334
1379
|
}
|
|
1335
1380
|
exports.ContentUiHelper = ContentUiHelper;
|
|
1336
1381
|
//# sourceMappingURL=ContentUiHelper.js.map
|