refactor(Cypress): Reordered test cases in the feature code file.

This commit is contained in:
Simon Priet 2021-09-08 10:04:37 +02:00
parent 311c69f770
commit facf129f65

View File

@ -1,32 +1,5 @@
/* global Given, When, Then */ /* global Given, When, Then */
import { Given, When, Then, And } from "cypress-cucumber-preprocessor/steps"; import { Given, When, Then, And, Before } from "cypress-cucumber-preprocessor/steps";
describe("Connect to the mailbox", () => {
Given("I log with my credentials", () => {
cy.visit('/');
cy.get('#email').type("candidature-qa@example.org");
cy.get('#password').type("kHwWawhH5ADNuFb");
cy.get('#continueButton').click();
});
And("I receive a code by SMS", () => {
cy.get("#challenge_mfa_form_candidate_otp").should("be.visible");
});
When("I put the code", () => {
cy.wait(20000).then(() => {
cy.get('#validateButton').click();
});
});
Then("I am connected", () => {
cy.get("#account-menu div[title]").should((elm) => {
expect(elm).to.contain("candidature-qa@example.org")
});
});
})
describe("Send a document", () => { describe("Send a document", () => {
@ -55,3 +28,30 @@ describe("Send a document", () => {
}); });
}); });
describe("Connect to the mailbox", () => {
Given("I log with my credentials", () => {
cy.visit('/');
cy.get('#email').type("candidature-qa@example.org");
cy.get('#password').type("kHwWawhH5ADNuFb");
cy.get('#continueButton').click();
});
And("I receive a code by SMS", () => {
cy.get("#challenge_mfa_form_candidate_otp").should("be.visible");
});
When("I put the code", () => {
cy.wait(20000).then(() => {
cy.get('#validateButton').click();
});
});
Then("I am connected", () => {
cy.get("#account-menu div[title]").should((elm) => {
expect(elm).to.contain("candidature-qa@example.org")
});
});
})