Source
$this->assertTrue($form->getField('Name')->isAttributePresent(['maxlength' => '255', 'placeholder' => 'default']));
<?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';
require_once dirname(__FILE__).'/../behaviors/CTableBehavior.php';
//define('LOGIN', true);
//define('WITHOUT_LOGIN', false);
/**
* @backup widget, profiles
*
* @dataSource AllItemValueTypes
*
* @onBefore prepareData
*/
class testDashboardWebMonitoringWidget extends testWidgets {
protected static $dashboardid;
protected static $groupids;
protected static $update_widget = 'Update Web monitoring widget';
const DEFAULT_DASHBOARD = 'Dashboard for Web monitoring widget test';
const DASHBOARD_FOR_WIDGET_ACTIONS = 'Dashboard for Item navigator widget create/update test';
/**
* Attach MessageBehavior and TableBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [
CMessageBehavior::class,
CTableBehavior::class
];
}
/**
* Create data for autotests which use WebWidget.
*
* @return array
*/
/**
* Create the initial data and set static variables.
*/
public function prepareData() {
// Create a Dashboard and pages for widgets.
$dashboards = CDataHelper::call('dashboard.create', [
[
'name' => self::DEFAULT_DASHBOARD,
'auto_start' => 0,
'pages' => [
[
'name' => 'Layout'
]
]
],
[
'name' => self::DASHBOARD_FOR_WIDGET_ACTIONS,
'auto_start' => 0,
'pages' => [
[
'name' => 'Actions',
'widgets' => [
[
'name' => 'Update Web monitoring widget',
'type' => 'web',
'x' => 0,
'y' => 0,
'width' => 18,
'height' => 4
],
[
'name' => 'WebMonitoring for delete',
'type' => 'web',
'x' => 18,
'y' => 0,