From 7dc019cfbbc24bd51f0e426bb96867f3c35d71d2 Mon Sep 17 00:00:00 2001 From: pablone Date: Fri, 4 Oct 2024 13:13:57 +0200 Subject: [PATCH] fix: refs #4988 selector on e2e --- src/pages/Route/Agency/Card/AgencyWorkcenter.vue | 13 +++++++------ .../route/agency/agencyWorkCenter.spec.js | 16 +++++++--------- test/cypress/integration/route/routeList.spec.js | 2 +- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/pages/Route/Agency/Card/AgencyWorkcenter.vue b/src/pages/Route/Agency/Card/AgencyWorkcenter.vue index 1f3cab5d0..86fb94e0a 100644 --- a/src/pages/Route/Agency/Card/AgencyWorkcenter.vue +++ b/src/pages/Route/Agency/Card/AgencyWorkcenter.vue @@ -46,13 +46,13 @@ async function deleteWorCenter(id) { } diff --git a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js index 6d33dbc39..353c5805b 100644 --- a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js +++ b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js @@ -4,12 +4,12 @@ describe('AgencyWorkCenter', () => { cy.login('developer'); cy.visit(`/#/agency/11/workCenter`); }); + const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon'; + const workCenterCombobox = 'input[role="combobox"]'; it('assign workCenter', () => { - cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); - cy.get( - '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container' - ).type('workCenterOne{enter}'); + cy.get(createButton).click(); + cy.get(workCenterCombobox).type('workCenterOne{enter}'); cy.get('.q-notification__message').should('have.text', 'Data created'); }); @@ -22,12 +22,10 @@ describe('AgencyWorkCenter', () => { }); it('error on duplicate workCenter', () => { - cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); - cy.get( - '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container' - ).type('workCenterOne{enter}'); + cy.get(createButton).click(); + cy.get(workCenterCombobox).type('workCenterOne{enter}'); cy.get('.q-notification__message').should('have.text', 'Data created'); - cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); + cy.get(createButton).click(); cy.get( '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container' ).type('workCenterOne{enter}'); diff --git a/test/cypress/integration/route/routeList.spec.js b/test/cypress/integration/route/routeList.spec.js index c9d7147c2..8020d3ea9 100644 --- a/test/cypress/integration/route/routeList.spec.js +++ b/test/cypress/integration/route/routeList.spec.js @@ -2,7 +2,7 @@ describe('Route', () => { beforeEach(() => { cy.viewport(1920, 1080); cy.login('developer'); - cy.visit(`/#/route/list`); + cy.visit(`/#/route/extended-list`); }); const getVnSelect = '> :nth-child(1) > .column > .q-field > .q-field__inner > .q-field__control > .q-field__control-container';