Source
$column = $this->query('xpath://table[@class="list-table"]')->asTable()->one()->findRow('Name', $name)->getColumn('Name');
<?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__).'/../behaviors/CMacrosBehavior.php';
require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php';
require_once dirname(__FILE__).'/../../include/CLegacyWebTest.php';
/**
* Base class for Macros tests.
*/
abstract class testFormMacros extends CLegacyWebTest {
/**
* Attach Behaviors to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMacrosBehavior::class,
CMessageBehavior::class
];
}
const SQL_HOSTS = 'SELECT * FROM hosts ORDER BY hostid';
public $macro_resolve;
public $macro_resolve_hostid;
public $vault_object;
public $vault_error_field;
public $vault_macro_index;
public $update_vault_macro;
public $revert_macro_1;
public $revert_macro_2;
public $revert_macro_object;
public static function getHash() {
return CDBHelper::getHash(self::SQL_HOSTS);
}
public static function getCreateMacrosData() {
return [
[
[
'expected' => TEST_GOOD,
'Name' => 'With MACROS',
'macros' => [
[
'action' => USER_ACTION_UPDATE,
'index' => 0,
'macro' => '{$1234}',
'value' => '!@#$%^&*()_+/*',
'description' => '!@#$%^&*()_+/*'
],
[
'macro' => '{$M:regex:^[0-9a-z]}',
'value' => 'regex',
'description' => 'context macro with regex'
],
[
'macro' => '{$MACRO1}',
'value' => 'Value_1',
'description' => 'Test macro Description 1'
],
[
'macro' => '{$MACRO3}',
'value' => '',
'description' => ''
],
[
'macro' => '{$MACRO4}',