| Conditions | 1 |
| Paths | 1 |
| Total Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function closeNotification(string $text): void |
||
| 18 | { |
||
| 19 | /** @var WebDriver $I */ |
||
| 20 | $I = $this->getModule('WebDriver'); |
||
| 21 | $I->waitForElement('.ui-pnotify', 180); |
||
| 22 | $I->see($text, '.ui-pnotify'); |
||
| 23 | $I->moveMouseOver(['css' => '.ui-pnotify']); |
||
| 24 | $I->wait(0.5); |
||
| 25 | $I->executeJS(<<<JS |
||
| 26 | const selector = "div.ui-pnotify-closer>span[title='Close']"; |
||
| 27 | const closeUntillItsDead = () => { |
||
| 28 | const bttn = document.querySelector(selector); |
||
| 29 | if (bttn) { |
||
| 30 | bttn.click(); |
||
| 31 | setTimeout(closeUntillItsDead, 300); |
||
| 32 | } |
||
| 33 | }; |
||
| 34 | closeUntillItsDead(); |
||
| 35 | |||
| 36 | JS |
||
| 37 | ); |
||
| 38 | $I->waitForElementNotVisible('.ui-pnotify'); |
||
| 39 | } |
||
| 40 | } |
||
| 41 |