refactor: added Mailosaur to manage sms
This commit is contained in:
@@ -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();
|
||||
|
||||
});
|
||||
});
|
||||
|
@@ -23,3 +23,4 @@
|
||||
//
|
||||
// -- This will overwrite an existing command --
|
||||
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
|
||||
import 'cypress-mailosaur';
|
Reference in New Issue
Block a user