Source
xxxxxxxxxx
$this->page->login()->open('zabbix.php?action=item.list&filter_set=1&filter_hostids%5B0%5D='.$hostid.'&context=host')->waitUntilReady();
<?php
/*
** Zabbix
** Copyright (C) 2001-2023 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/CWebTest.php';
require_once dirname(__FILE__).'/behaviors/CMessageBehavior.php';
require_once dirname(__FILE__).'/behaviors/CTableBehavior.php';
require_once dirname(__FILE__).'/../include/helpers/CDataHelper.php';
/**
* @backup profiles
*
* @dataSource ExecuteNowAction
*/
class testExecuteNow extends CWebTest {
/**
* Attach MessageBehavior and TableBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CTableBehavior::class
];
}
public static function getLatestDataPagetData() {
return [
// Simple items.
[
[
'items' => ['I4-trap-log']
]
],
[
[
'items' => ['I2-lvl1-trap-num', 'Download speed for scenario "Web scenario for execute now".']
]
],
[
[
'expected' => TEST_GOOD,
'items' => ['I5-agent-txt'],
'message' => 'Request sent successfully'
]
],
[
[
'expected' => TEST_GOOD,
'items' => ['I5-agent-txt', 'I4-trap-log'],
'message' => 'Request sent successfully. Some items are filtered due to access permissions or type.'
]
],
// Dependent items.
[
[
'expected' => TEST_GOOD,
'items' => ['I1-lvl2-dep-log'],
'message' => 'Request sent successfully'
]
],
[
[
'expected' => TEST_BAD,
'items' => ['I2-lvl2-dep-log'],
'message' => 'Cannot send request: wrong master item type.'
]
],
[
[
'expected' => TEST_BAD,
'items' => ['I3-web-dep'],
'message' => 'Cannot send request: wrong master item type.'