From ace7b9dfe1ba95183e3b27368e1407443a42279b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Fri, 5 Mar 2021 22:02:46 +0100 Subject: [PATCH] Find directly the label instead of falling back to it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The input element is always hidden, so the check always ended falling back to the label. Moreover, the label is the element that the user interacts with, so it must be the one used. Signed-off-by: Daniel Calviño Sánchez --- .../acceptance/features/bootstrap/AppSettingsContext.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/acceptance/features/bootstrap/AppSettingsContext.php b/tests/acceptance/features/bootstrap/AppSettingsContext.php index eda9fe200d..c9ff57f376 100644 --- a/tests/acceptance/features/bootstrap/AppSettingsContext.php +++ b/tests/acceptance/features/bootstrap/AppSettingsContext.php @@ -81,14 +81,7 @@ class AppSettingsContext implements Context, ActorAwareInterface { * @Given I toggle the :id checkbox in the settings */ public function iToggleTheCheckboxInTheSettingsTo($id) { - $locator = self::CheckboxInTheSettings($id); - - // If locator is not visible, fallback to label - if (!$this->actor->find(self::CheckboxInTheSettings($id), 10)->isVisible()) { - $locator = self::checkboxLabelInTheSettings($id); - } - - $this->actor->find($locator, 10)->click(); + $this->actor->find(self::checkboxLabelInTheSettings($id), 10)->click(); } /**