Same name and namespace in other branches
  1. 8.x-1.x tests/src/FunctionalJavascript/ColorboxJavascriptTest.php \Drupal\Tests\colorbox\FunctionalJavascript\ColorboxJavascriptTest::testAdminForm() 1 comment

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.');
}