Skip to content

Commit

Permalink
Added missing exception to ElementAssert::isVisible
Browse files Browse the repository at this point in the history
  • Loading branch information
mnocon committed Oct 5, 2023
1 parent c4ea70e commit 84b36dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/Browser/Element/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

use Behat\Mink\Element\NodeElement;
use Behat\Mink\Session;
use Facebook\WebDriver\Exception\NoSuchElementException;
use Facebook\WebDriver\Exception\StaleElementReferenceException;
use Ibexa\Behat\Browser\Assert\ElementAssert;
use Ibexa\Behat\Browser\Assert\ElementAssertInterface;
use Ibexa\Behat\Browser\Element\Factory\ElementFactoryInterface;
use Ibexa\Behat\Browser\Locator\LocatorInterface;
use Webdriver\Exception\NoSuchElement;
use WebDriver\Exception\StaleElementReference;

final class Element extends BaseElement implements ElementInterface
{
Expand All @@ -33,9 +33,9 @@ public function isVisible(): bool
{
try {
return $this->decoratedElement->isVisible();
} catch (StaleElementReference $e) {
} catch (NoSuchElementException $element) {
return false;
} catch (NoSuchElement $element) {
} catch (StaleElementReferenceException $e) {
return false;
}
}
Expand Down

0 comments on commit 84b36dd

Please sign in to comment.