You are here

protected function MenuLinkModalTest::checkModalFunctionality in Menu Link Modal 8.2

Same name and namespace in other branches
  1. 8 tests/src/FunctionalJavascript/MenuLinkModalTest.php \Drupal\Tests\menu_link_modal\FunctionalJavascript\MenuLinkModalTest::checkModalFunctionality()

Click on the menu link to check if it's opened in modal.

Parameters

object $node: The node object.

string $title: The title fo the Menu link to click.

Throws

\Behat\Mink\Exception\DriverException

\Behat\Mink\Exception\UnsupportedDriverActionException

1 call to MenuLinkModalTest::checkModalFunctionality()
MenuLinkModalTest::testMenuLinkModal in tests/src/FunctionalJavascript/MenuLinkModalTest.php
Tests if the link added in menu item opens with modal.

File

tests/src/FunctionalJavascript/MenuLinkModalTest.php, line 139

Class

MenuLinkModalTest
Tests link added in menu opens in modal with this module.

Namespace

Drupal\Tests\menu_link_modal\FunctionalJavascript

Code

protected function checkModalFunctionality($node, $title) {

  // Get Mink stuff.
  $assert = $this
    ->assertSession();
  $this
    ->clickLink($title);
  $this
    ->assertNotEmpty($assert
    ->waitForElementVisible('css', '.ui-dialog'));

  // Check that we have a result modal.
  $assert
    ->elementContains('css', 'span.ui-dialog-title', $node
    ->label());
}