Skip to content

Commit

Permalink
Dev: Ignore popups after login (Travis)
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Feb 25, 2021
1 parent e127d95 commit 72f2d10
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/TestBaseClassWeb.php
Expand Up @@ -169,6 +169,10 @@ public static function adminLogin($userName, $password)

$submit = self::$webDriver->findElement(WebDriverBy::name('login_submit'));
$submit->click();

$this->ignoreAdminNotification();
$this->ignoreAdminNotification();

/*
try {
sleep(1);
Expand Down Expand Up @@ -220,4 +224,24 @@ protected function waitForElementShim(&$driver, $CSSelementSelectorString, $time

return $element;
}

/**
* @return void
*/
protected function ignoreAdminNotification()
{
// Ignore password warning.
try {
$button = self::$webDriver->wait(1)->until(
WebDriverExpectedCondition::elementToBeClickable(
WebDriverBy::cssSelector('#admin-notification-modal button.btn-default')
)
);
$button->click();
} catch (TimeOutException $ex) {
// Do nothing.
} catch (NoSuchElementException $ex) {
// Do nothing.
}
}
}

0 comments on commit 72f2d10

Please sign in to comment.