Source
$form->query('xpath:.//div[@id="new_tag_filter_groupids_"]/..')->asMultiselect()->one()->fill('Discovered hosts');
<?php
/*
** Zabbix
** 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 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__).'/common/testFormPreprocessing.php';
require_once dirname(__FILE__).'/behaviors/CPreprocessingBehavior.php';
require_once dirname(__FILE__).'/../include/helpers/CDataHelper.php';
/**
* @dataSource Services
* @dataSource EntitiesTags
*
* @backup services
* @backup profiles
*/
class testFormTabIndicators extends CWebTest {
/**
* Attach PreprocessingBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [CPreprocessingBehavior::class];
}
public function getTabData() {
return [
// Template configuration form tab data.
[
[
'url' => 'templates.php?form=create',
'form' => 'name:templatesForm',
'tabs' => [
[
'name' => 'Tags',
'entries' => [
[
'tag' => '!@#$%^&*()_+<>,.\/',
'value' => '!@#$%^&*()_+<>,.\/'
],
[
'tag' => 'tag1',
'value' => 'value1'
],
[
'tag' => 'tag2'
]
],
'table_selector' => 'class:tags-table',
'field_type' => 'multifield_table',
'count' => 3
],
[
'name' => 'Macros',
'entries' => [
[
'macro' => '{$123}',
'Value' => '123'
],
[
'macro' => '{$ABC}'
],
[
'macro' => '{$ABC123}',
'Value' => 'ABC123',
'description' => 'ABC-123'
]
],
'table_selector' => 'id:tbl_macros',
'field_type' => 'multifield_table',
'count' => 3
],