date('Y-m-d H:i:s', strtotime($start_time)), 'to' => date('Y-m-d H:i:s', strtotime($end_time)), 'filter_hostids' => [50014] ]; $this->zbxTestLogin('report2.php?'.http_build_query($args)); $table_rows =$this->webDriver->findElements(WebDriverBy::xpath('//table[@class="list-table"]/tbody/tr')); if (!$table_rows) { $this->fail("Failed to get SLA reports table."); } foreach ($table_rows as $row) { $cells = $row->findElements(WebDriverBy::xpath('td')); $cells_values = []; foreach ($cells as $cell) { $cells_values[] = $cell->getText(); } // Check only cells 2,3,4 in every row: Label, Problem state value, Ok state value. $this->assertContains(array_slice($cells_values, 1, 3), $sla_item_values); } } public function testPageAvailabilityReport_ByHost_CheckLayout() { $this->zbxTestLogin('report2.php?config=0'); $this->zbxTestCheckTitle('Availability report'); $this->zbxTestCheckHeader('Availability report'); $this->zbxTestTextPresent('Mode'); $this->zbxTestTextPresent('Filter'); $this->zbxTestTextPresent(['Host', 'Name', 'Problems', 'Ok', 'Graph']); } // Check that no real host or template names displayed public function testPageAvailabilityReport_ByHost_NoHostNames() { $this->zbxTestLogin('report2.php?config=0'); $this->zbxTestCheckTitle('Availability report'); $this->zbxTestCheckNoRealHostnames(); } public function testPageAvailabilityReport_ByTriggerTemplate_CheckLayout() { $this->zbxTestLogin('report2.php?config=1'); $this->zbxTestCheckTitle('Availability report'); $this->zbxTestCheckHeader('Availability report'); $this->zbxTestTextPresent('Mode'); $this->zbxTestTextPresent('Filter'); $this->zbxTestTextPresent(['Host', 'Name', 'Problems', 'Ok', 'Graph']); } // Check that no real host or template names displayed public function testPageAvailabilityReport_ByTriggerTemplate_NoHostNames() { $this->zbxTestLogin('report2.php?config=1'); $this->zbxTestCheckNoRealHostnames(); } }