Skip to content

Commit

Permalink
Find directly the label instead of falling back to it
Browse files Browse the repository at this point in the history
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 <danxuliu@gmail.com>
  • Loading branch information
danxuliu authored and backportbot[bot] committed Mar 8, 2021
1 parent f92a216 commit ace7b9d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions tests/acceptance/features/bootstrap/AppSettingsContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,7 @@ public function iOpenTheSettings() {
* @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();
}

/**
Expand Down

0 comments on commit ace7b9d

Please sign in to comment.