You are here

public function ColorboxJavascriptTest::testColorboxLaunches in Colorbox 8

Test the colorbox launches when a gallery is clicked.

File

tests/src/FunctionalJavascript/ColorboxJavascriptTest.php, line 53

Class

ColorboxJavascriptTest
Test the colorbox JavaScript.

Namespace

Drupal\Tests\colorbox\FunctionalJavascript

Code

public function testColorboxLaunches() {
  $this
    ->drupalGet('node/' . $this->node
    ->id());
  $this
    ->getSession()
    ->getPage()
    ->find('css', 'img')
    ->click();
  $this
    ->getSession()
    ->wait(static::COLORBOX_WAIT_TIMEOUT);
  $this
    ->assertSession()
    ->elementContains('css', '#colorbox', 'test.png');
}