From b8ffc8c26c835fe337e9a4d13bbb52c30c937842 Mon Sep 17 00:00:00 2001 From: provira Date: Tue, 28 Jan 2025 12:39:28 +0100 Subject: [PATCH 1/2] fix: refs #8422 fixed ItemTag e2e test not working --- test/cypress/integration/item/itemTag.spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/cypress/integration/item/itemTag.spec.js b/test/cypress/integration/item/itemTag.spec.js index 28e0a747f..cc3814e1d 100644 --- a/test/cypress/integration/item/itemTag.spec.js +++ b/test/cypress/integration/item/itemTag.spec.js @@ -18,20 +18,20 @@ describe('Item tag', () => { +cy.dataCy('crudModelDefaultSaveBtn').click(); cy.checkNotification("The tag or priority can't be repeated for an item"); }); - // https://redmine.verdnatura.es/issues/8422 - it.skip('should add a new tag', () => { + + it('should add a new tag', () => { cy.get('.q-page').should('be.visible'); cy.get('.q-page-sticky > div').click(); cy.get('.q-page-sticky > div').click(); cy.dataCy('Tag_select').eq(7).click(); - cy.get('.q-menu .q-item').contains('Ancho de la base').click(); + cy.get('.q-menu .q-item').contains('Ancho de la base').type('{enter}'); cy.get( ':nth-child(8) > [label="Value"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Value_input"]' ).type('50'); cy.dataCy('crudModelDefaultSaveBtn').click(); cy.checkNotification('Data saved'); cy.get( - '[data-cy="itemTags"] > :nth-child(7) > .justify-center > .q-icon' + '[data-cy="itemTags"] > :nth-child(8) > .justify-center > .q-icon' ).click(); cy.dataCy('VnConfirm_confirm').click(); cy.checkNotification('Data saved'); From 2f80bc90af2112904781008ba04183a87972a7b4 Mon Sep 17 00:00:00 2001 From: provira Date: Fri, 31 Jan 2025 07:52:09 +0100 Subject: [PATCH 2/2] fix: refs #8422 optimized get and dataCy --- test/cypress/integration/item/itemTag.spec.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/test/cypress/integration/item/itemTag.spec.js b/test/cypress/integration/item/itemTag.spec.js index cc3814e1d..10d68d08a 100644 --- a/test/cypress/integration/item/itemTag.spec.js +++ b/test/cypress/integration/item/itemTag.spec.js @@ -12,9 +12,7 @@ describe('Item tag', () => { cy.get('.q-page-sticky > div').click(); cy.dataCy('Tag_select').eq(7).type('Tallos'); cy.get('.q-menu .q-item').contains('Tallos').click(); - cy.get( - ':nth-child(8) > [label="Value"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Value_input"]' - ).type('1'); + cy.get(':nth-child(8) > [label="Value"]').type('1'); +cy.dataCy('crudModelDefaultSaveBtn').click(); cy.checkNotification("The tag or priority can't be repeated for an item"); }); @@ -25,15 +23,11 @@ describe('Item tag', () => { cy.get('.q-page-sticky > div').click(); cy.dataCy('Tag_select').eq(7).click(); cy.get('.q-menu .q-item').contains('Ancho de la base').type('{enter}'); - cy.get( - ':nth-child(8) > [label="Value"] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="Value_input"]' - ).type('50'); + cy.get(':nth-child(8) > [label="Value"]').type('50'); cy.dataCy('crudModelDefaultSaveBtn').click(); cy.checkNotification('Data saved'); - cy.get( - '[data-cy="itemTags"] > :nth-child(8) > .justify-center > .q-icon' - ).click(); + cy.dataCy('itemTags').children(':nth-child(8)').find('.justify-center > .q-icon').click(); cy.dataCy('VnConfirm_confirm').click(); cy.checkNotification('Data saved'); }); -}); +}); \ No newline at end of file