From 6e347b47a79aac5e2d2cfe32590efbe48019bcdb Mon Sep 17 00:00:00 2001 From: Selina Breitenbach Date: Tue, 6 Aug 2024 17:04:11 +0200 Subject: [PATCH] test: use data-cy for object identification alias for routes from optimization and remove button that is not useful from test --- cypress/e2e/optimization.cy.js | 17 ++++++++--------- .../components/optimization/Optimization.vue | 2 +- .../OptimizationDetails.vue | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/cypress/e2e/optimization.cy.js b/cypress/e2e/optimization.cy.js index 8b3edd95f..bf8a1a35f 100644 --- a/cypress/e2e/optimization.cy.js +++ b/cypress/e2e/optimization.cy.js @@ -25,19 +25,18 @@ describe('Optimization component', () => { cy.get('.sidebar-content') // shows routes correctly - cy.get('.optimization-routes').should('have.length', 1) - cy.get('.optimization-routes').contains('Distance') - cy.get('.optimization-routes').contains('Duration') - cy.get('.optimization-routes').contains('Service time') - cy.get('.optimization-routes').contains('Deliveries') - cy.get('.optimization-routes').contains('Pickups') + cy.get('[data-cy=optimization-routes]').as('routes') + cy.get('@routes').should('have.length', 1) + cy.get('@routes').contains('Distance') + cy.get('@routes').contains('Duration') + cy.get('@routes').contains('Service time') + cy.get('@routes').contains('Deliveries') + cy.get('@routes').contains('Pickups') cy.get('.route-details').should('have.length', 1) cy.get('.step').should('have.length', 3) // shows buttons - cy.get('.skill-opt-btn') - cy.get('.add-place-btn') - + cy.get('[data-cy="manage-skills"]').should('be.visible') }) it('shows job correctly', () => { diff --git a/src/fragments/forms/map-form/components/optimization/Optimization.vue b/src/fragments/forms/map-form/components/optimization/Optimization.vue index 713916e4c..2ab83f581 100644 --- a/src/fragments/forms/map-form/components/optimization/Optimization.vue +++ b/src/fragments/forms/map-form/components/optimization/Optimization.vue @@ -60,7 +60,7 @@