mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
commit
73eb82f2b1
@ -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