Merge pull request #7230 from open-sausages/pulls/4.0/fix-behat-wait

BUG Fix ajax loading wait for behat tests
This commit is contained in:
Chris Joe 2017-08-02 12:09:49 +12:00 committed by GitHub
commit 73eb82f2b1
1 changed files with 10 additions and 2 deletions

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,