BUG Fix ajax loading wait for behat tests

Requires https://github.com/silverstripe/silverstripe-behat-extension/pull/169
This commit is contained in:
Damian Mooyman 2017-08-02 10:53:57 +12:00
parent f36f085d9f
commit 6853204504
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A

View File

@ -2,6 +2,8 @@
namespace SilverStripe\Framework\Tests\Behaviour;
use Behat\Behat\Hook\Call\AfterStep;
use Behat\Behat\Hook\Scope\AfterStepScope;
use Behat\Mink\Element\NodeElement;
use Behat\Mink\Session;
use Behat\Behat\Context\Context;
@ -42,10 +44,16 @@ class CmsUiContext implements Context
* Excluding scenarios with @modal tag is required,
* because modal dialogs stop any JS interaction
*
* @AfterStep ~@modal
* @AfterStep
* @param AfterStepScope $event
*/
public function handleCmsLoadingAfterStep(StepEvent $event)
public function handleCmsLoadingAfterStep(AfterStepScope $event)
{
// Manually exclude @modal
if ($this->stepHasTag($event, 'modal')) {
return;
}
$timeoutMs = $this->getMainContext()->getAjaxTimeout();
$this->getSession()->wait(
$timeoutMs,