Source
$this->zbxTestAssertVisibleXpath("//div[@id='expression-constructor-buttons']//button[@id='replace_expression']");
<?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/CLegacyWebTest.php';
require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
use Facebook\WebDriver\WebDriverBy;
use Facebook\WebDriver\WebDriverKeys;
/**
* @backup triggers
*
* @onBefore prepareTriggerData
*/
class testFormTrigger extends CLegacyWebTest {
const HOST = 'Host for Triggers test';
protected static $long_key_hostid;
/**
* Attach MessageBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return ['class' => CMessageBehavior::class];
}
public function prepareTriggerData() {
// Create host group for hosts with items triggers.
$hostgroups = CDataHelper::call('hostgroup.create', [['name' => 'Group for triggers test']]);
$this->assertArrayHasKey('groupids', $hostgroups);
$groupid = $hostgroups['groupids'][0];
// Create hosts for various tests.
$hosts = CDataHelper::call('host.create', [
[
'host' => self::HOST,
'groups' => [['groupid' => $groupid]]
],
[
'host' => STRING_128,
'groups' => [['groupid' => $groupid]]
]
]);
$this->assertArrayHasKey('hostids', $hosts);
$hostid = $hosts['hostids'][0];
self::$long_key_hostid = $hosts['hostids'][1];