You are here

private function MediaBrowserContext::openJS in Lightning Media 8.2

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

Opens the media browser when JavaScript is enabled.

Parameters

string $button: (optional) The embed button ID.

1 call to MediaBrowserContext::openJS()
MediaBrowserContext::open in tests/contexts/MediaBrowserContext.behat.inc
Opens the media browser, obviously.

File

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

Class

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

Namespace

Acquia\LightningExtension\Context

Code

private function openJS($button = 'media_browser') {
  $this
    ->getContext(CkEditorContext::class)
    ->execute('editdrupalentity', NULL, [
    'id' => $button,
  ]);
  $frame = $this
    ->awaitElement("iframe[name='entity_browser_iframe_{$button}']", 30)
    ->getAttribute('name');
  $this
    ->getSession()
    ->switchToIFrame($frame);
}