fix: flaky MM-T5521-8 (#35385)
Some checks are pending
API / build (push) Waiting to run
Server CI / Compute Go Version (push) Waiting to run
Server CI / Check mocks (push) Blocked by required conditions
Server CI / Check go mod tidy (push) Blocked by required conditions
Server CI / check-style (push) Blocked by required conditions
Server CI / Check serialization methods for hot structs (push) Blocked by required conditions
Server CI / Vet API (push) Blocked by required conditions
Server CI / Check migration files (push) Blocked by required conditions
Server CI / Generate email templates (push) Blocked by required conditions
Server CI / Check store layers (push) Blocked by required conditions
Server CI / Check mmctl docs (push) Blocked by required conditions
Server CI / Postgres with binary parameters (push) Blocked by required conditions
Server CI / Postgres (push) Blocked by required conditions
Server CI / Postgres (FIPS) (push) Blocked by required conditions
Server CI / Generate Test Coverage (push) Blocked by required conditions
Server CI / Run mmctl tests (push) Blocked by required conditions
Server CI / Run mmctl tests (FIPS) (push) Blocked by required conditions
Server CI / Build mattermost server app (push) Blocked by required conditions
Web App CI / check-lint (push) Waiting to run
Web App CI / check-i18n (push) Blocked by required conditions
Web App CI / check-types (push) Blocked by required conditions
Web App CI / test (platform) (push) Blocked by required conditions
Web App CI / test (mattermost-redux) (push) Blocked by required conditions
Web App CI / test (channels shard 1/4) (push) Blocked by required conditions
Web App CI / test (channels shard 2/4) (push) Blocked by required conditions
Web App CI / test (channels shard 3/4) (push) Blocked by required conditions
Web App CI / test (channels shard 4/4) (push) Blocked by required conditions
Web App CI / upload-coverage (push) Blocked by required conditions
Web App CI / build (push) Blocked by required conditions

This commit is contained in:
sabril 2026-02-24 11:36:00 +08:00 committed by GitHub
parent 8fd7aea63c
commit 4b8ff4e6a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 42 additions and 12 deletions

View file

@ -50,6 +50,9 @@ export class ColumnToggleMenu {
}
}
type RoleFilter = 'Any' | 'System Admin' | 'Member' | 'Guest';
type StatusFilter = 'Any' | 'Activated users' | 'Deactivated users';
/**
* Filter popover that appears when clicking the Filters button
*/
@ -92,6 +95,22 @@ export class FilterPopover {
await this.container.page().waitForTimeout(500);
}
/**
* Select a team from the dropdown. For "All teams" and "No teams", opens the
* dropdown directly. For specific team names, searches first then selects.
*/
async filterByTeam(team: 'All teams' | 'No teams' | (string & {})) {
if (team === 'All teams' || team === 'No teams') {
await expect(this.teamMenuInput).toBeVisible();
await this.teamMenuInput.click();
} else {
await this.searchInTeamMenu(team);
}
const option = this.container.getByRole('option', {name: team});
await option.waitFor();
await option.click();
}
/**
* Open the role filter menu
*/
@ -100,6 +119,16 @@ export class FilterPopover {
await this.roleMenuButton.click();
}
/**
* Open the role filter menu and select a role option
*/
async filterByRole(role: RoleFilter) {
await this.openRoleMenu();
const option = this.container.getByRole('option', {name: role});
await option.waitFor();
await option.click();
}
/**
* Open the status filter menu
*/
@ -108,6 +137,16 @@ export class FilterPopover {
await this.statusMenuButton.click();
}
/**
* Open the status filter menu and select a status option
*/
async filterByStatus(status: StatusFilter) {
await this.openStatusMenu();
const option = this.container.getByRole('option', {name: status});
await option.waitFor();
await option.click();
}
/**
* Close the popover (if still open)
*/

View file

@ -35,8 +35,7 @@ test('MM-T5521-7 Should be able to filter users with team filter', async ({pw})
const filterPopover = await systemConsolePage.users.openFilterPopover();
// # Enter the team name of the first user and select it
await filterPopover.searchInTeamMenu(team1.display_name);
await filterPopover.teamMenuInput.press('Enter');
await filterPopover.filterByTeam(team1.display_name);
// # Save the filter and close the popover
await filterPopover.save();
@ -79,11 +78,7 @@ test('MM-T5521-8 Should be able to filter users with role filter', async ({pw})
const filterPopover = await systemConsolePage.users.openFilterPopover();
// # Open the role filter in the popover and select Guest
await filterPopover.openRoleMenu();
// Wait for dropdown options and click on Guest
const guestOption = systemConsolePage.page.getByText('Guest', {exact: true});
await guestOption.waitFor();
await guestOption.click();
await filterPopover.filterByRole('Guest');
// # Save the filter and close the popover
await filterPopover.save();
@ -132,11 +127,7 @@ test('MM-T5521-9 Should be able to filter users with status filter', async ({pw}
const filterPopover = await systemConsolePage.users.openFilterPopover();
// # Open the status filter in the popover and select Deactivated users
await filterPopover.openStatusMenu();
// Wait for dropdown options and click on Deactivated users
const deactivatedOption = systemConsolePage.page.getByText('Deactivated users', {exact: true});
await deactivatedOption.waitFor();
await deactivatedOption.click();
await filterPopover.filterByStatus('Deactivated users');
// # Save the filter and close the popover
await filterPopover.save();