You are here

private function EntityBrowserContext::openJs in Lightning Media 8.3

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

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}";
  $session = $this
    ->getSession();
  Assert::true($session
    ->wait(10000, $frame));
  Assert::true($session
    ->wait(10000, "{$frame}.document.readyState === 'complete'"));
}