UNPKG

@umbraco/playwright-testhelpers

Version:

Test helpers for making playwright tests for Umbraco solutions

58 lines 2.51 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DocumentBlueprintUiHelper = void 0; const test_1 = require("@playwright/test"); 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 (0, test_1.expect)(this.documentBlueprintTree.getByText(blueprintName, { exact: true })).toBeVisible({ visible: isVisible }); } async clickCreateDocumentBlueprintButton() { await this.createDocumentBlueprintBtn.click(); } async enterDocumentBlueprintName(blueprintName) { await (0, test_1.expect)(this.documentBlueprintNameTxt).toBeVisible(); await this.documentBlueprintNameTxt.fill(blueprintName); } async clickDeleteMenuButton() { await this.deleteMenu.click(); } } exports.DocumentBlueprintUiHelper = DocumentBlueprintUiHelper; //# sourceMappingURL=DocumentBlueprintUiHelper.js.map