You are here

public function FancyLoginJavascriptTest::testLoginBoxBorderStyle 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::testLoginBoxBorderStyle()

File

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

Class

FancyLoginJavascriptTest
@group fancy_login

Namespace

Drupal\Tests\fancy_login\FunctionalJavascript

Code

public function testLoginBoxBorderStyle() {
  $this
    ->assertJsCondition('jQuery("#fancy_login_dim_screen").not(":animated")');
  $this
    ->assertJsCondition('jQuery("#fancy-login-user-login-form").not(":animated")');
  $selector = '#fancy_login_login_box';
  $property = 'border-style';
  $script = $this
    ->createScriptString($selector, $property, 'solid');
  if (!$this
    ->getSession()
    ->evaluateScript($script)) {
    throw new \Exception('Login box border width is not solid');
  }
  $this
    ->goToConfigPage();
  $this
    ->getSession()
    ->getPage()
    ->find('xpath', '//summary[@role="button" and text()="Display"]')
    ->click();
  $this
    ->fillTextValue('#edit-login-box-border-style', 'dotted');
  $this
    ->click('#edit-actions .form-submit');
  drupal_flush_all_caches();
  $this
    ->drupalLogout();
  $this
    ->openPopup();
  $script = $this
    ->createScriptString($selector, $property, 'dotted');
  if (!$this
    ->getSession()
    ->evaluateScript($script)) {
    throw new \Exception('Login box text color is not dotted');
  }
}