diff --git a/cypress/e2e/Custom_population.js b/cypress/e2e/Custom_population.js index 061dd08acf..752ddfea58 100644 --- a/cypress/e2e/Custom_population.js +++ b/cypress/e2e/Custom_population.js @@ -64,7 +64,11 @@ const containsAmountOfStudents = (amount = 0) => { } const containsSpecificStudents = (studentnumbers = []) => { - cy.contains(`Students (${studentnumbers.length})`).click() + cy.contains(`Students (${studentnumbers.length})`) + .parent() + .then($parentDiv => { + if (!$parentDiv.hasClass('active')) cy.contains(`Students (${studentnumbers.length})`).click() + }) studentnumbers.forEach(s => cy.contains(s)) }