From 9e563ebd3a2cd7aab164184b0d28f25be2d9fbfe Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Tue, 10 Jan 2017 14:39:24 +1300 Subject: [PATCH] API Moved iShouldSeeAButton to behat-extension --- .../Test/Behaviour/CmsFormsContext.php | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php index 0e5845d05..ffcef1d7a 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php @@ -2,15 +2,9 @@ namespace SilverStripe\Framework\Test\Behaviour; -use Behat\Behat\Context\ClosuredContextInterface; -use Behat\Behat\Context\TranslatedContextInterface; use Behat\Behat\Context\BehatContext; -use Behat\Behat\Context\Step; -use Behat\Behat\Exception\PendingException; use Behat\Mink\Exception\ElementHtmlException; -use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode; -use Behat\MinkExtension\Context\MinkContext as MinkContext; use Symfony\Component\DomCrawler\Crawler; use Behat\Mink\Element\NodeElement; use SilverStripe\SiteConfig\SiteConfig; @@ -215,30 +209,6 @@ JS; $this->getSession()->executeScript($js); } - /** - * Example: I should see a "Submit" button - * Example: I should not see a "Delete" button - * - * @Given /^I should( not? |\s*)see a "([^"]*)" button$/ - */ - public function iShouldSeeAButton($negative, $text) - { - $page = $this->getSession()->getPage(); - $els = $page->findAll('named', array('link_or_button', "'$text'")); - $matchedEl = null; - foreach ($els as $el) { - if ($el->isVisible()) { - $matchedEl = $el; - } - } - - if (trim($negative)) { - assertNull($matchedEl, sprintf('%s button found', $text)); - } else { - assertNotNull($matchedEl, sprintf('%s button not found', $text)); - } - } - /** * @Given /^I should( not? |\s*)see a "([^"]*)" field$/ */