From 84b36dd5b4d73e1feaf0349622cb24b258352380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Wed, 27 Sep 2023 15:33:16 +0200 Subject: [PATCH] Added missing exception to ElementAssert::isVisible --- src/lib/Browser/Element/Element.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/Browser/Element/Element.php b/src/lib/Browser/Element/Element.php index 30218d5c..419ba505 100644 --- a/src/lib/Browser/Element/Element.php +++ b/src/lib/Browser/Element/Element.php @@ -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 { @@ -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; } }