fix (test): run invalid login test before successful test

This commit is contained in:
Shivam Mishra 2020-05-12 19:14:30 +05:30
parent 502fb92904
commit f2cd5f6911

View file

@ -21,15 +21,6 @@ context('Login', () => {
cy.location('pathname').should('eq', '/login');
});
it('logs in using correct credentials', () => {
cy.get('#login_email').type('Administrator');
cy.get('#login_password').type(Cypress.config('adminPassword'));
cy.get('.btn-login').click();
cy.location('pathname').should('eq', '/desk');
cy.window().its('frappe.session.user').should('eq', 'Administrator');
});
it('shows invalid login if incorrect credentials', () => {
cy.get('#login_email').type('Administrator');
cy.get('#login_password').type('qwer');
@ -38,4 +29,13 @@ context('Login', () => {
cy.get('.page-card-head').contains('Invalid Login. Try again.');
cy.location('pathname').should('eq', '/login');
});
it('logs in using correct credentials', () => {
cy.get('#login_email').type('Administrator');
cy.get('#login_password').type(Cypress.config('adminPassword'));
cy.get('.btn-login').click();
cy.location('pathname').should('eq', '/desk');
cy.window().its('frappe.session.user').should('eq', 'Administrator');
});
});