Source
$this->query('class:list-table')->asTable()->one()->findRow('Name', $host_name)->query('link', $column)->one()->click();
<?php
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
require_once dirname(__FILE__).'/../../include/CWebTest.php';
require_once dirname(__FILE__).'/../behaviors/CTableBehavior.php';
require_once dirname(__FILE__).'/../behaviors/CTagBehavior.php';
require_once dirname(__FILE__).'/../../include/helpers/CDataHelper.php';
/**
* @backup profiles
*
* @dataSource TagFilter, UserPermissions
*/
class testPageMonitoringHosts extends CWebTest {
/**
* Attach TableBehavior and TagBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CTableBehavior::class,
[
'class' => CTagBehavior::class,
'tag_selector' => 'id:tags_0'
]
];
}
/**
* Id of host that was updated.
*
* @var integer
*/
protected static $hostid;
public function testPageMonitoringHosts_CheckLayout() {
$this->page->login()->open('zabbix.php?action=host.view')->waitUntilReady();
$form = $this->query('name:zbx_filter')->waitUntilPresent()->asForm()->one();
$table = $this->query('class:list-table')->asTable()->one();
// Checking Title, Header and Column names.
$this->page->assertTitle('Hosts');
$this->page->assertHeader('Hosts');
$headers = ['Name', 'Interface', 'Availability', 'Tags', 'Status', 'Latest data', 'Problems','Graphs',
'Dashboards', 'Web'];
$this->assertSame($headers, ($this->query('class:list-table')->asTable()->one())->getHeadersText());
// Check filter collapse/expand.