1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-16 16:13:20 +01:00
invoiceninja/cypress/integration/client_portal/login.spec.js
Benjamin Beganović 703ef51685
Client portal tests (using Cypress.io) (#3758)
* Install Cypress

* Fix npm vulnerabilities

* scaffold cypress

* ignore local tests

* login page test

* invoices tests

* recurring invoices

* payments tests

* payment methods tests

* update invoices & quotes

* credits tests
2020-05-27 07:45:29 +10:00

49 lines
1.6 KiB
JavaScript
Vendored

context('Login', () => {
beforeEach(() => {
cy.visit('/client/login');
});
it('should type into login form elements', () => {
cy.get('#test_email')
.invoke('val')
.then(emailValue => {
cy.get('#email')
.type(emailValue)
.should('have.value', emailValue);
});
cy.get('#test_password')
.invoke('val')
.then(passwordValue => {
cy.get('#password')
.type(passwordValue)
.should('have.value', passwordValue);
});
});
it('should login into client portal', () => {
cy.get('#test_email')
.invoke('val')
.then(emailValue => {
cy.get('#test_password')
.invoke('val')
.then(passwordValue => {
cy.get('#email')
.type(emailValue)
.should('have.value', emailValue);
cy.get('#password')
.type(passwordValue)
.should('have.value', passwordValue);
cy.get('#loginBtn')
.contains('Login')
.click();
cy.location().should(location => {
expect(location.pathname).to.eq(
'/client/dashboard'
);
});
});
});
});
});