You are here

public function ThunderMediaTest::test8101 in Thunder 8.2

Test that entity browsers does not have language filters anymore.

File

tests/src/FunctionalJavascript/Update/ThunderMediaTest.php, line 27

Class

ThunderMediaTest
Test for update hook changes.

Namespace

Drupal\Tests\thunder\FunctionalJavascript\Update

Code

public function test8101() {

  // Open article creation page but without setting any element in form.
  $this
    ->articleFillNew([]);

  /** @var \Behat\Mink\Element\DocumentElement $page */
  $page = $this
    ->getSession()
    ->getPage();

  // Open teaser entity browser.
  $buttonName = 'field_teaser_media_entity_browser_entity_browser';
  $this
    ->scrollElementInView("[name=\"{$buttonName}\"]");
  $page
    ->pressButton($buttonName);
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->getSession()
    ->switchToIFrame('entity_browser_iframe_image_browser');
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();

  // Check that status and name filtering fields exist, but not langcode.
  $this
    ->assertSession()
    ->elementNotExists('xpath', '//*[@data-drupal-selector="edit-langcode"]');
  $this
    ->assertSession()
    ->elementExists('xpath', '//*[@data-drupal-selector="edit-status"]');
  $this
    ->assertSession()
    ->elementExists('xpath', '//*[@data-drupal-selector="edit-name"]');

  // Close entity browser.
  $this
    ->getSession()
    ->switchToIFrame();
  $page
    ->find('xpath', '//*[contains(@class, "ui-dialog-titlebar-close")]')
    ->click();
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
}