You are here

private function EntityBrowserContext::openJS in Lightning Media 8.2

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

Opens an entity browser using JavaScript.

Parameters

string $id: The entity browser ID.

1 call to EntityBrowserContext::openJS()
EntityBrowserContext::open in tests/contexts/EntityBrowserContext.behat.inc
Opens an entity browser.

File

tests/contexts/EntityBrowserContext.behat.inc, line 179

Class

EntityBrowserContext
Contains step definitions for interacting with entity browser instances.

Namespace

Acquia\LightningExtension\Context

Code

private function openJS($id) {
  $settings = $this
    ->getEntityBrowserSettings($id);
  $this
    ->assertSession()
    ->elementExists('css', '.entity-browser-handle[data-uuid="' . $settings['uuid'] . '"]')
    ->click();
  $frame = "window.entity_browser_iframe_{$id}";
  $this
    ->awaitExpression($frame);
  $this
    ->awaitExpression("{$frame}.document.readyState === 'complete'");
}