Source
$this->assertEquals(['Recipients', 'Actions', 'Media types', 'Status', 'Search string'], $form->getLabels()->asText());
<?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__).'/../behaviors/CTableBehavior.php';
/**
* @backup alerts
*
* @dataSource LoginUsers, Actions
*/
class testPageReportsActionLog extends CWebTest {
/**
* Attach TableBehavior to the test.
*
* @return array
*/
public function getBehaviors() {
return [CTableBehavior::class];
}
public function testPageReportsActionLog_CheckLayout() {
$this->page->login()->open('zabbix.php?action=actionlog.list')->waitUntilReady();
// Check header and title.
$this->page->assertHeader('Action log');
$this->page->assertTitle('Action log');
$form = $this->query('name:zbx_filter')->asForm()->one();
// If the time selector is not visible - enable it.
if ($this->query('xpath://li[@aria-labelledby="ui-id-1" and @aria-selected="false"]')->exists()) {
$this->query('id:ui-id-1')->one()->click();
}
// Check that filter set to display Last hour data.
$this->assertEquals('selected', $this->query('xpath://a[@data-label="Last 1 hour"]')->one()
->getAttribute('class')
);
// Check data set values in input field.
$this->assertEquals('now-1h', $this->query('id:from')->one()->getValue());
$this->assertEquals('now', $this->query('id:to')->one()->getValue());
// Press to display filter.
$this->query('id:ui-id-2')->one()->click();
// Check filter buttons.
foreach (['Apply', 'Reset'] as $button) {
$this->assertTrue($form->query('xpath:.//div[@class="filter-forms"]/button[text()="'.$button.'"]')