From b205b16d80458b4cacda1e6ab45bb0347efc306a Mon Sep 17 00:00:00 2001 From: Andrii Semenets Date: Wed, 24 Jan 2024 18:56:14 +0200 Subject: [PATCH] fix to correctly count and compare elements --- tests/behat/behat_catquiz.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/behat/behat_catquiz.php b/tests/behat/behat_catquiz.php index 091fddfee..ca3aa7253 100644 --- a/tests/behat/behat_catquiz.php +++ b/tests/behat/behat_catquiz.php @@ -55,10 +55,10 @@ public function i_fill_in_the_field_with_dynamic_identifier($numberofitem, $dyna // Assuming you want to find an editor element related to the competency and fill it with the specified value $fields = $this->getSession()->getPage()->findAll('xpath', $xpathtarget); - $counter = 0; + $counter = 1; foreach ($fields as $field) { if ($field->isVisible()) { - if ($counter = $numberofitem) { + if ($counter == (int) $numberofitem) { // Fill in the form field with the specified value. $field->setValue($value); }