diff --git a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php index e24e84451..41f35f62e 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php @@ -74,7 +74,10 @@ class CmsUiContext extends BehatContext protected function getCmsTabsElement() { - $this->getSession()->wait(5000, "window.jQuery('.cms-content-header-tabs').size() > 0"); + $this->getSession()->wait( + 5000, + "window.jQuery && window.jQuery('.cms-content-header-tabs').size() > 0" + ); $page = $this->getSession()->getPage(); $cms_content_header_tabs = $page->find('css', '.cms-content-header-tabs'); @@ -87,7 +90,7 @@ class CmsUiContext extends BehatContext { $this->getSession()->wait( 5000, - "window.jQuery('.cms-content-toolbar').size() > 0 " + "window.jQuery && window.jQuery('.cms-content-toolbar').size() > 0 " . "&& window.jQuery('.cms-content-toolbar').children().size() > 0" ); @@ -100,7 +103,10 @@ class CmsUiContext extends BehatContext protected function getCmsTreeElement() { - $this->getSession()->wait(5000, "window.jQuery('.cms-tree').size() > 0"); + $this->getSession()->wait( + 5000, + "window.jQuery && window.jQuery('.cms-tree').size() > 0" + ); $page = $this->getSession()->getPage(); $cms_tree_element = $page->find('css', '.cms-tree'); @@ -193,7 +199,10 @@ class CmsUiContext extends BehatContext */ public function iClickTheCmsTab($tab) { - $this->getSession()->wait(5000, "window.jQuery('.ui-tabs-nav').size() > 0"); + $this->getSession()->wait( + 5000, + "window.jQuery && window.jQuery('.ui-tabs-nav').size() > 0" + ); $page = $this->getSession()->getPage(); $tabsets = $page->findAll('css', '.ui-tabs-nav'); @@ -407,7 +416,8 @@ class CmsUiContext extends BehatContext // wait for ajax dropdown to load $this->getSession()->wait( 5000, - "jQuery('#" . $container->getAttribute('id') . " .treedropdownfield-panel li').length > 0" + "window.jQuery && " + . "window.jQuery('#" . $container->getAttribute('id') . " .treedropdownfield-panel li').length > 0" ); } else { // wait for dropdown overlay to appear (might be animated)