Source
$this->assertEquals(['Page 1', 'Page 2'], $dashboard_navigation->query('xpath:.//li[@class="sortable-item"]')->all()->asText());
<?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__) . '/../../include/CWebTest.php';
define('CURRENT_YEAR', date("Y"));
/**
* @onBefore prepareHostDashboardsData
*
* @backup hosts
*/
class testPageHostDashboards extends CWebTest {
const HOST_NAME = 'Host for Host Dashboards';
const TEMPLATE_NAME = 'Template for '.self::HOST_NAME;
const COUNT_MANY = 20;
public function prepareHostDashboardsData() {
$data = [
'host_name' => self::HOST_NAME,
'dashboards' => [
[
'name' => 'Dashboard 1',
'pages' => [
[
'name' => 'Page 1',
'widgets' => [
[
'type' => 'graph',
'name' => 'Graph widget',
'width' => 6,
'height' => 4,
'fields' => [
[
'type' => ZBX_WIDGET_FIELD_TYPE_INT32,
'name' => '*',
'value' => 0
]
]
]
]
],
[
'name' => 'Page 2'