From 1e16e3312e3e22d0c6170195acd9c3e4670e5b5a Mon Sep 17 00:00:00 2001 From: jorgep Date: Mon, 28 Oct 2024 16:21:00 +0100 Subject: [PATCH] fix: refs #8078 improve cy command --- src/components/ui/CardDescriptor.vue | 1 + test/cypress/integration/ticket/ticketDescriptor.spec.js | 4 ++++ test/cypress/support/commands.js | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index 7f35f0a28..83af77442 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -167,6 +167,7 @@ const toModule = computed(() => icon="more_vert" round size="md" + data-cy="descriptor-more-opts" > {{ t('components.cardDescriptor.moreOptions') }} diff --git a/test/cypress/integration/ticket/ticketDescriptor.spec.js b/test/cypress/integration/ticket/ticketDescriptor.spec.js index 0ba2723a2..cd9f288f5 100644 --- a/test/cypress/integration/ticket/ticketDescriptor.spec.js +++ b/test/cypress/integration/ticket/ticketDescriptor.spec.js @@ -14,6 +14,8 @@ describe('Ticket descriptor', () => { it('should clone the ticket without warehouse', () => { cy.visit('/#/ticket/1/summary'); + cy.intercept('GET', /\/api\/Tickets\/\d/).as('ticket'); + cy.wait('@ticket'); cy.openActionsDescriptor(); cy.contains(listItem, toCloneOpt).click(); cy.clickConfirm(); @@ -28,6 +30,8 @@ describe('Ticket descriptor', () => { it('should set the weight of the ticket', () => { cy.visit('/#/ticket/10/summary'); + cy.intercept('GET', /\/api\/Tickets\/\d/).as('ticket'); + cy.wait('@ticket'); cy.openActionsDescriptor(); cy.contains(listItem, setWeightOpt).click(); cy.intercept('POST', /\/api\/Tickets\/\d+\/setWeight/).as('weight'); diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 76bdefd27..1e9ca93b5 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -261,7 +261,7 @@ Cypress.Commands.add('openActionDescriptor', (opt) => { }); Cypress.Commands.add('openActionsDescriptor', () => { - cy.get('.header > :nth-child(3) > .q-btn__content > .q-icon').click(); + cy.get('[data-cy="descriptor-more-opts"]').click(); }); Cypress.Commands.add('openUserPanel', () => {