From ee1f8104a09b2c41dd82c8e75e0671cf947fd012 Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Fri, 5 Mar 2021 22:02:46 +0100 Subject: 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 --- tests/acceptance/features/bootstrap/AppSettingsContext.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/acceptance/features/bootstrap/AppSettingsContext.php b/tests/acceptance/features/bootstrap/AppSettingsContext.php index eda9fe200d0..c9ff57f376c 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(); } /** -- cgit v1.2.3