zbxTestLogin('templates.php'); // Check if template name present on page, if not, check on next page. for ($i = 0; $i < 2; $i++) { if ($this->query('link', $host)->one(false)->isValid() === true) { break; } $this->query('xpath://div[@class="table-paging"]//span[@class="arrow-right"]/..')->one()->click(); $this->page->waitUntilReady(); } $this->zbxTestClickLinkText($host); $this->zbxTestCheckHeader('Templates'); $this->zbxTestWaitUntilElementVisible(WebDriverBy::xpath("//ul[contains(@class, 'object-group')]//a[text()='Screens']")); $this->zbxTestClickXpath("//ul[contains(@class, 'object-group')]//a[text()='Screens']"); $this->zbxTestCheckTitle('Configuration of screens'); $this->zbxTestCheckboxSelect('screens_'.$screenid); $this->zbxTestClickButton('screen.massdelete'); $this->zbxTestAcceptAlert(); $this->zbxTestCheckTitle('Configuration of screens'); $this->zbxTestCheckHeader('Screens'); $this->zbxTestTextPresent(['Screen deleted', $host]); } }