Source
$this->zbxTestWaitUntilMessageTextPresent('msg-bad', 'Incorrect value for field "Name": cannot be empty.');
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 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/CLegacyWebTest.php';
/**
* Test checks Configuration -> Hosts or Templates -> Applications form.
*
* @backup applications
*/
class testFormApplication extends CLegacyWebTest {
/**
* The name of the test application used in the test data set.
*
* @var string
*/
public static $application;
/**
* @beforeClass
*/
public static function initializeTest() {
// Initialize test application name - random name is used.
self::$application = 'Test application '.microtime(true);
}
/**
* Update application data.
*
* @param string $name current application name
* @param string $new_name new application name (can be null if application should not be renamed)
*/
protected function updateApplication($name, $new_name = null) {
if ($new_name === null) {
$new_name = $name;
}
// Open an application.
$this->zbxTestLogin('applications.php');
$filter = $this->query('name:zbx_filter')->asForm()->one();
$filter->getField('Host groups')->select('Zabbix servers');
$filter->getField('Hosts')->select('Simple form test host');
$filter->submit();
$this->zbxTestClickLinkTextWait($name);