Skip to content

Commit

Permalink
LPD-41022 Functional Test
Browse files Browse the repository at this point in the history
  • Loading branch information
brianikim authored and brianchandotcom committed Nov 11, 2024
1 parent 8f3a787 commit 273cbe3
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import {FrameLocator, Locator, Page} from '@playwright/test';

import {clickAndExpectToBeVisible} from '../../utils/clickAndExpectToBeVisible';
import {ApplicationsMenuPage} from '../product-navigation-applications-menu/ApplicationsMenuPage';

export const searchTableRowByValue = async function (
Expand Down Expand Up @@ -100,6 +101,9 @@ export class UsersAndOrganizationsPage {
) => Promise<Locator>;
readonly page: Page;
readonly pageTitle: Locator;
readonly selectAllUsersCheckBox: Locator;
readonly tableFilterMenu: Locator;
readonly tableFilterMenuItem: (option: string) => Locator;
readonly tableOrderMenu: Locator;
readonly tableOrderLastLoginDateItem: Locator;
readonly usersTableRow: (
Expand Down Expand Up @@ -349,6 +353,24 @@ export class UsersAndOrganizationsPage {
strictEqual
);
};
this.selectAllUsersCheckBox = page
.locator('.management-bar')
.getByLabel('Select All Users on the Page');
this.tableFilterMenu = page
.locator('.management-bar')
.getByLabel('Filter');
this.tableFilterMenuItem = (option: string) => {
if (option === 'all') {
return page
.locator('.dropdown-menu')
.getByRole('menuitem', {name: option})
.first();
}

return page
.locator('.dropdown-menu')
.getByRole('menuitem', {name: option});
};
this.tableOrderMenu = page
.locator('.management-bar')
.getByLabel('Order');
Expand Down Expand Up @@ -448,6 +470,21 @@ export class UsersAndOrganizationsPage {
]);
}

async filterUsers(option: string) {
await Promise.all([
clickAndExpectToBeVisible({
autoClick: true,
target: this.tableFilterMenuItem(option),
trigger: this.tableFilterMenu,
}),
this.page.waitForResponse(
(resp) =>
resp.status() === 200 &&
resp.url().includes('navigation=' + option)
),
]);
}

async openOptionsMenu() {
await this.optionsMenu
.and(this.page.locator('[aria-haspopup]'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,19 @@ test('LPD-29981 Check custom field is escaped', async ({

expect(customFieldDropDownOptions).toBeTruthy();
});

test('LPD-41022 Check toolbar select is not visible at all', async ({
usersAndOrganizationsPage,
}) => {
await usersAndOrganizationsPage.goToUsers();

await expect(
usersAndOrganizationsPage.selectAllUsersCheckBox
).toBeVisible();

await usersAndOrganizationsPage.filterUsers('all');

await expect(
usersAndOrganizationsPage.selectAllUsersCheckBox
).not.toBeVisible();
});

0 comments on commit 273cbe3

Please sign in to comment.