mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
fix: Flaky mfa e2e tests (no-changelog) (#7192)
Github issue / Community forum post (link here to close automatically):
This commit is contained in:
parent
f4d8c9eed5
commit
ab647b231d
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue