UNPKG

@umbraco/playwright-testhelpers

Version:

Test helpers for making playwright tests for Umbraco solutions

51 lines 2.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MediaTypeUiHelper = void 0; const UiBaseLocators_1 = require("./UiBaseLocators"); const test_1 = require("@playwright/test"); class MediaTypeUiHelper extends UiBaseLocators_1.UiBaseLocators { newMediaTypeThreeDotsBtn; mediaEditPropertyWorkspace; mediaTypeBtn; mediaTypesMenu; constructor(page) { super(page); this.newMediaTypeThreeDotsBtn = page.getByLabel('New Media Type…'); this.mediaEditPropertyWorkspace = page.locator('umb-media-type-workspace-view-edit-property'); this.mediaTypeBtn = this.createOptionActionListModal.locator('[name="Media Type"]'); this.mediaTypesMenu = page.locator('#menu-item').getByRole('link', { name: 'Media Types' }); } async clickActionsMenuForMediaType(name) { await this.clickActionsMenuForName(name); } async clickActionsMenuAtRoot() { await this.clickActionsMenuForMediaType("Media Types"); } async clickRootFolderCaretButton() { await this.clickCaretButtonForName("Media Types"); } async clickNewMediaTypeButton() { await this.newMediaTypeThreeDotsBtn.click(); } async goToMediaType(mediaTypeName) { await this.clickRootFolderCaretButton(); await this.clickLabelWithName(mediaTypeName); } async enterMediaTypeName(name) { await this.enterAName.waitFor({ state: 'visible' }); await this.enterAName.fill(name); } async enterDescriptionForPropertyEditorWithName(propertyEditorName, description) { await this.mediaEditPropertyWorkspace.filter({ hasText: propertyEditorName }).getByLabel('description').fill(description); } async clickMediaTypeButton() { await (0, test_1.expect)(this.mediaTypeBtn).toBeVisible(); await this.mediaTypeBtn.click(); } async clickMediaTypesMenu() { await (0, test_1.expect)(this.mediaTypesMenu).toBeVisible(); await this.mediaTypesMenu.click(); } } exports.MediaTypeUiHelper = MediaTypeUiHelper; //# sourceMappingURL=MediaTypeUiHelper.js.map