Source
$host = COverlayDialogElement::find()->one()->waitUntilReady()->query('class:multiselect-control')->asMultiselect()->one();
<?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/CLegacyWebTest.php';
require_once dirname(__FILE__).'/../include/helpers/CDataHelper.php';
require_once dirname(__FILE__).'/behaviors/CMessageBehavior.php';
use Facebook\WebDriver\WebDriverBy;
/**
* @backup trigger_depends, hosts_templates
*
* @onBefore prepareTemplateData
*/
class testTriggerDependencies extends CLegacyWebTest {
/**
* Attach MessageBehavior to the test.
*/
public function getBehaviors() {
return [CMessageBehavior::class];
}
const TEMPLATE_AGENT = 'Zabbix agent';
const TEMPLATE_FREEBSD = 'FreeBSD by Zabbix agent';
const TEMPLATE_APACHE = 'Apache by HTTP';
protected static $agent_templateid;
protected static $freebsd_templateid;
protected static $apache_templateid;
/**
* Function links Zabbix agent template to FreeBSD by Zabbix agent template.
*/
public static function prepareTemplateData() {
$template_ids = CDBHelper::getAll('SELECT hostid FROM hosts WHERE host IN ('.zbx_dbstr(self::TEMPLATE_AGENT).','.
zbx_dbstr(self::TEMPLATE_FREEBSD).','.zbx_dbstr(self::TEMPLATE_APACHE).') ORDER BY host ASC'
);
self::$apache_templateid = $template_ids[0]['hostid'];
self::$freebsd_templateid = $template_ids[1]['hostid'];
self::$agent_templateid = $template_ids[2]['hostid'];
CDataHelper::call('template.update', [
[
'templateid' => self::$freebsd_templateid,