refactor: added Mailosaur to manage sms

This commit is contained in:
2021-09-03 09:29:15 +02:00
parent bc6e1bc12e
commit e2a59a566f
13 changed files with 1021 additions and 7 deletions

View File

@@ -1,24 +1,24 @@
/// <reference types="cypress" />
context('The login page', () => {
describe('Test the login page', () => {
describe.skip('Test the login page', () => {
it('Access the webpage', function() {
cy.visit('/');
cy.visit('/login');
cy.get('#email').should("have.attr", "type", "email");
cy.get('#password').should("have.attr", "type", "password");
//cy.get('#password').type(mdp);
});
it('Log an invalid email', function() {
cy.visit('/');
cy.visit('/login');
cy.get('#email').type("not an email");
cy.get('#password').type("somepasseword {enter}");
cy.url().should('include', 'login?');
});
it('Log an unexisting user', function() {
cy.visit('/');
cy.visit('/login');
cy.get('#email').type("toto@yopmail.com");
cy.get('#password').type("somepasseword {enter}");
cy.get('#error-message').should("have.class", "alert alert-danger").should("be.visible");
@@ -28,9 +28,17 @@ context('The login page', () => {
describe("It send an SMS", function() {
it('Log the candidate user', function(){
cy.visit('/login');
cy.visit('/');
cy.get('#email').type("candidature-qa@example.org");
cy.get('#password').type("kHwWawhH5ADNuFb");
cy.get('#continueButton').click();
cy.mailosaurGetMessage(serverId, {
sentTo: smsNumber
}).as('sms');
cy.get('#challenge_mfa_form_candidate_otp').type('@sms');
cy.get('#validateButton').click();
});
});