refactor(Cypress): installed cypress-cucumber-preprocessor and writed a feature file and it's cycode
This commit is contained in:
57
cypress/integration/inbox/inbox.js
Normal file
57
cypress/integration/inbox/inbox.js
Normal file
@@ -0,0 +1,57 @@
|
||||
/* global Given, When, Then */
|
||||
import { Given, When, Then, And } 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", () => {
|
||||
|
||||
Given("I am connected to my mailbox", () => {
|
||||
cy.visit('/');
|
||||
cy.get('#email').type("candidature-qa@example.org");
|
||||
cy.get('#password').type("kHwWawhH5ADNuFb");
|
||||
cy.get('#continueButton').click();
|
||||
cy.wait(20000).then(() => {
|
||||
cy.get('#validateButton').click();
|
||||
});
|
||||
cy.visit("/request");
|
||||
|
||||
})
|
||||
|
||||
And("I have a document ready to send", () => {
|
||||
cy.get("#dashboard-dropzone tr:first-child td").eq(1).click();
|
||||
});
|
||||
|
||||
When("I send the mail", () => {
|
||||
cy.get("#sending-button").click();
|
||||
});
|
||||
|
||||
Then("The mail is sent", () => {
|
||||
//?
|
||||
});
|
||||
|
||||
});
|
Reference in New Issue
Block a user