Source
'details' => 'Cannot send request: discovery rule "Discovery rule 2" on host "Host for host prototype tests" is not monitored.',
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__).'/../include/CWebTest.php';
require_once dirname(__FILE__).'/traits/TableTrait.php';
require_once dirname(__FILE__).'/behaviors/CMessageBehavior.php';
/**
* @backup items
*/
class testPageLowLevelDiscovery extends CWebTest {
use TableTrait;
const HOST_ID = 90001;
/**
* Attach MessageBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [CMessageBehavior::class];
}
public function testPageLowLevelDiscovery_CheckLayout() {
$this->page->login()->open('host_discovery.php?filter_set=1&filter_hostids%5B0%5D='.self::HOST_ID);
$form = $this->query('name:zbx_filter')->one()->asForm();
// Check all field names.
$fields = ['Host groups', 'Hosts', 'Name', 'Key', 'Type', 'Update interval',
'Keep lost resources period', 'SNMP OID', 'State', 'Status'];
$this->assertEquals($fields, $form->getLabels()->asText());
// Check filter collapse/expand.
foreach (['true', 'false'] as $status) {
$filter_tab = $this->query('xpath://a[contains(@class, "filter-trigger")]')->one();
$filter_tab->parents('xpath:/li[@aria-expanded="'.$status.'"]')->one()->click();
}
// Check all dropdowns.
$dropdowns = [
'Type' => ['Zabbix agent', 'Zabbix agent (active)', 'Simple check',
'SNMP agent', 'Zabbix internal','Zabbix trapper', 'External check',
'Database monitor', 'HTTP agent', 'IPMI agent', 'SSH agent',
'TELNET agent', 'JMX agent', 'Dependent item', 'all'],