mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-12 15:44: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');
|
expect(err.message).to.include('Not logged in');
|
||||||
return false;
|
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;
|
const { email, password } = user;
|
||||||
signinPage.actions.loginWithEmailAndPassword(email, password);
|
signinPage.actions.loginWithEmailAndPassword(email, password);
|
||||||
personalSettingsPage.actions.enableMfa();
|
personalSettingsPage.actions.enableMfa();
|
||||||
|
@ -47,7 +48,7 @@ describe('Two-factor authentication', () => {
|
||||||
mainSidebar.actions.signout();
|
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;
|
const { email, password } = user;
|
||||||
signinPage.actions.loginWithEmailAndPassword(email, password);
|
signinPage.actions.loginWithEmailAndPassword(email, password);
|
||||||
personalSettingsPage.actions.enableMfa();
|
personalSettingsPage.actions.enableMfa();
|
||||||
|
@ -56,7 +57,7 @@ describe('Two-factor authentication', () => {
|
||||||
mainSidebar.actions.signout();
|
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;
|
const { email, password } = user;
|
||||||
signinPage.actions.loginWithEmailAndPassword(email, password);
|
signinPage.actions.loginWithEmailAndPassword(email, password);
|
||||||
personalSettingsPage.actions.enableMfa();
|
personalSettingsPage.actions.enableMfa();
|
||||||
|
|
|
@ -60,11 +60,14 @@ export class PersonalSettingsPage extends BasePage {
|
||||||
enableMfa: () => {
|
enableMfa: () => {
|
||||||
cy.visit(this.url);
|
cy.visit(this.url);
|
||||||
this.getters.enableMfaButton().click();
|
this.getters.enableMfaButton().click();
|
||||||
|
cy.wait('@getMfaQrCode');
|
||||||
|
mfaSetupModal.getters.copySecretToClipboardButton().should('be.visible');
|
||||||
mfaSetupModal.getters.copySecretToClipboardButton().realClick();
|
mfaSetupModal.getters.copySecretToClipboardButton().realClick();
|
||||||
cy.readClipboard().then((secret) => {
|
cy.readClipboard().then((secret) => {
|
||||||
const token = generateOTPToken(secret);
|
const token = generateOTPToken(secret);
|
||||||
|
|
||||||
mfaSetupModal.getters.tokenInput().type(token);
|
mfaSetupModal.getters.tokenInput().type(token);
|
||||||
|
mfaSetupModal.getters.downloadRecoveryCodesButton().should('be.visible');
|
||||||
mfaSetupModal.getters.downloadRecoveryCodesButton().click();
|
mfaSetupModal.getters.downloadRecoveryCodesButton().click();
|
||||||
mfaSetupModal.getters.saveButton().click();
|
mfaSetupModal.getters.saveButton().click();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue