handleAjaxBeforeStep(). */ protected $ajaxSteps; /** * @var Int Timeout in milliseconds, after which the interface assumes * that an Ajax request has timed out, and continues with assertions. */ protected $ajaxTimeout; /** * @var String Relative URL to the SilverStripe admin interface. */ protected $adminUrl; /** * @var String Relative URL to the SilverStripe login form. */ protected $loginUrl; /** * @var String Relative path to a writeable folder where screenshots can be stored. * If set to NULL, no screenshots will be stored. */ protected $screenshotPath; protected $context; /** * Initializes context. * Every scenario gets it's own context object. * * @param array $parameters context parameters (set them up through behat.yml) */ public function __construct(array $parameters) { // Initialize your context here $this->context = $parameters; } public function setDatabase($databaseName) { $this->databaseName = $databaseName; } public function setAjaxSteps($ajaxSteps) { if($ajaxSteps) $this->ajaxSteps = $ajaxSteps; } public function getAjaxSteps() { return $this->ajaxSteps; } public function setAjaxTimeout($ajaxTimeout) { $this->ajaxTimeout = $ajaxTimeout; } public function getAjaxTimeout() { return $this->ajaxTimeout; } public function setAdminUrl($adminUrl) { $this->adminUrl = $adminUrl; } public function getAdminUrl() { return $this->adminUrl; } public function setLoginUrl($loginUrl) { $this->loginUrl = $loginUrl; } public function getLoginUrl() { return $this->loginUrl; } public function setScreenshotPath($screenshotPath) { $this->screenshotPath = $screenshotPath; } public function getScreenshotPath() { return $this->screenshotPath; } /** * @BeforeScenario */ public function before(ScenarioEvent $event) { if (!isset($this->databaseName)) { throw new \LogicException( 'Context\'s $databaseName has to be set when implementing ' . 'SilverStripeAwareContextInterface.' ); } $url = $this->joinUrlParts($this->getBaseUrl(), '/dev/testsession/start'); $url .= '?' . http_build_query($this->getTestSessionState()); $this->getSession()->visit($url); $page = $this->getSession()->getPage(); $content = $page->getContent(); if(!preg_match('/