From 10edf60bd8f2a5fdc5e53eaa933b4deb23c67549 Mon Sep 17 00:00:00 2001 From: Friedjoff Trautwein Date: Wed, 18 Mar 2020 08:49:22 +0100 Subject: [PATCH] fix: force click to avoid hidden elements --- cypress/integration/projection.spec.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/integration/projection.spec.js b/cypress/integration/projection.spec.js index dcdb9565..44505da6 100644 --- a/cypress/integration/projection.spec.js +++ b/cypress/integration/projection.spec.js @@ -21,11 +21,11 @@ describe('Projection mode', () => { }); describe('Projection in form mode', () => { - const selectField = (name, item) => { + const selectField = (name, item, force) => { cy.get(`[data-cypress=projectionForm${name}]`) .scrollIntoView() - .click(); - cy.get(`[data-cypress=projectionForm${name}] ${item}`).click(); + .click({ force }); + cy.get(`[data-cypress=projectionForm${name}] ${item}`).click({ force }); }; beforeEach(() => { cy.visit(''); @@ -38,7 +38,7 @@ describe('Projection in form mode', () => { selectField('ForestEcoregion', '.item:first-child'); selectField('AltitudinalZone', '.item:last-child'); selectField('ForestType', '.item:first-child'); - selectField('TargetAltitudinalZone', '.item:first-child'); + selectField('TargetAltitudinalZone', '.item:first-child', true); cy.get('[data-cypress=recommendationPane]') .scrollIntoView() .should('be.visible'); @@ -50,8 +50,8 @@ describe('Projection in form mode', () => { selectField('ForestType', '.item:first-child'); cy.get(`[data-cypress=projectionFormTransition] .ui:last-child`).click(); selectField('TransitionForestType', '.item:first-child'); - selectField('TransitionAltitudinalZone', '.item:last-child'); - selectField('TargetAltitudinalZone', '.item:first-child'); + selectField('TransitionAltitudinalZone', '.item:last-child', true); + selectField('TargetAltitudinalZone', '.item:first-child', true); cy.get('[data-cypress=projectionResultMenuItem]').contains(/\w+\s\(\w+\)/); }); });