salix-front/test/cypress/integration/wagon/wagonCreate.spec.js

43 lines
1.6 KiB
JavaScript
Raw Normal View History

2023-03-22 13:42:29 +00:00
describe('WagonCreate', () => {
beforeEach(() => {
cy.viewport(1280, 720);
cy.login('developer');
cy.visit('/#/wagon/create');
});
it('should create and delete a new wagon', () => {
cy.waitForElement('.q-card');
2023-03-22 13:42:29 +00:00
cy.get('input').eq(0).type('1234');
cy.get('input').eq(1).type('1234ABCD');
cy.get('input').eq(2).type('100');
cy.get('input').eq(3).click();
2024-09-24 07:02:35 +00:00
cy.get('.q-select > .q-field__inner > .q-field__control').type(
'{downarrow}{enter}'
);
2023-03-22 13:42:29 +00:00
// Save
cy.get('button[type="submit"]').click();
2024-09-24 07:35:34 +00:00
// Check data has been saved successfully
cy.waitForElement('.q-card');
cy.get(
'[to="/null/1"] > .q-card > .no-padding > .q-py-none > .cursor-text'
).should('have.text', '1234');
cy.get(
'[to="/null/1"] > .q-card > .no-padding > .q-pr-lg > :nth-child(1) > .vn-label-value > .value > :nth-child(1) > .row > span'
).should('have.text', '1234ABCD');
cy.get(
'[to="/null/1"] > .q-card > .no-padding > .q-pr-lg > :nth-child(2) > .vn-label-value > .value > :nth-child(1) > .row > span'
).should('have.text', '100');
cy.get(
'[to="/null/1"] > .q-card > .no-padding > .q-pr-lg > :nth-child(3) > .vn-label-value > .value > :nth-child(1) > .row > span'
).should('have.text', 'Wagon Type #1');
2023-03-22 13:42:29 +00:00
// Delete wagon type created
2024-09-24 07:02:35 +00:00
cy.get(
'[to="/null/2"] > .q-card > .column > [title="Remove"] > .q-btn__content > .q-icon'
).click();
2023-03-22 13:42:29 +00:00
});
});