zbxTestLogin('zabbix.php?action=miscconfig.edit'); $this->zbxTestCheckTitle('Other configuration parameters'); $this->zbxTestCheckHeader('Other configuration parameters'); $this->zbxTestAssertElementValue('refresh_unsupported', $allValues['refresh_unsupported']); // checkbox "snmptrap_logging" if ($allValues['snmptrap_logging']) { $this->assertTrue($this->zbxTestCheckboxSelected('snmptrap_logging')); } if ($allValues['snmptrap_logging']==0) { $this->assertFalse($this->zbxTestCheckboxSelected('snmptrap_logging')); $this->zbxTestAssertElementPresentId('refresh_unsupported'); $this->zbxTestAssertElementPresentId('snmptrap_logging'); $this->zbxTestAssertElementPresentId('default_inventory_mode'); // ckecking presence of drop-down elements $this->zbxTestAssertElementPresentId('discovery_groupid'); $this->zbxTestAssertElementPresentId('alert_usrgrpid'); } } // checking possible values in the drop-down "Group for discovered hosts" public function testFormAdministrationGeneralOtherParams_CheckHostGroupsLayout() { $this->zbxTestLogin('zabbix.php?action=miscconfig.edit'); $this->query('id:page-title-general')->asPopupButton()->one()->select('Other'); $this->zbxTestCheckTitle('Other configuration parameters'); $this->zbxTestCheckHeader('Other configuration parameters'); $sql = 'SELECT groupid FROM hstgrp'; $hgroups = DBfetchArray(DBselect($sql)); foreach ($hgroups as $group) { $this->zbxTestAssertElementPresentXpath("//z-select[@name='discovery_groupid']//li[@value='".$group['groupid']."']"); } } // checking possible values in the drop-down "User group for database down message" public function testFormAdministrationGeneralOtherParams_CheckUserGroupLayout() { $this->zbxTestLogin('zabbix.php?action=miscconfig.edit'); $this->query('id:page-title-general')->asPopupButton()->one()->select('Other'); $this->zbxTestCheckTitle('Other configuration parameters'); $this->zbxTestCheckHeader('Other configuration parameters'); $sql = 'SELECT usrgrpid FROM usrgrp'; $usrgrp = DBfetchArray(DBselect($sql)); foreach ($usrgrp as $usrgroup) { $this->zbxTestAssertElementPresentXpath("//z-select[@name='alert_usrgrpid']//li[@value='".$usrgroup['usrgrpid']."']"); } $this->zbxTestDropdownHasOptions('alert_usrgrpid', ['None']); } public function testFormAdministrationGeneralOtherParams_OtherParams() { $this->zbxTestLogin('zabbix.php?action=miscconfig.edit'); $this->query('id:page-title-general')->asPopupButton()->one()->select('Other'); $this->zbxTestCheckTitle('Other configuration parameters'); $this->zbxTestCheckHeader('Other configuration parameters'); $this->zbxTestInputType('refresh_unsupported', '700'); $this->zbxTestDropdownSelect('discovery_groupid', 'Linux servers'); $this->zbxTestDropdownSelect('alert_usrgrpid', 'Zabbix administrators'); $this->zbxTestCheckboxSelect('snmptrap_logging'); // 1 - yes, 0 - no $this->zbxTestClickWait('update'); $this->zbxTestTextPresent('Configuration updated'); $sql = "SELECT refresh_unsupported FROM config WHERE refresh_unsupported='700'"; $this->assertEquals(1, CDBHelper::getCount($sql)); $sql = 'SELECT snmptrap_logging FROM config WHERE snmptrap_logging=1'; $this->assertEquals(1, CDBHelper::getCount($sql)); $this->query('id:page-title-general')->asPopupButton()->one()->select('Other'); $this->zbxTestCheckTitle('Other configuration parameters'); // trying to enter max possible value $this->zbxTestInputTypeOverwrite('refresh_unsupported', '86400'); $this->zbxTestDropdownSelect('discovery_groupid', 'Linux servers'); $this->zbxTestDropdownSelect('alert_usrgrpid', 'Enabled debug mode'); $this->zbxTestCheckboxSelect('snmptrap_logging', false); $this->zbxTestClickWait('update'); $this->zbxTestTextPresent('Configuration updated'); $sql = "SELECT refresh_unsupported FROM config WHERE refresh_unsupported='86400'"; $this->assertEquals(1, CDBHelper::getCount($sql)); $sql = 'SELECT snmptrap_logging FROM config WHERE snmptrap_logging=0'; $this->assertEquals(1, CDBHelper::getCount($sql)); // trying to enter value > max_value $this->zbxTestCheckTitle('Other configuration parameters'); $this->zbxTestCheckHeader('Other configuration parameters'); $this->zbxTestInputTypeOverwrite('refresh_unsupported', '86401'); $this->zbxTestClickWait('update'); $this->zbxTestWaitUntilMessageTextPresent('msg-bad', 'Cannot update configuration'); $this->zbxTestTextPresent('Invalid refresh of unsupported items: value must be one of 0-86400'); } }