UNPKG

@umbraco/playwright-testhelpers

Version:

Test helpers for making playwright tests for Umbraco solutions

66 lines 3.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MemberGroupUiHelper = void 0; const test_1 = require("@playwright/test"); const UiBaseLocators_1 = require("./UiBaseLocators"); const ConstantHelper_1 = require("./ConstantHelper"); class MemberGroupUiHelper extends UiBaseLocators_1.UiBaseLocators { memberGroupsTab; memberGroupNameTxt; memberGroupView; activeMemberGroupsTab; createMemberGroupBtn; memberGroupsMenu; membersSidebar; memberGroupsSidebarBtn; constructor(page) { super(page); this.memberGroupsTab = page.locator('uui-tab[label="Member Groups"]'); this.memberGroupNameTxt = page.locator('input#input'); this.memberGroupView = page.locator('umb-member-group-table-collection-view'); this.activeMemberGroupsTab = page.locator('uui-tab[label="Member Groups"][active]'); this.createMemberGroupBtn = page.getByTestId('collection-action:Umb.CollectionAction.MemberGroup.Create').getByLabel('Create', { exact: true }); this.memberGroupsMenu = page.locator('umb-menu').getByLabel('Member Groups', { exact: true }); this.membersSidebar = page.getByTestId('section-sidebar:Umb.SectionSidebarApp.Menu.MemberManagement'); this.memberGroupsSidebarBtn = this.membersSidebar.locator('uui-menu-item').filter({ hasText: 'Member Groups' }); } async clickMemberGroupsTab() { await (0, test_1.expect)(this.memberGroupsTab).toBeVisible(); await this.page.waitForTimeout(500); await this.memberGroupsTab.click(); await (0, test_1.expect)(this.activeMemberGroupsTab).toBeVisible(); } async clickMemberGroupCreateButton() { await this.createMemberGroupBtn.click(); } async clickMemberGroupsSidebarButton() { await (0, test_1.expect)(this.memberGroupsSidebarBtn).toBeVisible(); await this.memberGroupsSidebarBtn.click(); } async enterMemberGroupName(name) { await (0, test_1.expect)(this.memberGroupNameTxt).toBeVisible(); await this.memberGroupNameTxt.clear(); await this.memberGroupNameTxt.fill(name); } async clickMemberGroupLinkByName(memberGroupName) { await this.page.getByRole('link', { name: memberGroupName }).click(); } async isMemberGroupNameVisible(memberGroupName, isVisible = true) { return (0, test_1.expect)(this.memberGroupView.filter({ hasText: memberGroupName })).toBeVisible({ visible: isVisible, timeout: 500 }); } async clickMemberGroupsMenu() { await this.memberGroupsMenu.click(); } async waitForMemberGroupToBeCreated() { await this.waitForNetworkToBeIdle(); } async waitForMemberGroupToBeDeleted() { await this.waitForNetworkToBeIdle(); } async goToMemberGroups() { await this.goToSection(ConstantHelper_1.ConstantHelper.sections.members); await this.clickMemberGroupsMenu(); } } exports.MemberGroupUiHelper = MemberGroupUiHelper; //# sourceMappingURL=MemberGroupUiHelper.js.map