2024-07-12 08:41:18 +00:00
|
|
|
describe('Route', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.viewport(1920, 1080);
|
|
|
|
cy.login('developer');
|
|
|
|
cy.visit(`/#/route/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})`;
|
2024-07-12 08:41:18 +00:00
|
|
|
|
|
|
|
it('Route list create route', () => {
|
|
|
|
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
|
|
|
|
cy.get('input[name="description"]').eq(1).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', () => {
|
|
|
|
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();
|
|
|
|
cy.get('.q-notification__message').should('have.text', 'Data created');
|
|
|
|
});
|
2024-07-12 08:41:18 +00:00
|
|
|
});
|