You are here

public function FancyLoginJavascriptTest::testDimmerBackgroundColor in Fancy Login 8.2

Same name and namespace in other branches
  1. 3.0.x tests/src/FunctionalJavascript/FancyLoginJavascriptTest.php \Drupal\Tests\fancy_login\FunctionalJavascript\FancyLoginJavascriptTest::testDimmerBackgroundColor()

File

tests/src/FunctionalJavascript/FancyLoginJavascriptTest.php, line 43

Class

FancyLoginJavascriptTest
@group fancy_login

Namespace

Drupal\Tests\fancy_login\FunctionalJavascript

Code

public function testDimmerBackgroundColor() {
  $this
    ->assertJsCondition('jQuery("#fancy_login_dim_screen").not(":animated")');
  $this
    ->assertJsCondition('jQuery("#fancy-login-user-login-form").not(":animated")');
  $script = $this
    ->createScriptString('#fancy_login_dim_screen', 'background-color', 'rgb(255, 255, 255)');
  if (!$this
    ->getSession()
    ->evaluateScript($script)) {
    throw new \Exception('background-color is not white');
  }
  $this
    ->goToConfigPage();
  $this
    ->getSession()
    ->getPage()
    ->find('xpath', '//summary[@role="button" and text()="Display"]')
    ->click();
  $this
    ->fillTextValue('#edit-screen-fade-color', '#000000');
  $this
    ->click('#edit-actions .form-submit');
  drupal_flush_all_caches();
  $this
    ->drupalLogout();
  $this
    ->openPopup();
  $script = $this
    ->createScriptString('#fancy_login_dim_screen', 'background-color', 'rgb(0, 0, 0)');
  if (!$this
    ->getSession()
    ->evaluateScript($script)) {
    throw new \Exception('background-color is not black');
  }
}