require_once dirname(__FILE__).'/../../include/CWebTest.php';
require_once dirname(__FILE__).'/../behaviors/CTableBehavior.php';
class testPageReportsActionLog extends CWebTest {
public function getBehaviors() {
return [CTableBehavior::class];
public function testPageReportsActionLog_CheckLayout() {
$this->page->login()->open('zabbix.php?action=actionlog.list')->waitUntilReady();
$this->page->assertHeader('Action log');
$this->page->assertTitle('Action log');
$form = $this->query('name:zbx_filter')->asForm()->one();
if ($this->query('xpath://li[@aria-labelledby="ui-id-1" and @aria-selected="false"]')->exists()) {
$this->query('id:ui-id-1')->one()->click();
$this->assertEquals('selected', $this->query('xpath://a[@data-label="Last 1 hour"]')->one()
$this->assertEquals('now-1h', $this->query('id:from')->one()->getValue());
$this->assertEquals('now', $this->query('id:to')->one()->getValue());
$this->query('id:ui-id-2')->one()->click();
foreach (['Apply', 'Reset'] as $button) {
$this->assertTrue($form->query('xpath:.//div[@class="filter-forms"]/button[text()="'.$button.'"]')
$this->assertTrue($this->query('button:Export to CSV')->one()->isClickable());
$this->assertEquals(['Recipients', 'Actions', 'Media types', 'Status', 'Search string'], $form->getLabels()->asText());
$this->assertEquals(255, $form->getField('Search string')->waitUntilVisible()->getAttribute('maxlength'));
$this->assertEquals(['Time', 'Action', 'Media type', 'Recipient', 'Message', 'Status', 'Info'],
$this->query('class:list-table')->asTable()->one()->getHeadersText()
$this->assertEquals(['In progress', 'Sent/Executed', 'Failed'], $this->query('id:filter_status')
->asCheckboxList()->one()->getLabels()->asText()
public static function getCheckFilterData() {