diff --git a/cypress/e2e/27-two-factor-authentication.cy.ts b/cypress/e2e/27-two-factor-authentication.cy.ts index 8d710939e..5e9390933 100644 --- a/cypress/e2e/27-two-factor-authentication.cy.ts +++ b/cypress/e2e/27-two-factor-authentication.cy.ts @@ -35,9 +35,10 @@ describe('Two-factor authentication', () => { expect(err.message).to.include('Not logged in'); return false; }); + cy.intercept('GET', '/rest/mfa/qr').as('getMfaQrCode'); }); - it.skip('Should be able to login with MFA token', () => { + it('Should be able to login with MFA token', () => { const { email, password } = user; signinPage.actions.loginWithEmailAndPassword(email, password); personalSettingsPage.actions.enableMfa(); @@ -47,7 +48,7 @@ describe('Two-factor authentication', () => { mainSidebar.actions.signout(); }); - it.skip('Should be able to login with recovery code', () => { + it('Should be able to login with recovery code', () => { const { email, password } = user; signinPage.actions.loginWithEmailAndPassword(email, password); personalSettingsPage.actions.enableMfa(); @@ -56,7 +57,7 @@ describe('Two-factor authentication', () => { mainSidebar.actions.signout(); }); - it.skip('Should be able to disable MFA in account', () => { + it('Should be able to disable MFA in account', () => { const { email, password } = user; signinPage.actions.loginWithEmailAndPassword(email, password); personalSettingsPage.actions.enableMfa(); diff --git a/cypress/pages/settings-personal.ts b/cypress/pages/settings-personal.ts index 06fd218da..79cf58c75 100644 --- a/cypress/pages/settings-personal.ts +++ b/cypress/pages/settings-personal.ts @@ -60,11 +60,14 @@ export class PersonalSettingsPage extends BasePage { enableMfa: () => { cy.visit(this.url); this.getters.enableMfaButton().click(); + cy.wait('@getMfaQrCode'); + mfaSetupModal.getters.copySecretToClipboardButton().should('be.visible'); mfaSetupModal.getters.copySecretToClipboardButton().realClick(); cy.readClipboard().then((secret) => { const token = generateOTPToken(secret); mfaSetupModal.getters.tokenInput().type(token); + mfaSetupModal.getters.downloadRecoveryCodesButton().should('be.visible'); mfaSetupModal.getters.downloadRecoveryCodesButton().click(); mfaSetupModal.getters.saveButton().click(); });