Source
xxxxxxxxxx
$this->assertTableDataColumn(($sort === 'asc') ? $data['expected'] : array_reverse($data['expected']), 'Service');
<?php
/*
** Zabbix
** Copyright (C) 2001-2023 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__).'/../common/testSlaReport.php';
/**
* @backup profiles
*
* @dataSource Services, Sla
*
* @onBefore getDateTimeData
*/
class testPageServicesSlaReport extends testSlaReport {
public function testPageServicesSlaReport_GeneralLayout() {
$this->page->login()->open('zabbix.php?action=slareport.list');
$this->page->assertHeader('SLA report');
$this->page->assertTitle('SLA report');
// Check status of buttons on the SLA report page.
foreach ($this->query('button', ['Apply', 'Reset'])->all() as $button) {
$this->assertTrue($button->isClickable());
}
// Check displaying and hiding the filter.
$filter_form = $this->query('name:zbx_filter')->asForm()->one();
$filter_tab = $this->query('xpath://a[contains(text(), "Filter")]')->one();
$filter = $filter_form->query('id:tab_0')->one();
$this->assertTrue($filter->isDisplayed());
$filter_tab->click();
$this->assertFalse($filter->isDisplayed());
$filter_tab->click();
$this->assertTrue($filter->isDisplayed());
// Check the list of available SLAs (disabled SLAs should not be present).
$sla_data = [
'field' => 'SLA',
'headers' => ['Name'],
'column_data' => [
'Name' => [
'SLA Annual',
'SLA Daily',
'SLA Monthly',
'SLA Quarterly',
'SLA Weekly',
'SLA with schedule and downtime',
'SLA для удаления - 頑張って', 'Update SLA'
]
],
'table_selector' => 'xpath://form[@id="sla"]/table',
'buttons' => ['Cancel']
];
$service_data = [
'field' => 'Service',
'headers' => ['Name', 'Tags', 'Problem tags'],
'table_selector' => 'xpath://form[@name="services_form"]/table',
'buttons' => ['Filter', 'Reset', 'Cancel'],
'check_row' => [
'Name' => 'Simple actions service',
'Tags' => 'problem: falsetest: test789',
'Problem tags' => 'problem: true'
]
];
foreach ([$sla_data, $service_data] as $dialog_data) {
$this->checkDialogContents($dialog_data);
}
foreach (['From', 'To'] as $field_label) {
$field = $filter_form->getField($field_label)->query('xpath:./input')->one();
$this->assertEquals(10, $field->getAttribute('maxlength'));