Source
xxxxxxxxxx
$overlay = $this->query('xpath://div[@class="overlay-dialogue wordbreak"]')->asOverlayDialog()->one()->waitUntilReady();
<?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';
class testPageTriggerDescription extends CWebTest {
public static function getTriggerDescription() {
return [
// Trigger without description.
[
[
'Event name' => '1_trigger_Disaster',
'event_url' => 'tr_events.php?triggerid=100036&eventid=9004'
]
],
// Trigger with plain text in the description.
[
[
'Event name' => '1_trigger_High',
'description' => 'Non-clickable description',
'event_url' => 'tr_events.php?triggerid=100035&eventid=9003'
]
],
// Trigger with only 1 url in description.
[
[
'Event name' => '1_trigger_Average',
'description' => 'https://zabbix.com',
'event_url' => 'tr_events.php?triggerid=100034&eventid=9002'
]
],
// Trigger with text and url in description.
[
[
'Event name' => '1_trigger_Warning',
'description' => 'The following url should be clickable: https://zabbix.com',
'event_url' => 'tr_events.php?triggerid=100033&eventid=9001'
]
],
// Trigger with multiple urls in description.
[
[
'Event name' => '2_trigger_Information',
'description' => 'http://zabbix.com https://www.zabbix.com/career https://www.zabbix.com/contact',
'event_url' => 'tr_events.php?triggerid=100037&eventid=9005'
]
],
// Trigger with macro in description.
[
[
'Event name' => '1_trigger_Not_classified',
'description' => 'Macro should be resolved, host IP should be visible here: 127.0.0.1',
'event_url' => 'tr_events.php?triggerid=100032&eventid=9000'
]
],
// Trigger with url and macro in description.
[
[
'Event name' => '3_trigger_Average',
'description' => 'Macro - resolved, URL - clickable: 3_Host_to_check_Monitoring_Overview, https://zabbix.com',
'event_url' => 'tr_events.php?triggerid=100038&eventid=9006'
]
]
];
}
/**
* @dataProvider getTriggerDescription
*/
public function testPageTriggerDescription_ProblemDescription($data) {
$this->page->login()->open('zabbix.php?action=problem.view');
// Find rows from the data provider and check the description if such should exist.
$table = $this->query('class:list-table')->asTable()->one();
$row = $table->findRow('Problem', $data['Event name'], true);
if (CTestArrayHelper::get($data, 'description', false)) {