Skip to content

Commit

Permalink
Revert "[Behat] IBX-4482 Fix for toggle button enabled (#786)"
Browse files Browse the repository at this point in the history
This reverts commit 01ea505.
  • Loading branch information
Bogdan Mazur committed May 11, 2023
1 parent ba83879 commit c9c5779
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib/Behat/Component/Fields/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ private function setEnabledField(bool $enabled)
{
$isCurrentlyEnabled = $this->getHTMLPage()->find($this->parentLocator)->find($this->getLocator('buttonEnabled'))->getText() === 'On';
if ($isCurrentlyEnabled !== $enabled) {
$script = sprintf("document.querySelector('%s %s').click()", $this->parentLocator->getSelector(), $this->getLocator('buttonEnabled')->getSelector());
$this->getHTMLPage()->executeJavaScript($script);
$this->getHTMLPage()->find($this->parentLocator)->find($this->getLocator('buttonEnabled'))->click();
$this->getHTMLPage()
->setTimeout(10)
->waitUntilCondition(new ElementExistsCondition($this->getHTMLPage(), $this->getLocator('buttonEnabledToggleConfirmation')));
Expand Down

0 comments on commit c9c5779

Please sign in to comment.