salix-front/test/cypress/integration/route/routeList.spec.js

33 lines
1.4 KiB
JavaScript
Raw Normal View History

describe('Route', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
2024-10-04 11:13:57 +00:00
cy.visit(`/#/route/extended-list`);
});
2024-07-22 11:19:41 +00:00
const getVnSelect =
'> :nth-child(1) > .column > .q-field > .q-field__inner > .q-field__control > .q-field__control-container';
const getRowColumn = (row, column) => `:nth-child(${row}) > :nth-child(${column})`;
it('Route list create route', () => {
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
2024-08-20 06:22:20 +00:00
cy.get('input[name="description"]').type('routeTestOne{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
cy.url().should('include', '/summary');
});
2024-07-22 11:19:41 +00:00
it('Route list search and edit', () => {
2024-08-20 06:22:20 +00:00
cy.get('#searchbar input').type('{enter}');
2024-07-22 11:19:41 +00:00
cy.get('input[name="description"]').type('routeTestOne{enter}');
cy.get('.q-table tr')
.its('length')
.then((rowCount) => {
expect(rowCount).to.be.greaterThan(0);
});
cy.get(getRowColumn(1, 3) + getVnSelect).type('{downArrow}{enter}');
cy.get(getRowColumn(1, 4) + getVnSelect).type('{downArrow}{enter}');
cy.get(getRowColumn(1, 5) + getVnSelect).type('{downArrow}{enter}');
cy.get('button[title="Save"]').click();
2024-07-25 12:31:31 +00:00
cy.get('.q-notification__message').should('have.text', 'Data saved');
2024-07-22 11:19:41 +00:00
});
});