You are here

public function MediaBrowserContext::createFromEmbedCode in Lightning Media 8.3

Same name and namespace in other branches
  1. 8.2 tests/contexts/MediaBrowserContext.behat.inc \Acquia\LightningExtension\Context\MediaBrowserContext::createFromEmbedCode()

Creates a media item in the media browser using an embed code.

@When I create media named :title using the embed code :embed_code

Parameters

string $title: The label of the created media item.

string $embed_code: The embed code from which to create the media item.

File

tests/contexts/MediaBrowserContext.behat.inc, line 254

Class

MediaBrowserContext
Contains step definitions for interacting with Lightning's media browser.

Namespace

Acquia\LightningExtension\Context

Code

public function createFromEmbedCode($title, $embed_code) {
  $this
    ->visitPath('/entity-browser/modal/media_browser');
  $page = $this
    ->getSession()
    ->getPage();
  $page
    ->pressButton('Create embed');
  $page
    ->fillField('input', $embed_code);
  $page
    ->pressButton('Update');
  $page
    ->fillField('Name', $title);
  $page
    ->pressButton('Place');
}