From 515e519a01c0f240f427de0fb82909df699efe71 Mon Sep 17 00:00:00 2001 From: Miguel Date: Wed, 20 Apr 2016 13:54:41 +0100 Subject: [PATCH] [Behat] Change 'iShouldSeeActionBarButton' exception for assertion --- Features/Context/SubContext/CommonActions.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Features/Context/SubContext/CommonActions.php b/Features/Context/SubContext/CommonActions.php index da5af807c..e25e1b56f 100644 --- a/Features/Context/SubContext/CommonActions.php +++ b/Features/Context/SubContext/CommonActions.php @@ -321,9 +321,7 @@ private function goToContentWithPath($path) public function iShouldSeeActionBarButton($buttonText) { $element = $this->getElementByText($buttonText, '.ez-actionbar-container .ez-action', '.action-label'); - if (!$element) { - throw new \Exception("Action bar button '$buttonText' not found"); - } + EzAssertion::assertSingleElement($buttonText, $element, null, 'Action bar button'); } /** @@ -334,9 +332,7 @@ public function iShouldSeeActionBarButton($buttonText) public function iShouldNotSeeActionBarButton($buttonText) { $element = $this->getElementByText($buttonText, '.ez-actionbar-container .ez-action', '.action-label'); - if ($element) { - throw new \Exception("Action bar button '$buttonText' was found"); - } + EzAssertion::assertElementNotFound($buttonText, $element, null, 'Action bar button'); } /**