@umbraco/playwright-testhelpers 17.0.4 → 17.0.6
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/ContentRenderUiHelper.d.ts +2 -0
- package/dist/lib/helpers/ContentRenderUiHelper.js +5 -0
- package/dist/lib/helpers/ContentRenderUiHelper.js.map +1 -1
- package/dist/lib/helpers/ContentUiHelper.d.ts +5 -0
- package/dist/lib/helpers/ContentUiHelper.js +31 -9
- package/dist/lib/helpers/ContentUiHelper.js.map +1 -1
- package/dist/lib/helpers/DataTypeApiHelper.d.ts +2 -0
- package/dist/lib/helpers/DataTypeApiHelper.js +19 -0
- package/dist/lib/helpers/DataTypeApiHelper.js.map +1 -1
- package/dist/lib/helpers/DataTypeUiHelper.d.ts +2 -0
- package/dist/lib/helpers/DataTypeUiHelper.js +10 -3
- package/dist/lib/helpers/DataTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/DictionaryUiHelper.js +3 -3
- package/dist/lib/helpers/DictionaryUiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentBlueprintUiHelper.js +2 -2
- package/dist/lib/helpers/DocumentBlueprintUiHelper.js.map +1 -1
- package/dist/lib/helpers/DocumentTypeUiHelper.js +3 -3
- package/dist/lib/helpers/DocumentTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/LanguageUiHelper.js +2 -2
- package/dist/lib/helpers/LanguageUiHelper.js.map +1 -1
- package/dist/lib/helpers/MediaTypeUiHelper.js +3 -3
- package/dist/lib/helpers/MediaTypeUiHelper.js.map +1 -1
- package/dist/lib/helpers/MediaUiHelper.js +4 -4
- package/dist/lib/helpers/MediaUiHelper.js.map +1 -1
- package/dist/lib/helpers/MemberGroupUiHelper.js +2 -2
- package/dist/lib/helpers/MemberGroupUiHelper.js.map +1 -1
- package/dist/lib/helpers/MemberUiHelper.js +2 -2
- package/dist/lib/helpers/MemberUiHelper.js.map +1 -1
- package/dist/lib/helpers/PartialViewUiHelper.js +3 -3
- package/dist/lib/helpers/PartialViewUiHelper.js.map +1 -1
- package/dist/lib/helpers/ScriptUiHelper.js +3 -3
- package/dist/lib/helpers/ScriptUiHelper.js.map +1 -1
- package/dist/lib/helpers/StylesheetUiHelper.js +3 -3
- package/dist/lib/helpers/StylesheetUiHelper.js.map +1 -1
- package/dist/lib/helpers/TemplateApiHelper.d.ts +2 -0
- package/dist/lib/helpers/TemplateApiHelper.js +33 -0
- package/dist/lib/helpers/TemplateApiHelper.js.map +1 -1
- package/dist/lib/helpers/TemplateUiHelper.js +3 -3
- package/dist/lib/helpers/TemplateUiHelper.js.map +1 -1
- package/dist/lib/helpers/UiBaseLocators.d.ts +0 -1
- package/dist/lib/helpers/UiBaseLocators.js +0 -3
- package/dist/lib/helpers/UiBaseLocators.js.map +1 -1
- package/dist/lib/helpers/UserGroupUiHelper.js +3 -3
- package/dist/lib/helpers/UserGroupUiHelper.js.map +1 -1
- package/dist/lib/helpers/UserUiHelper.js +3 -3
- package/dist/lib/helpers/UserUiHelper.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -2,9 +2,11 @@ import { Page } from "@playwright/test";
|
|
|
2
2
|
import { UiBaseLocators } from "./UiBaseLocators";
|
|
3
3
|
export declare class ContentRenderUiHelper extends UiBaseLocators {
|
|
4
4
|
private readonly contentRenderValue;
|
|
5
|
+
private readonly dataSourceRenderValue;
|
|
5
6
|
constructor(page: Page);
|
|
6
7
|
navigateToRenderedContentPage(contentURL: string): Promise<void>;
|
|
7
8
|
doesContentRenderValueContainText(text: string, isEqual?: boolean): Promise<void>;
|
|
8
9
|
doesContentRenderValueHaveImage(src: string, width: number, height: number): Promise<void>;
|
|
9
10
|
doesContentRenderValueHaveLink(linkSrc: string): Promise<void>;
|
|
11
|
+
doesDataSourceRenderValueHaveText(text: string): Promise<void>;
|
|
10
12
|
}
|
|
@@ -6,9 +6,11 @@ const UiBaseLocators_1 = require("./UiBaseLocators");
|
|
|
6
6
|
const umbraco_config_1 = require("../../umbraco.config");
|
|
7
7
|
class ContentRenderUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
8
8
|
contentRenderValue;
|
|
9
|
+
dataSourceRenderValue;
|
|
9
10
|
constructor(page) {
|
|
10
11
|
super(page);
|
|
11
12
|
this.contentRenderValue = page.getByTestId('content-render-value');
|
|
13
|
+
this.dataSourceRenderValue = page.getByTestId('data-source-render-value');
|
|
12
14
|
}
|
|
13
15
|
async navigateToRenderedContentPage(contentURL) {
|
|
14
16
|
await this.page.goto(umbraco_config_1.umbracoConfig.environment.baseUrl + contentURL);
|
|
@@ -28,6 +30,9 @@ class ContentRenderUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
28
30
|
async doesContentRenderValueHaveLink(linkSrc) {
|
|
29
31
|
return await (0, test_1.expect)(this.contentRenderValue.locator('a')).toHaveAttribute('href', linkSrc);
|
|
30
32
|
}
|
|
33
|
+
async doesDataSourceRenderValueHaveText(text) {
|
|
34
|
+
return await (0, test_1.expect)(this.dataSourceRenderValue).toHaveText(text);
|
|
35
|
+
}
|
|
31
36
|
}
|
|
32
37
|
exports.ContentRenderUiHelper = ContentRenderUiHelper;
|
|
33
38
|
//# sourceMappingURL=ContentRenderUiHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentRenderUiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/ContentRenderUiHelper.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AACvD,qDAAgD;AAChD,yDAAmD;AAEnD,MAAa,qBAAsB,SAAQ,+BAAc;IACtC,kBAAkB,CAAU;
|
|
1
|
+
{"version":3,"file":"ContentRenderUiHelper.js","sourceRoot":"","sources":["../../../lib/helpers/ContentRenderUiHelper.ts"],"names":[],"mappings":";;;AAAA,2CAAuD;AACvD,qDAAgD;AAChD,yDAAmD;AAEnD,MAAa,qBAAsB,SAAQ,+BAAc;IACtC,kBAAkB,CAAU;IAC5B,qBAAq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AK,CAAC,iCAAiC,CAAC,IAAY;QAClD,OAAO,MAAM,IAAA,aAAM,EAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACnE,CAAC;CACF;AAlCD,sDAkCC","sourcesContent":["import {Page, Locator, expect} from \"@playwright/test\";\nimport {UiBaseLocators} from \"./UiBaseLocators\";\nimport {umbracoConfig} from \"../../umbraco.config\";\n\nexport class ContentRenderUiHelper extends UiBaseLocators {\n private readonly contentRenderValue: Locator;\n private readonly dataSourceRenderValue: Locator;\n\n constructor(page: Page) {\n super(page);\n this.contentRenderValue = page.getByTestId('content-render-value');\n this.dataSourceRenderValue = page.getByTestId('data-source-render-value');\n }\n\n async navigateToRenderedContentPage(contentURL: string) {\n await this.page.goto(umbracoConfig.environment.baseUrl + contentURL);\n }\n\n async doesContentRenderValueContainText(text: string, isEqual: boolean = false) {\n if (isEqual) {\n return await expect(this.contentRenderValue).toHaveText(text);\n } else {\n return await expect(this.contentRenderValue).toContainText(text);\n }\n }\n\n async doesContentRenderValueHaveImage(src: string, width: number, height: number) {\n const imageSrc = src + '?width=' + width.toString() + '&height=' + height.toString();\n return await expect(this.contentRenderValue.locator('img')).toHaveAttribute('src', imageSrc);\n }\n\n async doesContentRenderValueHaveLink(linkSrc: string) {\n return await expect(this.contentRenderValue.locator('a')).toHaveAttribute('href', linkSrc);\n }\n\n async doesDataSourceRenderValueHaveText(text: string) {\n return await expect(this.dataSourceRenderValue).toHaveText(text);\n }\n}"]}
|
|
@@ -171,6 +171,8 @@ export declare class ContentUiHelper extends UiBaseLocators {
|
|
|
171
171
|
private readonly refListBlock;
|
|
172
172
|
private readonly propertyActionMenu;
|
|
173
173
|
private readonly listViewCustomRows;
|
|
174
|
+
private readonly collectionMenu;
|
|
175
|
+
private readonly entityPickerTree;
|
|
174
176
|
constructor(page: Page);
|
|
175
177
|
enterContentName(name: string): Promise<void>;
|
|
176
178
|
clickSaveAndPublishButton(): Promise<void>;
|
|
@@ -440,4 +442,7 @@ export declare class ContentUiHelper extends UiBaseLocators {
|
|
|
440
442
|
doesListViewItemsHaveCount(pageSize: number): Promise<void>;
|
|
441
443
|
isListViewItemWithNameVisible(itemName: string, index?: number): Promise<void>;
|
|
442
444
|
clickPaginationNextButton(): Promise<void>;
|
|
445
|
+
chooseCollectionMenuItemWithName(name: string): Promise<void>;
|
|
446
|
+
chooseTreeMenuItemWithName(name: string, parentNames?: string[]): Promise<void>;
|
|
447
|
+
isChooseButtonVisible(isVisible?: boolean): Promise<void>;
|
|
443
448
|
}
|
|
@@ -175,6 +175,8 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
175
175
|
refListBlock;
|
|
176
176
|
propertyActionMenu;
|
|
177
177
|
listViewCustomRows;
|
|
178
|
+
collectionMenu;
|
|
179
|
+
entityPickerTree;
|
|
178
180
|
constructor(page) {
|
|
179
181
|
super(page);
|
|
180
182
|
this.saveContentBtn = page.getByTestId('workspace-action:Umb.WorkspaceAction.Document.Save');
|
|
@@ -357,6 +359,9 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
357
359
|
this.propertyActionMenu = page.locator('#property-action-popover umb-popover-layout');
|
|
358
360
|
// List view custom
|
|
359
361
|
this.listViewCustomRows = page.locator('table tbody tr');
|
|
362
|
+
// Entity Data Picker
|
|
363
|
+
this.collectionMenu = page.locator('umb-collection-menu');
|
|
364
|
+
this.entityPickerTree = page.locator('umb-tree[alias="Umb.Tree.EntityDataPicker"]');
|
|
360
365
|
}
|
|
361
366
|
async enterContentName(name) {
|
|
362
367
|
await (0, test_1.expect)(this.contentNameTxt).toBeVisible();
|
|
@@ -467,25 +472,25 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
467
472
|
await this.addTemplateBtn.click();
|
|
468
473
|
}
|
|
469
474
|
async waitForContentToBeCreated() {
|
|
470
|
-
await this.
|
|
475
|
+
await this.page.waitForLoadState();
|
|
471
476
|
}
|
|
472
477
|
async waitForContentToBeDeleted() {
|
|
473
|
-
await this.
|
|
478
|
+
await this.page.waitForLoadState();
|
|
474
479
|
}
|
|
475
480
|
async waitForContentToBeRenamed() {
|
|
476
|
-
await this.
|
|
481
|
+
await this.page.waitForLoadState();
|
|
477
482
|
}
|
|
478
483
|
async waitForDomainToBeCreated() {
|
|
479
|
-
await this.
|
|
484
|
+
await this.page.waitForLoadState();
|
|
480
485
|
}
|
|
481
486
|
async waitForDomainToBeUpdated() {
|
|
482
|
-
await this.
|
|
487
|
+
await this.page.waitForLoadState();
|
|
483
488
|
}
|
|
484
489
|
async waitForDomainToBeDeleted() {
|
|
485
|
-
await this.
|
|
490
|
+
await this.page.waitForLoadState();
|
|
486
491
|
}
|
|
487
492
|
async waitForContentToBeTrashed() {
|
|
488
|
-
await this.
|
|
493
|
+
await this.page.waitForLoadState();
|
|
489
494
|
}
|
|
490
495
|
async clickDocumentTypeByName(documentTypeName) {
|
|
491
496
|
await this.page.locator('uui-ref-node-document-type[name="' + documentTypeName + '"]').click();
|
|
@@ -1420,10 +1425,10 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
1420
1425
|
await this.page.keyboard.press('Control+A');
|
|
1421
1426
|
}
|
|
1422
1427
|
async waitForContentToBePublished() {
|
|
1423
|
-
await this.
|
|
1428
|
+
await this.page.waitForLoadState();
|
|
1424
1429
|
}
|
|
1425
1430
|
async waitForRecycleBinToBeEmptied() {
|
|
1426
|
-
await this.
|
|
1431
|
+
await this.page.waitForLoadState();
|
|
1427
1432
|
}
|
|
1428
1433
|
async clearTipTapEditor() {
|
|
1429
1434
|
await (0, test_1.expect)(this.tipTapEditor).toBeVisible();
|
|
@@ -1502,6 +1507,23 @@ class ContentUiHelper extends UiBaseLocators_1.UiBaseLocators {
|
|
|
1502
1507
|
await (0, test_1.expect)(this.nextBtn).toBeVisible();
|
|
1503
1508
|
await this.nextBtn.click();
|
|
1504
1509
|
}
|
|
1510
|
+
// Entity Data Picker
|
|
1511
|
+
async chooseCollectionMenuItemWithName(name) {
|
|
1512
|
+
await this.clickChooseButton();
|
|
1513
|
+
await this.collectionMenu.locator('umb-collection-menu-item', { hasText: name }).click();
|
|
1514
|
+
await this.clickChooseContainerButton();
|
|
1515
|
+
}
|
|
1516
|
+
async chooseTreeMenuItemWithName(name, parentNames = []) {
|
|
1517
|
+
await this.clickChooseButton();
|
|
1518
|
+
for (const itemName of parentNames) {
|
|
1519
|
+
await this.entityPickerTree.locator('umb-tree-item').getByLabel('Expand child items for ' + itemName).click();
|
|
1520
|
+
}
|
|
1521
|
+
await this.container.getByLabel(name).click();
|
|
1522
|
+
await this.clickChooseContainerButton();
|
|
1523
|
+
}
|
|
1524
|
+
async isChooseButtonVisible(isVisible = true) {
|
|
1525
|
+
await (0, test_1.expect)(this.chooseBtn).toBeVisible({ visible: isVisible });
|
|
1526
|
+
}
|
|
1505
1527
|
}
|
|
1506
1528
|
exports.ContentUiHelper = ContentUiHelper;
|
|
1507
1529
|
//# sourceMappingURL=ContentUiHelper.js.map
|