UNPKG

@umbraco/playwright-testhelpers

Version:

Test helpers for making playwright tests for Umbraco solutions

62 lines 2.75 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MemberGroupUiHelper = void 0; 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 this.isVisible(this.memberGroupsTab); await this.page.waitForTimeout(500); await this.memberGroupsTab.click(); await this.isVisible(this.activeMemberGroupsTab); } async clickMemberGroupCreateButton() { await this.createMemberGroupBtn.click(); } async clickMemberGroupsSidebarButton() { await this.click(this.memberGroupsSidebarBtn); } async enterMemberGroupName(name) { await this.enterText(this.memberGroupNameTxt, name); } async clickMemberGroupLinkByName(memberGroupName) { await this.page.getByRole('link', { name: memberGroupName }).click(); } async isMemberGroupNameVisible(memberGroupName, isVisible = true) { return this.isVisible(this.memberGroupView.filter({ hasText: memberGroupName }), isVisible, 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