Source
$first_pageid = CDBHelper::getValue($query_pageid.zbx_dbstr(self::$ids['Dashboard for copy']).' ORDER BY dashboard_pageid DESC');
<?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';
use Facebook\WebDriver\WebDriverKeys;
/**
* @backup dashboard
*
* @onBefore prepareDashboardData
*/
class testDashboardsPages extends CWebTest {
/**
* Next page button in dashboard.
*
* @var string
*/
const NEXT_BUTTON = 'xpath://button[contains(@class, "btn-dashboard-next-page")]';
/**
* Previous page button in dashboard.
*
* @var string
*/
const PREVIOUS_BUTTON = 'xpath://button[contains(@class, "btn-dashboard-previous-page")]';
/**
* Attach MessageBehavior to the test.
*/
public function getBehaviors() {
return [CMessageBehavior::class];
}
/**
* Id of dashboard by name.
*
* @var integer
*/
protected static $ids;
/**
* Create new dashboards for autotest.
*/
public function prepareDashboardData() {
$response = CDataHelper::call('dashboard.create', [
[
'name' => 'Dashboard for layout',
'display_period' => 30,
'auto_start' => 1,
'pages' => [
[
'name' => 'First_page_name',
'widgets' => [
[
'name' => 'First page clock',
'type' => 'clock',
'x' => 0,
'y' => 0,
'width' => 5,
'height' => 5,
'view_mode' => 0
]
]
],
[
'name' => 'second_page_name',
'widgets' => [
[
'name' => 'Second page clock',
'type' => 'clock',
'x' => 0,
'y' => 0,
'width' => 5,
'height' => 5,