You are here

public function ColorboxJavascriptTest::testAdminForm in Colorbox 8

Test the admin form.

File

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

Class

ColorboxJavascriptTest
Test the colorbox JavaScript.

Namespace

Drupal\Tests\colorbox\FunctionalJavascript

Code

public function testAdminForm() {
  $this
    ->drupalLogin($this
    ->drupalCreateUser([
    'administer site configuration',
  ]));
  $this
    ->drupalGet('admin/config/media/colorbox');
  $this
    ->assertFalse($this
    ->getSession()
    ->getPage()
    ->find('css', '.form-item-colorbox-transition-speed')
    ->isVisible());
  $this
    ->assertSession()
    ->fieldExists('colorbox_custom_settings_activate')
    ->setValue(TRUE);
  $this
    ->assertTrue($this
    ->getSession()
    ->getPage()
    ->find('css', '.form-item-colorbox-transition-speed')
    ->isVisible());
  $this
    ->assertSession()
    ->fieldExists('colorbox_overlayclose')
    ->setValue(FALSE);
  $this
    ->getSession()
    ->getPage()
    ->find('css', '.form-submit')
    ->click();
  $this
    ->assertSession()
    ->pageTextContains('The configuration options have been saved.');
}