Source
$this->assertEquals(['', 'Name', 'State', 'Failover period', 'Online proxies', 'Minimum proxies', 'Proxies'],
<?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__).'/../../include/helpers/CDataHelper.php';
/**
* Test for checking Proxy groups page.
*
* @dataSource Proxies
*
* @backup proxy_group
*/
class testPageAdministrationProxyGroups extends CWebTest {
/**
* Attach MessageBehavior and TableBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CTableBehavior::class
];
}
public function testPageAdministrationProxyGroups_Layout() {
$this->page->login()->open('zabbix.php?action=proxygroup.list')->waitUntilReady();
$this->page->assertTitle('Configuration of proxy groups');
$this->page->assertHeader('Proxy groups');
$this->assertTrue($this->query('button:Create proxy group')->one()->isClickable());
$filter_form = $this->query('name:zbx_filter')->waitUntilPresent()->asForm()->one();
// Check default fields and values.
$filter_fields = [
'Name' => [
'default' => '',
'maxlength' => 255
],
'State' => [
'default' => 'Any',
'options' => ['Any', 'Online', 'Degrading', 'Offline', 'Recovering']
]
];
foreach ($filter_fields as $field_name => $field_params) {
$filter_field = $filter_form->getField($field_name);
$this->assertEquals($field_params['default'], $filter_field->getValue());