You are here

private function EntityEmbedTrait::submitEmbedForm in Lightning Media 8.3

Same name and namespace in other branches
  1. 8.4 tests/src/Traits/EntityEmbedTrait.php \Drupal\Tests\lightning_media\Traits\EntityEmbedTrait::submitEmbedForm()

Presses the "Embed" button in the embed form, then waits for it to vanish.

2 calls to EntityEmbedTrait::submitEmbedForm()
CKEditorMediaBrowserTest::testEditEmbed in tests/src/FunctionalJavascript/CKEditorMediaBrowserTest.php
Tests that the entity embed dialog opens when editing a pre-existing embed.
EmbeddedMediaTest::testEmbedImageMedia in tests/src/FunctionalJavascript/EmbeddedMediaTest.php
Tests embedding image media with custom alt and title text.

File

tests/src/Traits/EntityEmbedTrait.php, line 61

Class

EntityEmbedTrait
Contains helper methods for interacting with Entity Embed.

Namespace

Drupal\Tests\lightning_media\Traits

Code

private function submitEmbedForm() {
  $this
    ->waitForEmbedForm();

  // Don't click the Embed button *in* the form, because it is hidden by
  // Drupal's dialog system.
  $this
    ->assertSession()
    ->elementExists('css', '.ui-dialog-buttonpane')
    ->pressButton('Embed');
  $result = $this
    ->getSession()
    ->getPage()
    ->waitFor(10, function (DocumentElement $page) {
    return $page
      ->find('css', '.ui-dialog') == NULL;
  });
  $this
    ->assertTrue($result);
}