Skip to content

Commit

Permalink
feat: update cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-louis committed Mar 9, 2023
1 parent fc8b5aa commit 13b6d71
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 32 deletions.
4 changes: 2 additions & 2 deletions cypress/e2e/front/login.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ describe('Good front for Login', () => {
});

it('Good number of buttons', () => {
cy.get('button').should('have.length', 2);
cy.get('button').should('have.length', 3);
});

it('Good name for login with credentials button', () => {
cy.get('#ipc-login-credentials-button').should('contain', 'Login with credentials');
});

it('Good name for signup button', () => {
cy.get('#ipc-login-signup-button').should('contain', 'Signup');
cy.get('#ipc-login-signup-button').should('contain', 'Create an account');
});
});

Expand Down
41 changes: 11 additions & 30 deletions cypress/e2e/front/signup.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,31 @@ describe('Good front for Signup', () => {
});

it('Good number of buttons', () => {
cy.get('button').should('have.length', 2);
cy.get('button').should('have.length', 3);
});

it('Good name for signup credentials button', () => {
cy.get('#ipc-signup-credentials-signup-button').should('contain', 'Signup');
cy.get('#ipc-signup-create-copy-mnemonics-button').should('contain', 'Create my account');
});

it('Good name for login button', () => {
cy.get('#ipc-signup-login-button').should('contain', 'Login');
cy.get('#ipc-signup-login-button').should('contain', 'Login with my account');
});
});

describe('Good Modal front for Signup', () => {
it('Go to signup', () => {
cy.visit('/signup');
cy.get('#ipc-signup-credentials-signup-button').click();
it('Good name for copy clipboard button', () => {
cy.get('#ipc-signup-create-copy-mnemonics-button').click().should('contain', 'Copy my mnemonics');
});

it('Good header', () => {
cy.get('header').should('contain', 'Your Mnemonics');
});

it('Good number of buttons', () => {
cy.get('button').should('have.length', 5);
});

it('Good number of text-area', () => {
cy.get('textarea').should('have.length', 1);
});

it('Good name for copy mnemonics button', () => {
cy.get('#ipc-signup-copy-mnemonics-button').should('contain', 'Copy my mnemonics');
});

it('Good name for close button', () => {
cy.get('#ipc-modal-close-button').should('have.length', 1);
});
it('Good name for go to dashboard button', () => {
cy.get('#ipc-signup-go-to-dashboard-button').should('contain', 'Go to my dashboard');
})
});

describe('Signup with credentials Button for Signup', () => {
it('Go to signup', () => {
cy.visit('/signup');
cy.get('#ipc-signup-credentials-signup-button').click();
cy.get('#ipc-signup-copy-mnemonics-button').click();
cy.get('#ipc-signup-create-copy-mnemonics-button').click();
cy.get('#ipc-signup-create-copy-mnemonics-button').click();
});

it('Good copied clipboard', () => {
Expand All @@ -68,7 +49,7 @@ describe('Signup with credentials Button for Signup', () => {
});

it('Good URL redirect for close button', () => {
cy.get('#ipc-modal-close-button').click().url().should('eq', `${Cypress.config().baseUrl}/drive`);
cy.get('#ipc-signup-go-to-dashboard-button').click().url().should('eq', `${Cypress.config().baseUrl}/drive`);
});
});

Expand Down

0 comments on commit 13b6d71

Please sign in to comment.