public function MediaBrowserContext::embed in Lightning Media 8
Same name and namespace in other branches
- 8.2 tests/contexts/MediaBrowserContext.behat.inc \Acquia\LightningExtension\Context\MediaBrowserContext::embed()
- 8.3 tests/contexts/MediaBrowserContext.behat.inc \Acquia\LightningExtension\Context\MediaBrowserContext::embed()
Enters an embed code in the media browser.
@When I enter embed code :code
Parameters
string $code: The embed code.
File
- tests/
contexts/ MediaBrowserContext.behat.inc, line 98
Class
- MediaBrowserContext
- Contains step definitions for interacting with Lightning's media browser.
Namespace
Acquia\LightningExtension\ContextCode
public function embed($code) {
// Activate the 'Create embed' tab. We cannot use the link text because it
// may change between versions of Lightning (as in commit 48fa57e), but the
// UUID won't.
$this
->assertSession()
->elementExists('css', 'nav.eb-tabs ul li a[data-button-id="edit-tab-selector-8b142f33-59d1-47b1-9e3a-4ae85d8376fa"]')
->click();
$this
->getContext(MinkContext::class)
->fillField('input', $code);
// The change event, which triggers AJAX, is fired automatically after 600
// milliseconds.
sleep(1);
$this
->awaitAjax();
$this
->awaitExpression('jQuery("#entity").children().length');
}