mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Fix ajax loading wait for behat tests
Requires https://github.com/silverstripe/silverstripe-behat-extension/pull/169
This commit is contained in:
parent
f36f085d9f
commit
6853204504
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user