BigPipe
DrevOps\BehatSteps\Steps\Drupal\BigPipeTrait - Source, Example, Helpers
Wait for Drupal BigPipe placeholders to be replaced on JavaScript scenarios.
Drupal BigPipe streams parts of a page in after the initial response and replaces its<span data-big-pipe-placeholder-id="...">markers with the real markup using JavaScript. An assertion that runs before those replacements complete fails intermittently with "element not found".
With this trait included, every@javascriptscenario waits before each step until no BigPipe placeholder marker remains in the DOM. The wait removes the race without an explicit step.
The wait is best-effort: on timeout the step still runs, so a placeholder that is never replaced fails the following assertion rather than the wait.
A browser driver that runs no JavaScript never replaces those placeholders, and does not follow thehttp-equiv=refreshfallback either. An authenticated-user assertion on such a browser driver silently misses the content BigPipe deferred.
A scenario tagged@bigpipeon such a browser driver gets thebig_pipe_nojscookie, so Drupal renders the page in full server-side.
Skip processing with tag:@behat-steps-skip:BigPipeTrait.
Special tags:
@bigpipe- render server-side on a browser driver without JavaScript.Set the
big_pipe.wait_timeoutoption to change the maximum wait, or assign$bigPipeWaitTimeoutto override it for 1 scenario.
Options
| Option | Type | Default | Tag | Description |
|---|---|---|---|---|
big_pipe.enabled | boolean | TRUE | @behat-steps-skip:BigPipeTrait | Wait for BigPipe placeholders to be replaced before each step of a @javascript scenario. |
big_pipe.wait_timeout | integer | 10000 | - | Maximum time, in milliseconds, to wait for BigPipe placeholders to be replaced. |