BUG Fix error when modals are displayed

This commit is contained in:
Damian Mooyman 2016-04-22 10:27:55 +12:00
parent 0a3e39b96c
commit fa5b8b8fb1

View File

@ -2,16 +2,12 @@
namespace SilverStripe\Framework\Test\Behaviour; namespace SilverStripe\Framework\Test\Behaviour;
use Behat\Behat\Context\ClosuredContextInterface, use Behat\Behat\Context\BehatContext,
Behat\Behat\Context\TranslatedContextInterface,
Behat\Behat\Context\BehatContext,
Behat\Behat\Context\Step, Behat\Behat\Context\Step,
Behat\Behat\Event\StepEvent, Behat\Behat\Event\StepEvent,
Behat\Behat\Exception\PendingException, Behat\Mink\Element\NodeElement,
Behat\Mink\Exception\ElementNotFoundException, Behat\Mink\Session,
Behat\Gherkin\Node\PyStringNode, WebDriver\Exception\UnexpectedAlertOpen;
Behat\Gherkin\Node\TableNode,
Behat\Mink\Element\NodeElement;
// PHPUnit // PHPUnit
@ -39,6 +35,8 @@ class CmsUiContext extends BehatContext {
/** /**
* Get Mink session from MinkContext * Get Mink session from MinkContext
*
* @return Session
*/ */
public function getSession($name = null) { public function getSession($name = null) {
return $this->getMainContext()->getSession($name); return $this->getMainContext()->getSession($name);
@ -54,7 +52,10 @@ class CmsUiContext extends BehatContext {
* Every step could cause the CMS to be loaded, and we don't know if we're in the * Every step could cause the CMS to be loaded, and we don't know if we're in the
* CMS UI until we run a check. * CMS UI until we run a check.
* *
* @AfterStep * Excluding scenarios with @modal tag is required,
* because modal dialogs stop any JS interaction
*
* @AfterStep ~@modal
*/ */
public function handleCmsLoadingAfterStep(StepEvent $event) { public function handleCmsLoadingAfterStep(StepEvent $event) {
$timeoutMs = $this->getMainContext()->getAjaxTimeout(); $timeoutMs = $this->getMainContext()->getAjaxTimeout();