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', () => {
|
2023-12-15 07:16:54 +00:00
|
|
|
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();
|
|
|
|
cy.get('div[role="listbox"]').find('div.q-item').click();
|
|
|
|
|
|
|
|
// Save
|
|
|
|
cy.get('button[type="submit"]').click();
|
|
|
|
|
|
|
|
// Check data has been saved successfully
|
2023-12-15 07:16:54 +00:00
|
|
|
cy.waitForElement('.q-card');
|
|
|
|
|
|
|
|
cy.get('.title').should('have.text', '1234');
|
|
|
|
cy.get('[title-label="Plate"] > .value > span').should('have.text', '1234ABCD');
|
|
|
|
cy.get(':nth-child(2) > .value > span').should('have.text', '100');
|
|
|
|
cy.get(':nth-child(3) > .value > span').should('have.text', 'Wagon Type #1');
|
2023-03-22 13:42:29 +00:00
|
|
|
|
|
|
|
// Delete wagon type created
|
2023-12-15 07:16:54 +00:00
|
|
|
cy.get('.actions > .q-btn--standard').click();
|
2023-03-22 13:42:29 +00:00
|
|
|
});
|
|
|
|
});
|