diff --git a/e2e-tests/cypress/tests/integration/channels/auth_sso/authentication_4_spec.ts b/e2e-tests/cypress/tests/integration/channels/auth_sso/authentication_4_spec.ts index 51648920ab7..004d1895015 100644 --- a/e2e-tests/cypress/tests/integration/channels/auth_sso/authentication_4_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/auth_sso/authentication_4_spec.ts @@ -151,7 +151,7 @@ describe('Authentication', () => { ['1user', 'te', 'user#1', 'user!1'].forEach((option) => { cy.get('#input_name').clear().type(option); - cy.findByText('Create Account').click(); + cy.findByText('Create account').click(); // * Assert the error is what is expected; cy.get('.Input___error').scrollIntoView().should('be.visible'); @@ -183,7 +183,7 @@ describe('Authentication', () => { cy.get('#input_name').clear().type(`Test${getRandomId()}`); - cy.findByText('Create Account').click(); + cy.findByText('Create account').click(); // * Make sure account was created successfully and we are on the team joining page cy.findByText('Teams you can join:', {timeout: TIMEOUTS.ONE_MIN}).should('be.visible'); @@ -245,7 +245,7 @@ describe('Authentication', () => { cy.get('#input_name').clear().type(`Test${getRandomId()}`); - cy.findByText('Create Account').click(); + cy.findByText('Create account').click(); // * Make sure account was not created successfully cy.get('.AlertBanner__title').scrollIntoView().should('be.visible'); @@ -271,7 +271,7 @@ describe('Authentication', () => { cy.findByText('Copy invite link').click(); // # Input email, select member - cy.findByLabelText('Add or Invite People').type(`test-${getRandomId()}@mattermost.com{downarrow}{downarrow}{enter}`, {force: true}); + cy.findByLabelText('Invite People').type(`test-${getRandomId()}@mattermost.com{downarrow}{downarrow}{enter}`, {force: true}); // # Click invite members button cy.findByRole('button', {name: 'Invite'}).click({force: true}); diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_identification_spec.ts b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_identification_spec.ts index 9db7e20f65e..e9823fd8a18 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_identification_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/guest_identification_spec.ts @@ -78,13 +78,16 @@ describe('Guest Accounts', () => { // # Click "Save". cy.findByText('Save').click().wait(TIMEOUTS.ONE_SEC); - // # Get MFA secret + // # Visit a page to trigger MFA setup redirect, then complete MFA setup for admin + cy.visit('/'); + cy.url().should('include', 'mfa/setup'); cy.uiGetMFASecret(sysadmin.id).then((secret) => { adminMFASecret = secret; }); // # Navigate to Guest Access page. cy.visit('/admin_console/authentication/guest_access'); + cy.url().should('include', '/admin_console/authentication/guest_access'); // # Enable guest accounts. cy.findByTestId('GuestAccountsSettings.Enabletrue').check(); @@ -144,20 +147,20 @@ describe('Guest Accounts', () => { // # Create an account with Email and Password. cy.get('#input_name').type(username); cy.get('#input_password-input').type(username); - cy.findByText('Create Account').click(); + cy.findByText('Create account').click(); // * When MFA is enforced for Guest Access, guest user should be forced to configure MFA while creating an account. cy.url().should('include', 'mfa/setup'); - cy.get('#mfa').wait(TIMEOUTS.HALF_SEC).find('.col-sm-12').then((p) => { + cy.get('#mfa').wait(TIMEOUTS.HALF_SEC).find('p.col-sm-12 span').then((p) => { const secretp = p.text(); const secret = secretp.split(' ')[1]; const token = authenticator.generateToken(secret); - cy.get('#mfa').find('.form-control').type(token); - cy.get('#mfa').find('.btn.btn-primary').click(); + cy.findByPlaceholderText('MFA Code').type(token); + cy.findByText('Save').click(); cy.wait(TIMEOUTS.ONE_SEC); - cy.get('#mfa').find('.btn.btn-primary').click(); + cy.findByText('Okay').click(); }); cy.apiLogout(); }); diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/member_invitation_ui_spec.ts b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/member_invitation_ui_spec.ts index 7fabe813bdd..62e8f1b401b 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/member_invitation_ui_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/member_invitation_ui_spec.ts @@ -106,7 +106,7 @@ describe('Guest Account - Member Invitation Flow', () => { cy.get('#input_email').type(email); cy.get('#input_name').type(username); cy.get('#input_password-input').type('Testing123'); - cy.findByText('Create Account').click(); + cy.findByText('Create account').click(); // * Verify if user is added to the invited team cy.uiGetLHSHeader().findByText(testTeam.display_name); diff --git a/e2e-tests/cypress/tests/integration/channels/onboarding/invalidate_pending_email_invitations_spec.js b/e2e-tests/cypress/tests/integration/channels/onboarding/invalidate_pending_email_invitations_spec.js index 62b82465766..11e8d02dbcb 100644 --- a/e2e-tests/cypress/tests/integration/channels/onboarding/invalidate_pending_email_invitations_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/onboarding/invalidate_pending_email_invitations_spec.js @@ -91,7 +91,7 @@ describe('Onboarding', () => { cy.get('#name').should('be.visible').type(usernameTwo); cy.get('#password').should('be.visible').type(password); - // # Attempt to create an account by clicking on the 'Create Account' button + // # Attempt to create an account by clicking on the 'Create account' button cy.get('#createAccountButton').click(); // * Ensure that since the invite was invalidated, the correct error message should be shown @@ -99,7 +99,7 @@ describe('Onboarding', () => { }); function inviteNewUser(email) { - cy.findByRole('textbox', {name: 'Add or Invite People'}). + cy.findByRole('textbox', {name: 'Invite People'}). typeWithForce(email).wait(TIMEOUTS.HALF_SEC). typeWithForce('{enter}'); cy.findByTestId('inviteButton').click(); diff --git a/e2e-tests/cypress/tests/integration/channels/signin_authentication/signup_spec.js b/e2e-tests/cypress/tests/integration/channels/signin_authentication/signup_spec.js index 71db9fb3fe4..7054d953939 100644 --- a/e2e-tests/cypress/tests/integration/channels/signin_authentication/signup_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/signin_authentication/signup_spec.js @@ -54,11 +54,6 @@ describe('Signup Email page', () => { }); it('should match elements, body', () => { - const { - PRIVACY_POLICY_LINK, - TERMS_OF_SERVICE_LINK, - } = FixedCloudConfig.SupportSettings; - // * Check elements in the body cy.get('.signup-body').should('be.visible'); cy.get('.header-logo-link').should('be.visible'); @@ -78,11 +73,15 @@ describe('Signup Email page', () => { cy.findByText('Your password must be 5-72 characters long.').should('be.visible'); cy.get('#saveSetting').scrollIntoView().should('be.visible'); - cy.get('#saveSetting').should('contain', 'Create Account'); + cy.get('#saveSetting').should('contain', 'Create account'); - cy.get('.signup-body-card-agreement').should('contain', `By proceeding to create your account and use ${config.TeamSettings.SiteName}, you agree to our Terms of Use and Privacy Policy. If you do not agree, you cannot use ${config.TeamSettings.SiteName}.`); - cy.get(`.signup-body-card-agreement > span > [href="${config.SupportSettings.TermsOfServiceLink || TERMS_OF_SERVICE_LINK}"]`).should('be.visible'); - cy.get(`.signup-body-card-agreement > span > [href="${config.SupportSettings.PrivacyPolicyLink || PRIVACY_POLICY_LINK}"]`).should('be.visible'); + // * Check newsletter subscription checkbox text and links + cy.findByText('I would like to receive Mattermost security updates via newsletter.').should('be.visible'); + cy.findByText(/By subscribing, I consent to receive emails from Mattermost with product updates, promotions, and company news\./).should('be.visible'); + cy.findByText(/I have read the/).parent().within(() => { + cy.findByRole('link', {name: 'Privacy Policy'}).should('be.visible').and('have.attr', 'href').and('include', 'mattermost.com/pl/privacy-policy/'); + cy.findByRole('link', {name: 'unsubscribe'}).should('be.visible').and('have.attr', 'href').and('include', 'forms.mattermost.com/UnsubscribePage.html'); + }); }); it('should match elements, footer', () => { diff --git a/e2e-tests/cypress/tests/integration/channels/team_settings/helpers.js b/e2e-tests/cypress/tests/integration/channels/team_settings/helpers.js index fe1435c1cbc..a05e9835358 100644 --- a/e2e-tests/cypress/tests/integration/channels/team_settings/helpers.js +++ b/e2e-tests/cypress/tests/integration/channels/team_settings/helpers.js @@ -36,7 +36,7 @@ export const inviteUserByEmail = (email) => { // # Wait half a second to ensure that the modal has been fully loaded cy.wait(TIMEOUTS.HALF_SEC); - cy.findByRole('textbox', {name: 'Add or Invite People'}). + cy.findByRole('textbox', {name: 'Invite People'}). typeWithForce(email). wait(TIMEOUTS.HALF_SEC). typeWithForce('{enter}'); @@ -71,7 +71,7 @@ export const signupAndVerifyTutorial = (username, password, teamDisplayName) => cy.get('#name', {timeout: TIMEOUTS.HALF_MIN}).should('be.visible').type(username); cy.get('#password').should('be.visible').type(password); - // # Attempt to create an account by clicking on the 'Create Account' button + // # Attempt to create an account by clicking on the 'Create account' button cy.get('#createAccountButton').click(); // # Close the onboarding tutorial diff --git a/e2e-tests/cypress/tests/integration/channels/team_settings/invite_user_to_closed_team_spec.js b/e2e-tests/cypress/tests/integration/channels/team_settings/invite_user_to_closed_team_spec.js index 6e61eae7c3e..b6ae092b585 100644 --- a/e2e-tests/cypress/tests/integration/channels/team_settings/invite_user_to_closed_team_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/team_settings/invite_user_to_closed_team_spec.js @@ -49,11 +49,14 @@ describe('Team Settings', () => { // # Set 'sample.mattermost.com' as the only allowed email domain and save cy.get('#allowedDomains').click().type(emailDomain).type(' '); cy.findByText('Save').should('be.visible').click(); - - // # Close the modal - cy.get('#teamSettingsModalLabel').find('button').should('be.visible').click(); }); + // # Close the modal + cy.findByLabelText('Close').click(); + + // * Wait for modal to be closed + cy.get('#teamSettingsModal').should('not.exist'); + // # Open team menu and click 'Invite People' cy.uiOpenTeamMenu('Invite people'); @@ -63,7 +66,7 @@ describe('Team Settings', () => { // * Assert that the user has successfully been invited to the team cy.get('.invitation-modal-confirm--sent').should('be.visible').within(() => { cy.get('.username-or-icon').find('span').eq(0).should('have.text', userDetailsString); - cy.get('.InviteResultRow').find('div').eq(1).should('have.text', inviteSuccessMessage); + cy.get('.InviteResultRow').find('.reason').should('have.text', inviteSuccessMessage); }); // # Click on the 'Invite More People button' @@ -75,14 +78,14 @@ describe('Team Settings', () => { // * Assert that the invite failed and the correct error message is shown cy.get('.invitation-modal-confirm--not-sent').should('be.visible').within(() => { cy.get('.username-or-icon').find('span').eq(1).should('have.text', invalidEmail); - cy.get('.InviteResultRow').find('div').eq(1).should('have.text', inviteFailedMessage); + cy.get('.InviteResultRow').find('.reason').should('have.text', inviteFailedMessage); }); }); function inviteNewMemberToTeam(email) { cy.wait(TIMEOUTS.HALF_SEC); - cy.findByRole('combobox', {name: 'Add or Invite People'}). + cy.findByRole('combobox', {name: 'Invite People'}). typeWithForce(email). wait(TIMEOUTS.HALF_SEC). typeWithForce('{enter}'); diff --git a/e2e-tests/playwright/lib/src/ui/pages/signup.ts b/e2e-tests/playwright/lib/src/ui/pages/signup.ts index cb43497b3b5..240bbcbfe20 100644 --- a/e2e-tests/playwright/lib/src/ui/pages/signup.ts +++ b/e2e-tests/playwright/lib/src/ui/pages/signup.ts @@ -41,7 +41,7 @@ export default class SignupPage { this.usernameInput = page.locator('#input_name'); this.passwordInput = page.locator('#input_password-input'); this.passwordToggleButton = page.locator('#password_toggle'); - this.createAccountButton = page.locator('button:has-text("Create Account")'); + this.createAccountButton = page.locator('button:has-text("Create account")'); this.emailError = page.locator('text=Please enter a valid email address'); this.usernameError = page.locator( 'text=Usernames have to begin with a lowercase letter and be 3-22 characters long. You can use lowercase letters, numbers, periods, dashes, and underscores.', diff --git a/e2e-tests/playwright/specs/functional/system_console/permissions/team_access.spec.ts b/e2e-tests/playwright/specs/functional/system_console/permissions/team_access.spec.ts index 9addfa88c11..aeaeedffdd6 100644 --- a/e2e-tests/playwright/specs/functional/system_console/permissions/team_access.spec.ts +++ b/e2e-tests/playwright/specs/functional/system_console/permissions/team_access.spec.ts @@ -173,5 +173,12 @@ test('MM-63378 System Manager without team access permissions cannot view team d await expect(teamStatsHeading).toBeVisible(); // Verify the user has no API access to the otherTeam. - await expect(systemManagerClient.getTeam(otherTeam.id)).rejects.toThrow(); + let apiError: Error | null = null; + try { + await systemManagerClient.getTeam(otherTeam.id); + } catch (error) { + apiError = error as Error; + } + expect(apiError).not.toBeNull(); + expect(apiError?.message).toContain('You do not have the appropriate permissions'); });