Skip to content

Commit

Permalink
fix(e2eTests): wait before clicking select element in tracker form
Browse files Browse the repository at this point in the history
  • Loading branch information
Clm-Roig committed Jun 27, 2022
1 parent 64f3a4b commit bf5e9e5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cypress/e2e/trackers/trackerForm.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ context('Trackers', () => {
cy.get('#duration').type(complexTracker.duration);
// MUI select are not <select>, see https://stackoverflow.com/questions/65363508/how-to-trigger-material-ui-select-in-cypress
cy.get('#frequency').parent().click();
cy.get('ul > li[data-value="' + complexTracker.frequency + '"]').click({ multiple: true });
cy.get('ul > li[data-value="' + complexTracker.frequency + '"]').as('valueToSelect');
cy.get('@valueToSelect').click({ multiple: true });

// Fill Completions
for (const [i, completion] of complexTracker.requiredCompletions.entries()) {
Expand All @@ -80,7 +81,8 @@ context('Trackers', () => {
cy.get('#default-completion-unit-' + i)
.parent()
.click();
cy.get('ul > li[data-value="' + completion.unit + '"]').click({ multiple: true });
cy.get('ul > li[data-value="' + completion.unit + '"]').as('valueToSelect');
cy.get('@valueToSelect').click({ multiple: true });
}
cy.get('button').contains('Réalisation par défaut').should('be.disabled');
cy.get('button').contains('Créer').click();
Expand Down

0 comments on commit bf5e9e5

Please sign in to comment.