snapshot of https://github.com/mattermost/mattermost.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
Server CI Nightly Race / Build Environment (push) Failing after 1s
Some checks failed
Server CI / Postgres (shard 0) (push) Has been skipped
Server CI / Postgres (shard 3) (push) Has been skipped
BuildEnv Docker Image / build-image (push) Failing after 4s
BuildEnv Docker Image / build-image-fips (push) Failing after 4s
Migration Review & Release Notes / Generate migration review & release notes (push) Failing after 3s
Server CI / Build Environment (push) Failing after 3s
Server CI / Postgres (shard 1) (push) Has been skipped
Tools CI / check-style (mattermost-govet) (push) Failing after 4s
Server CI / Postgres (shard 2) (push) Has been skipped
Tools CI / check-style (mmgotool) (push) Failing after 3s
Server CI / Elasticsearch v8 Compatibility (push) Has been skipped
Server CI / OpenSearch v2 Compatibility (push) Has been skipped
Server CI / Postgres FIPS (shard 0) (push) Has been skipped
Tools CI / Test (mattermost-govet) (push) Failing after 3s
Server CI / Postgres FIPS (shard 1) (push) Has been skipped
Server CI / Postgres FIPS (shard 2) (push) Has been skipped
Tools CI / Test (mmgotool) (push) Failing after 3s
Server CI / Postgres FIPS (shard 3) (push) Has been skipped
Server CI / Run mmctl tests (push) Has been skipped
Server CI / Run mmctl tests (FIPS) (push) Has been skipped
Server CI / Merge Postgres Test Results (push) Has been skipped
Server CI / Merge Postgres FIPS Test Results (push) Has been skipped
Server CI / Check backport migrations (push) Has been skipped
Server CI / Check generated files (push) Has been skipped
Server CI / check-style (push) Has been skipped
Server CI / Vet API (push) Has been skipped
Server CI / Build mattermost server app (push) Has been skipped
Server CI / Server CI Complete (push) Failing after 2s
Server CI / Server CI Artifacts (push) Has been skipped
Server CI / Sentry Upload (push) Has been skipped
Server CI / Server CI Report (push) Failing after 5m1s
Server CI Nightly Race / Race Detector (push) Has been skipped
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Webapp CI Cache Warm / Warm Webapp node_modules Cache (push) Has been cancelled
E2E CI Cache Warm / Warm E2E npm Registry Cache (push) Has been cancelled
API / build (push) Has been cancelled
Web App CI / check-types (push) Has been cancelled
Web App CI / check-lint (push) Has been cancelled
Web App CI / check-i18n (push) Has been cancelled
Web App CI / check-external-links (push) Has been cancelled
Web App CI / test (platform) (push) Has been cancelled
Web App CI / test (mattermost-redux) (push) Has been cancelled
Web App CI / test (channels shard 1/4) (push) Has been cancelled
Web App CI / test (channels shard 2/4) (push) Has been cancelled
Web App CI / test (channels shard 3/4) (push) Has been cancelled
Web App CI / test (channels shard 4/4) (push) Has been cancelled
Web App CI / upload-coverage (push) Has been cancelled
Web App CI / build (push) Has been cancelled
YAML Lint / yamllint (push) Has been cancelled
Push mirrored docker images / cd/Push mirrored docker images (push) Has been cancelled
docs-cd / Build and deploy docs (push) Has been cancelled
Docs CI / build (push) Has been cancelled
E2E Cache Warm: Cypress deps / Warm Cypress deps cache (push) Has been cancelled
Scorecards supply-chain security / Scorecard analysis (push) Has been cancelled
Server CI Weekly / Postgres FIPS (push) Has been skipped
Server CI Weekly / Run mmctl tests (FIPS) (push) Has been skipped
Server CI Weekly / Postgres with binary parameters (push) Has been skipped
Server CI Weekly / Build Environment (push) Failing after 1s
Server CI Cache Warm / Warm Go Module and Build Cache (push) Failing after 2s
Server CI Nightly Race / Build Environment (push) Failing after 1s
This commit is contained in:
@@ -0,0 +1,186 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {type PlaywrightExtended, expect, test} from '@mattermost/playwright-lib';
|
||||
|
||||
test('MM-T5520-1 should activate and deactivate users', async ({pw}) => {
|
||||
const {getUser, systemConsolePage} = await setupAndGetRandomUser(pw);
|
||||
|
||||
const userRow = systemConsolePage.users.usersTable.getRowByIndex(0);
|
||||
|
||||
// # Open menu and deactivate the user
|
||||
const actionMenu = await userRow.openActionMenu();
|
||||
await actionMenu.clickDeactivate();
|
||||
|
||||
// # Press confirm on the modal
|
||||
await systemConsolePage.users.confirmModal.confirm();
|
||||
|
||||
// * Verify user is deactivated
|
||||
await expect(userRow.container.getByText('Deactivated')).toBeVisible();
|
||||
expect((await getUser()).delete_at).toBeGreaterThan(0);
|
||||
|
||||
// # Open menu and reactivate the user
|
||||
const actionMenu2 = await userRow.openActionMenu();
|
||||
await actionMenu2.clickActivate();
|
||||
|
||||
// * Verify user is activated
|
||||
await expect(userRow.container.getByText('Member')).toBeVisible();
|
||||
});
|
||||
|
||||
test('MM-T5520-2 should change user roles', async ({pw}) => {
|
||||
const {getUser, systemConsolePage} = await setupAndGetRandomUser(pw);
|
||||
|
||||
const userRow = systemConsolePage.users.usersTable.getRowByIndex(0);
|
||||
|
||||
// # Open menu and click Manage roles
|
||||
const actionMenu = await userRow.openActionMenu();
|
||||
await actionMenu.clickManageRoles();
|
||||
|
||||
// # Change to System Admin and click Save
|
||||
const systemAdmin = systemConsolePage.page.locator('input[name="systemadmin"]');
|
||||
await systemAdmin.waitFor();
|
||||
await systemAdmin.click();
|
||||
await systemConsolePage.users.manageRolesModal.save();
|
||||
|
||||
// * Verify that the role was updated
|
||||
await expect(userRow.container.getByText('System Admin')).toBeVisible();
|
||||
expect((await getUser()).roles).toContain('system_admin');
|
||||
|
||||
// # Open menu and click Manage roles
|
||||
const actionMenu2 = await userRow.openActionMenu();
|
||||
await actionMenu2.clickManageRoles();
|
||||
|
||||
// # Change to Member and click Save
|
||||
const systemMember = systemConsolePage.page.locator('input[name="systemmember"]');
|
||||
await systemMember.waitFor();
|
||||
await systemMember.click();
|
||||
await systemConsolePage.users.manageRolesModal.save();
|
||||
|
||||
// * Verify that the role was updated
|
||||
await expect(userRow.container.getByText('Member')).toBeVisible();
|
||||
expect((await getUser()).roles).toContain('system_user');
|
||||
});
|
||||
|
||||
test('MM-T5520-3 should be able to manage teams', async ({pw}) => {
|
||||
const {systemConsolePage} = await setupAndGetRandomUser(pw);
|
||||
const {page} = systemConsolePage;
|
||||
|
||||
const userRow = systemConsolePage.users.usersTable.getRowByIndex(0);
|
||||
|
||||
// # Open menu and click Manage teams
|
||||
const actionMenu = await userRow.openActionMenu();
|
||||
await actionMenu.clickManageTeams();
|
||||
|
||||
// The role dropdown renders its menu in a portal (MUI Popover), so the menu
|
||||
// items live at the page level rather than inside the team row.
|
||||
const team = page.locator('div.manage-teams__team');
|
||||
|
||||
// # Open the role dropdown and click Make Team Admin
|
||||
await team.getByRole('button', {name: 'Team Member'}).click();
|
||||
await page.getByRole('menuitem', {name: 'Make Team Admin'}).click();
|
||||
|
||||
// * Verify role is updated
|
||||
await expect(team.getByText('Team Admin')).toBeVisible();
|
||||
|
||||
// # Change back to Team Member
|
||||
await team.getByRole('button', {name: 'Team Admin'}).click();
|
||||
await page.getByRole('menuitem', {name: 'Make Team Member'}).click();
|
||||
|
||||
// * Verify role is updated
|
||||
await expect(team.getByText('Team Member')).toBeVisible();
|
||||
|
||||
// # Click Remove from Team
|
||||
await team.getByRole('button', {name: 'Team Member'}).click();
|
||||
await page.getByRole('menuitem', {name: 'Remove from Team'}).click();
|
||||
|
||||
// * The team should be detached
|
||||
await team.waitFor({state: 'detached'});
|
||||
await expect(team).not.toBeVisible();
|
||||
});
|
||||
|
||||
test('MM-T5520-4 should reset the users password', async ({pw}) => {
|
||||
const {systemConsolePage} = await setupAndGetRandomUser(pw);
|
||||
|
||||
const userRow = systemConsolePage.users.usersTable.getRowByIndex(0);
|
||||
|
||||
// # Open menu and click Reset Password
|
||||
const actionMenu = await userRow.openActionMenu();
|
||||
await actionMenu.clickResetPassword();
|
||||
|
||||
// # Enter a random password and click Reset
|
||||
await systemConsolePage.users.resetPasswordModal.fillPassword(pw.newTestPassword());
|
||||
await systemConsolePage.users.resetPasswordModal.reset();
|
||||
});
|
||||
|
||||
test('MM-T5520-5 should change the users email', async ({pw}) => {
|
||||
const {getUser, systemConsolePage} = await setupAndGetRandomUser(pw);
|
||||
const newEmail = `${pw.random.id()}@example.com`;
|
||||
|
||||
const userRow = systemConsolePage.users.usersTable.getRowByIndex(0);
|
||||
|
||||
// # Open menu and click Update Email
|
||||
const actionMenu = await userRow.openActionMenu();
|
||||
await actionMenu.clickUpdateEmail();
|
||||
|
||||
// # Enter new email and click Update
|
||||
await systemConsolePage.users.updateEmailModal.fillEmail(newEmail);
|
||||
await systemConsolePage.users.updateEmailModal.update();
|
||||
|
||||
// * Verify that the email updated
|
||||
await expect(userRow.container.getByText(newEmail)).toBeVisible();
|
||||
expect((await getUser()).email).toEqual(newEmail);
|
||||
});
|
||||
|
||||
test('MM-T5520-6 should revoke sessions', async ({pw}) => {
|
||||
const {systemConsolePage} = await setupAndGetRandomUser(pw);
|
||||
|
||||
const userRow = systemConsolePage.users.usersTable.getRowByIndex(0);
|
||||
|
||||
// # Open menu and revoke sessions
|
||||
const actionMenu = await userRow.openActionMenu();
|
||||
await actionMenu.clickRevokeSessions();
|
||||
|
||||
// # Press confirm on the modal
|
||||
await systemConsolePage.users.confirmModal.confirm();
|
||||
|
||||
// * Verify no error is displayed
|
||||
await expect(userRow.container.locator('.error')).not.toBeVisible();
|
||||
});
|
||||
|
||||
/**
|
||||
* Setup a new random user, and search for it such that it's the first row in the list
|
||||
* @param pw
|
||||
* @returns A function to get the refreshed user, and the System Console page for navigation
|
||||
*/
|
||||
async function setupAndGetRandomUser(pw: PlaywrightExtended) {
|
||||
const {adminUser, adminClient} = await pw.initSetup();
|
||||
|
||||
if (!adminUser) {
|
||||
throw new Error('Failed to create admin user');
|
||||
}
|
||||
|
||||
// # Log in as admin
|
||||
const {systemConsolePage} = await pw.testBrowser.login(adminUser);
|
||||
|
||||
// # Create a random user to edit
|
||||
const user = await adminClient.createUser(await pw.random.user(), '', '');
|
||||
const team = await adminClient.createTeam(await pw.random.team());
|
||||
await adminClient.addToTeam(team.id, user.id);
|
||||
|
||||
// # Visit system console
|
||||
await systemConsolePage.goto();
|
||||
await systemConsolePage.toBeVisible();
|
||||
|
||||
// # Go to Users section
|
||||
await systemConsolePage.sidebar.users.click();
|
||||
await systemConsolePage.users.toBeVisible();
|
||||
|
||||
// # Search for the user
|
||||
await systemConsolePage.users.searchUsers(user.email);
|
||||
|
||||
// Wait for search results
|
||||
const userRow = systemConsolePage.users.usersTable.getRowByIndex(0);
|
||||
await expect(userRow.container.getByText(user.email)).toBeVisible();
|
||||
|
||||
return {getUser: () => adminClient.getUser(user.id), systemConsolePage};
|
||||
}
|
||||
Reference in New Issue
Block a user