public function MediaEntityContext::embedEntity in Lightning Media 8.3
Embeds a media item with a set of embedding options.
@When I embed the media item with options:
Parameters
\Behat\Gherkin\Node\TableNode $options: The embedding options. Only the first row of the table is used.
File
- tests/
contexts/ MediaEntityContext.behat.inc, line 208
Class
- MediaEntityContext
- Contains step definitions for interacting with media entities.
Namespace
Acquia\LightningExtension\ContextCode
public function embedEntity(TableNode $options) {
$assert_session = $this
->assertSession();
$options = $options
->getHash();
$form = $assert_session
->elementExists('css', '.entity-embed-dialog');
foreach (current($options) as $field => $value) {
$form
->fillField($field, $value);
}
$assert_session
->elementExists('css', 'body > .ui-dialog .ui-dialog-buttonpane button.button--primary')
->click();
$this
->awaitAjax();
}