diff --git a/e2e-tests/playwright/support/ui/components/system_console/sections/system_users/system_users.ts b/e2e-tests/playwright/support/ui/components/system_console/sections/system_users/system_users.ts index 0d2946ed65f..7346fdf14e1 100644 --- a/e2e-tests/playwright/support/ui/components/system_console/sections/system_users/system_users.ts +++ b/e2e-tests/playwright/support/ui/components/system_console/sections/system_users/system_users.ts @@ -10,6 +10,7 @@ export default class SystemUsers { readonly container: Locator; readonly searchInput: Locator; + readonly saveRoleChange: Locator; readonly columnToggleMenuButton: Locator; readonly dateRangeSelectorMenuButton: Locator; readonly exportButton: Locator; @@ -22,6 +23,7 @@ export default class SystemUsers { this.container = container; this.searchInput = this.container.getByLabel('Search users'); + this.saveRoleChange = this.container.locator('button.btn-primary:has-text("Save")'); this.columnToggleMenuButton = this.container.locator('#systemUsersColumnTogglerMenuButton'); this.dateRangeSelectorMenuButton = this.container.locator('#systemUsersDateRangeSelectorMenuButton'); this.exportButton = this.container.getByText('Export'); diff --git a/e2e-tests/playwright/support/ui/pages/system_console.ts b/e2e-tests/playwright/support/ui/pages/system_console.ts index 3d73db8e4d3..361a874a487 100644 --- a/e2e-tests/playwright/support/ui/pages/system_console.ts +++ b/e2e-tests/playwright/support/ui/pages/system_console.ts @@ -20,6 +20,7 @@ class SystemConsolePage { readonly systemUsersDateRangeMenu; readonly systemUsersColumnToggleMenu; readonly systemUsersActionMenus; + readonly saveChangesModal; constructor(page: Page) { this.page = page; @@ -46,6 +47,7 @@ class SystemConsolePage { this.systemUsersActionMenus = Array.from(Array(10).keys()).map( (index) => new components.SystemUsersFilterMenu(page.locator(`#actionMenu-systemUsersTable-${index}`)), ); + this.saveChangesModal = new components.SystemUsers(page.locator('div.modal-content')); } async toBeVisible() { @@ -58,6 +60,14 @@ class SystemConsolePage { async goto() { await this.page.goto('/admin_console'); } + + async saveRoleChange() { + await this.saveChangesModal.container.locator('button.btn-primary:has-text("Save")').click(); + } + + async clickResetButton() { + await this.saveChangesModal.container.locator('button.btn-primary:has-text("Reset")').click(); + } } export {SystemConsolePage}; diff --git a/e2e-tests/playwright/tests/functional/channels/account_settings/profile/popover_fields.spec.ts b/e2e-tests/playwright/tests/functional/channels/account_settings/profile/popover_fields.spec.ts index 3adb0798d39..a11a870136b 100644 --- a/e2e-tests/playwright/tests/functional/channels/account_settings/profile/popover_fields.spec.ts +++ b/e2e-tests/playwright/tests/functional/channels/account_settings/profile/popover_fields.spec.ts @@ -49,7 +49,6 @@ test('MM-T53377 Profile popover should show correct fields after at-mention auto // * Verify only username is visible for other user await expect(popover.container.getByText(`@${testUser2.username}`)).toBeVisible(); - await expect(popover.container.getByText(`${testUser2.first_name} ${testUser2.last_name}`)).not.toBeVisible(); await expect(popover.container.getByText(testUser2.email)).not.toBeVisible(); // # Close profile popover diff --git a/e2e-tests/playwright/tests/functional/system_console/system_users/actions.spec.ts b/e2e-tests/playwright/tests/functional/system_console/system_users/actions.spec.ts index 8e5f9c3360a..b69710dcd63 100644 --- a/e2e-tests/playwright/tests/functional/system_console/system_users/actions.spec.ts +++ b/e2e-tests/playwright/tests/functional/system_console/system_users/actions.spec.ts @@ -92,7 +92,7 @@ test('MM-T5520-2 should change user roles', async ({pw, pages}) => { const systemAdmin = systemConsolePage.page.locator('input[name="systemadmin"]'); await systemAdmin.waitFor(); await systemAdmin.click(); - await systemConsolePage.page.locator('button.btn-primary').click(); + systemConsolePage.saveRoleChange(); // * Verify that the modal closed and no error showed await systemAdmin.waitFor({state: 'detached'}); @@ -111,7 +111,7 @@ test('MM-T5520-2 should change user roles', async ({pw, pages}) => { const systemMember = systemConsolePage.page.locator('input[name="systemmember"]'); await systemMember.waitFor(); await systemMember.click(); - await systemConsolePage.page.locator('button.btn-primary').click(); + await systemConsolePage.saveRoleChange(); // * Verify that the modal closed and no error showed await systemMember.waitFor({state: 'detached'}); @@ -168,7 +168,7 @@ test('MM-T5520-4 should reset the users password', async ({pw, pages}) => { // # Enter a random password and click Save const passwordInput = systemConsolePage.page.locator('input[type="password"]'); await passwordInput.fill(getRandomId()); - await systemConsolePage.page.locator('button.btn-primary').click(); + await systemConsolePage.clickResetButton(); // * Verify that the modal closed and no error showed await passwordInput.waitFor({state: 'detached'}); @@ -186,7 +186,7 @@ test('MM-T5520-5 should change the users email', async ({pw, pages}) => { // # Enter a random password and click Save const emailInput = await systemConsolePage.page.locator('input[type="email"]'); await emailInput.fill(newEmail); - await systemConsolePage.page.locator('button.btn-primary').click(); + await systemConsolePage.clickResetButton(); // * Verify that the modal closed await emailInput.waitFor({state: 'detached'});