Source
$this->test->assertEquals(count($data), count($steps), 'Preprocessing step count should match step count in data.');
<?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/CBehavior.php';
/**
* Behavior for preprocessing related tests.
*/
class CPreprocessingBehavior extends CBehavior {
/**
* Get descriptors of preprocessing fields.
*
* @return array
*/
protected static function getPreprocessingFieldDescriptors() {
return [
[
'name' => 'type',
'selector' => 'xpath:.//z-select[contains(@id, "_type")]',
'detect' => true,
'value' => ['getValue']
],
[
'name' => 'parameter_1',
'selector' => 'xpath:.//input[contains(@id, "_params_0")]|.//div[contains(@id, "_params_0")]|'.
'.//z-select[contains(@name, "[params][0]")]',
'detect' => true,
'value' => ['getValue']
],
[
'name' => 'parameter_2',
'selector' => 'xpath:.//input[contains(@id, "_params_1")]|.//z-select[contains(@name, "[params][1]")]|'.
'.//input[contains(@name, "[params][1]")]',
'detect' => true,
'value' => ['getValue']
],
[
'name' => 'parameter_3',
'selector' => 'xpath:.//input[contains(@id, "_params_2")]',
'detect' => true,
'value' => ['getValue']
],
[
'name' => 'on_fail',
'selector' => 'xpath:.//input[contains(@id, "_on_fail")]',
'class' => 'CCheckboxElement',
'value' => ['isChecked']
],
[
'name' => 'error_handler',