You are here

private function MediaBrowserContext::openJs in Lightning Media 8.3

Same name and namespace in other branches
  1. 8.2 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.

string $browser: (optional) The entity browser 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 76

Class

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

Namespace

Acquia\LightningExtension\Context

Code

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