Source
$this->assertScreenshot($form->query('id:headers_pairs')->waitUntilPresent()->one(), 'Item mass update headers'.$prototypes);
<?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';
require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
require_once dirname(__FILE__).'/../behaviors/CPreprocessingBehavior.php';
use Facebook\WebDriver\Exception\ElementClickInterceptedException;
/**
* Test the mass update of items and item prototypes.
*
* @backup items, interface
*/
class testMassUpdateItems extends CWebTest{
/**
* Attach PreprocessingBehavior and MessageBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CPreprocessingBehavior::class
];
}
const HOSTID = 40001; // Simple form test host.
const RULEID = 133800; // testFormDiscoveryRule1 on Simple form test host.
const HOST_NAME = 'Simple form test host';
const AGENT_INTERFACE_ID = 40011;
const SNMP2_INTERFACE_ID = 40012;
const IPMI_INTERFACE_ID = 40013;
const INTERVAL_MAPPING = [
'Type' => [
'name' => 'type',
'class' => 'CSegmentedRadioElement',
'selector' => 'xpath:./ul[contains(@class, "radio-list-control")]'.
'|./ul/li/ul[contains(@class, "radio-list-control")]|./div/ul[contains(@class, "radio-list-control")]'
],
'Interval' => [
'name' => 'delay',
'class' => 'CElement',
'selector' => 'xpath:./input[@name][not(@type) or @type="text" or @type="password"][not(@class) or '.
'not(contains(@class, "display-none"))]|./textarea[@name]'
],
'Period' => [
'name' => 'period',
'class' => 'CElement',
'selector' => 'xpath:./input[@name][not(@type) or @type="text" or @type="password"][not(@class) or '.
'not(contains(@class, "display-none"))]|./textarea[@name]'
]
];
/**
* Add interface to host.
*/
public function prepareInterfaceData() {
CDataHelper::call('hostinterface.create', [
[
'hostid' => self::HOSTID,
'dns' => '',
'ip' => '127.0.5.5',
'main' => 0,
'port' => '10055',
'type' => 2,
'useip' => 1,
'details' => [
'version' => 3,
'bulk' => 1,
'max_repetitions' => 10,
'securityname' => 'zabbix',
'securitylevel' => 0,
'authprotocol' => 0,
'privprotocol' => 0,
'contextname' => 'zabbix'