UNPKG

@umbraco/playwright-testhelpers

Version:

Test helpers for making playwright tests for Umbraco solutions

59 lines 2.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DocumentBlueprintUiHelper = void 0; const UiBaseLocators_1 = require("./UiBaseLocators"); const ConstantHelper_1 = require("./ConstantHelper"); class DocumentBlueprintUiHelper extends UiBaseLocators_1.UiBaseLocators { documentBlueprintTree; documentBlueprintNameTxt; deleteMenu; constructor(page) { super(page); this.documentBlueprintTree = page.locator('umb-tree[alias="Umb.Tree.DocumentBlueprint"]'); this.documentBlueprintNameTxt = page.locator('#name-input #input'); this.deleteMenu = page.locator('umb-section-sidebar #menu-item').getByLabel('Delete'); } async clickActionsMenuForDocumentBlueprints(name) { await this.clickActionsMenuForName(name); } async clickActionsMenuAtRoot() { await this.clickActionsMenuForDocumentBlueprints('Document Blueprints'); } async clickRootFolderCaretButton() { await this.openCaretButtonForName('Document Blueprints'); } async waitForDocumentBlueprintToBeCreated() { await this.waitForNetworkToBeIdle(); } async waitForDocumentBlueprintToBeDeleted() { await this.waitForNetworkToBeIdle(); } async reloadDocumentBlueprintsTree() { await this.reloadTree('Document Blueprints'); } async goToDocumentBlueprint(blueprintName) { await this.goToSection(ConstantHelper_1.ConstantHelper.sections.settings); await this.reloadDocumentBlueprintsTree(); await this.page.getByLabel(blueprintName, { exact: true }).click(); } async isDocumentBlueprintRootTreeItemVisible(blueprintName, isVisible = true, toReload = true) { if (toReload) { await this.reloadDocumentBlueprintsTree(); } return this.isVisible(this.documentBlueprintTree.getByText(blueprintName, { exact: true }), isVisible); } async clickCreateDocumentBlueprintButton() { await this.createDocumentBlueprintBtn.click(); } async clickCreateNewDocumentBlueprintButton() { await this.createNewDocumentBlueprintBtn.click(); } async enterDocumentBlueprintName(blueprintName) { await this.enterText(this.documentBlueprintNameTxt, blueprintName); } async clickDeleteMenuButton() { await this.deleteMenu.click(); } } exports.DocumentBlueprintUiHelper = DocumentBlueprintUiHelper; //# sourceMappingURL=DocumentBlueprintUiHelper.js.map