Skip to content

Commit

Permalink
fix: force click to avoid hidden elements
Browse files Browse the repository at this point in the history
  • Loading branch information
friedjoff committed Mar 18, 2020
1 parent 9a4c68f commit 10edf60
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cypress/integration/projection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('');
Expand All @@ -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');
Expand All @@ -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+\)/);
});
});

0 comments on commit 10edf60

Please sign in to comment.