From cf1b30cc4c4bf15537741588f2af956b53ea007c Mon Sep 17 00:00:00 2001 From: Valtteri Kantanen Date: Mon, 9 Sep 2024 10:05:42 +0300 Subject: [PATCH] [Custom population] Fix tests --- cypress/e2e/Custom_population.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)) }