Skip to content

Commit

Permalink
Merge pull request #165 from Metadrop/feature/cookies-visibility
Browse files Browse the repository at this point in the history
COOKIES - After accept check if the banner is null or not visible
  • Loading branch information
omarlopesino authored Aug 11, 2023
2 parents 625e008 + 7098f17 commit ba6bbb0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Behat/Context/CookieComplianceContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,10 @@ public function iAcceptCookies() {
sleep(1);
}
$agree_button->press();
if (!$this->getSession()->wait(10000, sprintf('document.querySelector("%s") == null', $this->cookieBannerSelector))) {
if (!$this->getSession()->wait(
10000,
sprintf('document.querySelector("%s") == null || document.querySelector("%s").style.visibility == "hidden"',
$this->cookieBannerSelector, $this->cookieBannerSelector))) {
throw new \Exception(sprintf('The cookie banner with selector "%s" is stil present after accepting cookies.', $this->cookieBannerSelector));
}
}
Expand Down

0 comments on commit ba6bbb0

Please sign in to comment.