Skip to content

Instantly share code, notes, and snippets.

@mglaman
Created July 13, 2018 14:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mglaman/47b05ee405de4487d788fcef3e5c8389 to your computer and use it in GitHub Desktop.
Save mglaman/47b05ee405de4487d788fcef3e5c8389 to your computer and use it in GitHub Desktop.
default:
autoload:
- '%paths.base%/tests/features/bootstrap'
suites:
default:
filters:
tags: "~@skip"
failure_path: '%paths.base%/tests/failures'
paths:
features: '%paths.base%/tests/features'
contexts:
- FailureContext
- FeatureContext
# Support BigPipe in Behat - https://github.com/jhedstrom/drupalextension/pull/325
# Modified to not require Drupal driver.
- BigPipeContext
- Drupal\DrupalExtension\Context\DrupalContext
- Drupal\DrupalExtension\Context\MinkContext
- Drupal\DrupalExtension\Context\MessageContext
- Drupal\DrupalExtension\Context\DrushContext
<?php
use Drupal\DrupalExtension\Context\RawDrupalContext;
use Behat\Mink\Exception\UnsupportedDriverActionException;
/**
* Big Pipe context.
*/
class BigPipeContext extends RawDrupalContext {
/**
* Prepares Big Pipe NOJS cookie if needed.
*
* TODO: breaking change, this executes before wdSession connected.
* // @BeforeScenario
*/
public function prepareBigPipeNoJsCookie() {
try {
// Check if JavaScript can be executed by Driver.
$this->getSession()->getDriver()->executeScript('true');
} catch (UnsupportedDriverActionException $e) {
// Set NOJS cookie.
$this->getSession()->setCookie('big_pipe_nojs', TRUE);
} catch (\Exception $e) {
// Mute exceptions.
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment