0
0
Fork 0

refs #6062 test: fixed e2e due to change of style in the indexes

This commit is contained in:
Alex Moreno 2023-12-15 08:16:54 +01:00
parent f5cf47b60d
commit eed3267a11
3 changed files with 17 additions and 21 deletions

View File

@ -6,6 +6,7 @@ describe('WagonCreate', () => {
}); });
it('should create and delete a new wagon', () => { it('should create and delete a new wagon', () => {
cy.waitForElement('.q-card');
cy.get('input').eq(0).type('1234'); cy.get('input').eq(0).type('1234');
cy.get('input').eq(1).type('1234ABCD'); cy.get('input').eq(1).type('1234ABCD');
cy.get('input').eq(2).type('100'); cy.get('input').eq(2).type('100');
@ -16,18 +17,14 @@ describe('WagonCreate', () => {
cy.get('button[type="submit"]').click(); cy.get('button[type="submit"]').click();
// Check data has been saved successfully // Check data has been saved successfully
cy.get('div.text-h6').contains('1234').click(); cy.waitForElement('.q-card');
cy.get('input').eq(0).should('have.value', '1234');
cy.get('input').eq(1).should('have.value', '1234ABCD'); cy.get('.title').should('have.text', '1234');
cy.get('input').eq(2).should('have.value', '100'); cy.get('[title-label="Plate"] > .value > span').should('have.text', '1234ABCD');
cy.get('input').eq(3).should('have.value', 'Wagon Type #1'); cy.get(':nth-child(2) > .value > span').should('have.text', '100');
cy.get(':nth-child(3) > .value > span').should('have.text', 'Wagon Type #1');
// Delete wagon type created // Delete wagon type created
cy.go('back'); cy.get('.actions > .q-btn--standard').click();
cy.get('div.text-h6')
.contains('1234')
.parentsUntil('div.q-card')
.find('div.q-card__actions')
.find('button').last().click();
}); });
}); });

View File

@ -38,7 +38,9 @@ describe('WagonTypeCreate', () => {
cy.get('button[type="submit"]').click(); cy.get('button[type="submit"]').click();
// Check data has been saved successfully // Check data has been saved successfully
cy.get('div.text-h6').contains('Example for testing').click(); cy.get(':nth-child(1) > :nth-child(1) > .justify-between > .flex > .title')
.contains('Example for testing')
.click();
cy.get('input').first().should('have.value', 'Example for testing'); cy.get('input').first().should('have.value', 'Example for testing');
cy.get('div.wagon-tray').should('have.length', 4); cy.get('div.wagon-tray').should('have.length', 4);
cy.get('div.position').eq(0).find('input').should('have.value', '150'); cy.get('div.position').eq(0).find('input').should('have.value', '150');
@ -47,11 +49,8 @@ describe('WagonTypeCreate', () => {
// Delete wagon type created // Delete wagon type created
cy.go('back'); cy.go('back');
cy.get('div.text-h6') cy.get(
.contains('Example for testing') ':nth-child(2) > :nth-child(1) > .card-list-body > .actions > .q-btn--standard'
.parentsUntil('div.q-card') ).click();
.find('div.q-card__actions')
.find('button').last().click();
}); });
}); });

View File

@ -1,6 +1,6 @@
describe('WorkerList', () => { describe('WorkerList', () => {
const workerFieldNames = const workerFieldNames =
'.card-list-body > .list-items > :nth-child(2) > .value > span'; '.card-list-body > .list-items > :nth-child(1) > .value > span';
beforeEach(() => { beforeEach(() => {
cy.viewport(1280, 720); cy.viewport(1280, 720);
cy.login('developer'); cy.login('developer');