From b43813d3b3e78262abdedac5562722a5937d2348 Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 17 Feb 2025 11:27:31 +0100 Subject: [PATCH] refactor: refs #8484 clean up test files by removing commented issue references and updating test cases --- .../integration/claim/claimDevelopment.spec.js | 1 - .../integration/claim/claimPhoto.spec.js | 18 +++++++++--------- .../invoiceIn/invoiceInList.spec.js | 2 +- test/cypress/integration/item/itemList.spec.js | 4 ++-- test/cypress/integration/item/itemTag.spec.js | 2 +- .../ticket/ticketExpedition.spec.js | 1 - .../integration/ticket/ticketSale.spec.js | 2 +- .../worker/workerNotificationsManager.spec.js | 4 ++-- test/cypress/support/commands.js | 10 +++------- 9 files changed, 19 insertions(+), 25 deletions(-) diff --git a/test/cypress/integration/claim/claimDevelopment.spec.js b/test/cypress/integration/claim/claimDevelopment.spec.js index 0dfc03866..7ca6472af 100755 --- a/test/cypress/integration/claim/claimDevelopment.spec.js +++ b/test/cypress/integration/claim/claimDevelopment.spec.js @@ -35,7 +35,6 @@ describe('ClaimDevelopment', () => { cy.saveCard(); }); - // TODO: #8112 it('should add and remove new line', () => { cy.wait(['@workers', '@workers']); cy.addCard(); diff --git a/test/cypress/integration/claim/claimPhoto.spec.js b/test/cypress/integration/claim/claimPhoto.spec.js index a79c36f12..97f6255af 100755 --- a/test/cypress/integration/claim/claimPhoto.spec.js +++ b/test/cypress/integration/claim/claimPhoto.spec.js @@ -1,5 +1,5 @@ /// -// redmine.verdnatura.es/issues/8417 + describe('ClaimPhoto', () => { beforeEach(() => { const claimId = 1; @@ -24,36 +24,36 @@ describe('ClaimPhoto', () => { it('should open first image dialog change to second and close', () => { cy.get( - ':nth-child(1) > .q-card > .q-img > .q-img__container > .q-img__image' + ':nth-child(1) > .q-card > .q-img > .q-img__container > .q-img__image', ).click(); cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should( - 'be.visible' + 'be.visible', ); cy.get('.q-carousel__control > .q-btn > .q-btn__content > .q-icon').click(); cy.get( - '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon' + '.q-dialog__inner > .q-toolbar > .q-btn > .q-btn__content > .q-icon', ).click(); cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should( - 'not.be.visible' + 'not.be.visible', ); }); it('should remove third and fourth file', () => { cy.get( - '.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon' + '.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon', ).click(); cy.get( - '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block' + '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block', ).click(); cy.get('.q-notification__message').should('have.text', 'Data deleted'); cy.get( - '.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon' + '.multimediaParent > :nth-child(3) > .q-btn > .q-btn__content > .q-icon', ).click(); cy.get( - '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block' + '.q-card__actions > .q-btn--unelevated > .q-btn__content > .block', ).click(); cy.get('.q-notification__message').should('have.text', 'Data deleted'); }); diff --git a/test/cypress/integration/invoiceIn/invoiceInList.spec.js b/test/cypress/integration/invoiceIn/invoiceInList.spec.js index aa9af5120..d9ab3f7e7 100644 --- a/test/cypress/integration/invoiceIn/invoiceInList.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInList.spec.js @@ -21,7 +21,7 @@ describe('InvoiceInList', () => { cy.url().should('include', `/invoice-in/${id}/summary`); }); }); - // https://redmine.verdnatura.es/issues/8420 + it('should open the details', () => { cy.get(firstDetailBtn).click(); cy.get(summaryHeaders).eq(1).contains('Basic data'); diff --git a/test/cypress/integration/item/itemList.spec.js b/test/cypress/integration/item/itemList.spec.js index c15d84057..f5c34db9f 100644 --- a/test/cypress/integration/item/itemList.spec.js +++ b/test/cypress/integration/item/itemList.spec.js @@ -15,7 +15,7 @@ describe('Item list', () => { cy.get('.q-menu .q-item').contains('Anthurium').click(); cy.get('.q-virtual-scroll__content > :nth-child(4) > :nth-child(4)').click(); }); - // https://redmine.verdnatura.es/issues/8421 + it('should create an item', () => { const data = { Description: { val: `Test item` }, @@ -29,7 +29,7 @@ describe('Item list', () => { cy.dataCy('FormModelPopup_save').click(); cy.checkNotification('Data created'); cy.get( - ':nth-child(2) > .q-drawer > .q-drawer__content > .q-scrollarea > .q-scrollarea__container > .q-scrollarea__content' + ':nth-child(2) > .q-drawer > .q-drawer__content > .q-scrollarea > .q-scrollarea__container > .q-scrollarea__content', ).should('be.visible'); }); }); diff --git a/test/cypress/integration/item/itemTag.spec.js b/test/cypress/integration/item/itemTag.spec.js index 600794747..d1596f693 100644 --- a/test/cypress/integration/item/itemTag.spec.js +++ b/test/cypress/integration/item/itemTag.spec.js @@ -17,7 +17,7 @@ describe('Item tag', () => { cy.checkNotification("The tag or priority can't be repeated for an item"); }); - 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(); diff --git a/test/cypress/integration/ticket/ticketExpedition.spec.js b/test/cypress/integration/ticket/ticketExpedition.spec.js index 4c556c8bd..6d7dc6721 100644 --- a/test/cypress/integration/ticket/ticketExpedition.spec.js +++ b/test/cypress/integration/ticket/ticketExpedition.spec.js @@ -1,5 +1,4 @@ /// -// https://redmine.verdnatura.es/issues/8423 describe('Ticket expedtion', () => { const tableContent = '.q-table .q-virtual-scroll__content'; const stateTd = 'td:nth-child(9)'; diff --git a/test/cypress/integration/ticket/ticketSale.spec.js b/test/cypress/integration/ticket/ticketSale.spec.js index e256058ca..aed8dc85a 100644 --- a/test/cypress/integration/ticket/ticketSale.spec.js +++ b/test/cypress/integration/ticket/ticketSale.spec.js @@ -14,7 +14,7 @@ describe('TicketSale', () => { cy.get(firstRow).find('.q-checkbox__inner').click(); }; - it.skip('it should add item to basket', () => { + it('it should add item to basket', () => { cy.window().then((win) => { cy.stub(win, 'open').as('windowOpen'); }); diff --git a/test/cypress/integration/worker/workerNotificationsManager.spec.js b/test/cypress/integration/worker/workerNotificationsManager.spec.js index 31293095e..ad48d8a6c 100644 --- a/test/cypress/integration/worker/workerNotificationsManager.spec.js +++ b/test/cypress/integration/worker/workerNotificationsManager.spec.js @@ -18,11 +18,11 @@ describe('WorkerNotificationsManager', () => { cy.visit(`/#/worker/${salesPersonId}/notifications`); cy.get(firstAvailableNotification).click(); cy.checkNotification( - 'The notification subscription of this worker cant be modified' + 'The notification subscription of this worker cant be modified', ); }); - it.skip('should active a notification that is yours', () => { + it('should active a notification that is yours', () => { cy.login('developer'); cy.visit(`/#/worker/${developerId}/notifications`); cy.waitForElement(activeList); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index ffd967b13..94b1a18af 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -58,16 +58,13 @@ Cypress.Commands.add('login', (user = 'developer') => { }); Cypress.Commands.add('domContentLoad', (timeout = 5000) => { - cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete'), { - timeout, - interval: 5000, - }); + cy.waitUntil(() => cy.document().then((doc) => doc.readyState === 'complete')); }); Cypress.Commands.overwrite('visit', (originalFn, url, options) => { originalFn(url, options); cy.domContentLoad(); - }); +}); Cypress.Commands.add('waitForElement', (element, timeout = 5000) => { cy.get(element, { timeout }).should('be.visible').and('not.be.disabled'); @@ -400,8 +397,7 @@ Cypress.Commands.add('clickButtonWithText', (buttonText) => { cy.get('.q-btn').contains(buttonText).click(); }); - Cypress.Commands.overwrite('visit', (originalFn, url, options) => { originalFn(url, options); cy.get('main', { timeout: 10000 }).should('exist'); -}); \ No newline at end of file +});