Source
$this->page->login()->open('host_discovery.php?filter_set=1&filter_hostids%5B0%5D='.$data['hostid'].'&context=host');
<?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/CMessageBehavior.php';
require_once dirname(__FILE__).'/../behaviors/CTableBehavior.php';
/**
* @backup items
*
* @dataSource ExecuteNowAction, DiscoveredHosts, HostTemplateGroups, AllItemValueTypes, DynamicItemWidgets
*
* @onBefore prepareLLDData
*/
class testPageLowLevelDiscovery extends CWebTest {
/**
* Attach MessageBehavior and TableBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CTableBehavior::class
];
}
const HOST_ID = 90001;
const SELECTOR = 'xpath://form[@name="discovery"]/table[contains(@class, "list-table")]';
public static function prepareLLDData() {
CDataHelper::createHosts([
[
'host' => 'Host with LLD',
'groups' => [['groupid' => 4]], // Zabbix servers.
'discoveryrules' => [
[
'name' => 'Trapper LLD for filter',
'key_' => 'key_lld_trapper',
'type' => ITEM_TYPE_TRAPPER
]
]
]
]);
}
public function testPageLowLevelDiscovery_CheckLayout() {
$this->page->login()->open('host_discovery.php?filter_set=1&filter_hostids%5B0%5D='.self::HOST_ID.'&context=host');
$form = $this->query('name:zbx_filter')->one()->asForm();