require_once dirname(__FILE__).'/../include/CLegacyWebTest.php';
use Facebook\WebDriver\WebDriverBy;
class testFormAdministrationDMProxies extends CLegacyWebTest {
private $proxy_name = 'proxy_name_1';
private $new_proxy_name = 'proxy_name_new';
private $cloned_proxy_name = 'proxy_name_new_clone';
private $long_proxy_name = '1234567890123456789012345678901234567890123456789012345678901234';
private $long_proxy_name2 = '12345678901234567890123456789012345678901234567890123456789012345';
private $proxy_host = 'Zabbix server';
private $passive_proxy_host = 'H1';
private $passive_proxy_name = 'passive_proxy_name1';
public function testFormAdministrationDMProxies_CheckLayout() {
$this->zbxTestLogin('zabbix.php?action=proxy.list');
$this->zbxTestCheckTitle('Configuration of proxies');
$this->zbxTestCheckHeader('Proxies');
$this->zbxTestClickButtonText('Create proxy');
$this->zbxTestTextPresent(['Proxy name', 'Proxy mode', 'Proxy address', 'Description']);
$this->zbxTestAssertElementPresentId('host');
$this->zbxTestAssertAttribute('//input[@id=\'host\']', 'maxlength', '128');
$this->zbxTestAssertElementText("//ul[@id='status']//label[@for='status_0']", 'Active');
$this->zbxTestAssertElementText("//ul[@id='status']//label[@for='status_1']", 'Passive');
$this->zbxTestAssertElementPresentXpath("//button[@value='proxy.create']");
$this->zbxTestAssertElementPresentXpath("//button[text()='Cancel']");
$this->zbxTestClickXpathWait("//ul[@id='status']//label[@for='status_1']");
$this->zbxTestWaitUntilElementVisible(WebDriverBy::id('ip'));
$this->zbxTestTextPresent(['Proxy name', 'Proxy mode', 'Interface', 'Description']);
$this->zbxTestTextPresent(['IP address', 'DNS name', 'Connect to', 'Port']);
$this->zbxTestAssertElementPresentId('host');