require_once __DIR__ . '/../../include/CWebTest.php';
require_once __DIR__.'/../behaviors/CMessageBehavior.php';
require_once __DIR__.'/../behaviors/CTableBehavior.php';
require_once __DIR__.'/../../include/helpers/CDataHelper.php';
class testPageAdministrationProxies extends CWebTest {
public function getBehaviors() {
private $sql = 'SELECT * FROM hosts ORDER BY hostid';
public function testPageAdministrationProxies_Layout() {
$this->page->login()->open('zabbix.php?action=proxy.list')->waitUntilReady();
$this->page->assertTitle('Configuration of proxies');
$this->page->assertHeader('Proxies');
$form = $this->query('name:zbx_filter')->waitUntilPresent()->asForm()->one();
'Mode' => ['Any', 'Active', 'Passive'],
'Version' => ['Any', 'Current', 'Outdated']
foreach ($fields as $field => $value) {
$this->assertEquals($value[0], $form->getField($field)->getValue());
foreach ($fields as $radio => $labels) {
$this->assertEquals($labels, $form->getField($radio)->asSegmentedRadio()->getLabels()->asText());
foreach ([true, false] as $status) {
$this->assertEquals($status, $this->query('xpath://div[contains(@class, "ui-tabs-panel")]')->one()->isVisible());
$this->query('xpath://a[contains(@class, "filter-trigger")]')->one()->click();
$table = $this->query('class:list-table')->asTable()->one()->waitUntilPresent();
$this->assertEquals(['', 'Name', 'Mode', 'Encryption', 'State', 'Version', 'Last seen (age)', 'Item count',
'Required vps', 'Hosts'], $table->getHeadersText()
'active_current' => ['version' => '6.4.0'],
'active_unknown' => ['version' => ''],
'passive_outdated' => ['version' => '6.2.0 ', 'color' => 'red', 'icon_color' => 'zi-i-warning', 'hint_text' =>
'Proxy version is outdated, only data collection and remote execution is available with server version 6.4.0.'
'passive_unsupported' => ['version' => '5.4.1 ', 'color' => 'red', 'icon_color' => 'zi-i-negative', 'hint_text' =>
'Proxy version is not supported by server version 6.4.0.', 'hint_color' => 'red'
foreach ($versions as $proxy => $parameters) {
$column = $table->findRow('Name', $proxy, true)->getColumn('Version');