public function FancyLoginJavascriptTest::testLoginBoxBackgroundColor in Fancy Login 8.2
Same name and namespace in other branches
- 3.0.x tests/src/FunctionalJavascript/FancyLoginJavascriptTest.php \Drupal\Tests\fancy_login\FunctionalJavascript\FancyLoginJavascriptTest::testLoginBoxBackgroundColor()
File
- tests/
src/ FunctionalJavascript/ FancyLoginJavascriptTest.php, line 102
Class
- FancyLoginJavascriptTest
- @group fancy_login
Namespace
Drupal\Tests\fancy_login\FunctionalJavascriptCode
public function testLoginBoxBackgroundColor() {
$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 = 'background-color';
$script = $this
->createScriptString($selector, $property, 'rgb(255, 255, 255)');
if (!$this
->getSession()
->evaluateScript($script)) {
throw new \Exception('Login box background color is not white');
}
$this
->goToConfigPage();
$this
->getSession()
->getPage()
->find('xpath', '//summary[@role="button" and text()="Display"]')
->click();
$this
->fillTextValue('#edit-login-box-background-color', '#000000');
$this
->click('#edit-actions .form-submit');
drupal_flush_all_caches();
$this
->drupalLogout();
$this
->openPopup();
$script = $this
->createScriptString($selector, $property, 'rgb(0, 0, 0)');
if (!$this
->getSession()
->evaluateScript($script)) {
throw new \Exception('Login box background color is not black');
}
}