require_once dirname(__FILE__) . '/../include/CWebTest.php';
require_once dirname(__FILE__).'/behaviors/CMessageBehavior.php';
require_once dirname(__FILE__).'/behaviors/CTableBehavior.php';
class testFormSetup extends CWebTest {
public function getBehaviors() {
public function testFormSetup_welcomeSectionLayout() {
$this->page->login()->open('setup.php')->waitUntilReady();
$this->assertEquals("Welcome to\nZabbix ".ZABBIX_EXPORT_VERSION, $this->query('xpath://div[@class="setup-title"]')->one()->getText());
$this->checkSections('Welcome');
$form = $this->query('xpath://form')->asForm()->one();
$language_field = $form->getField('Default language');
$this->assertEquals('English (en_GB)', $language_field->getValue());
$hint_text = 'You are not able to choose some of the languages, because locales for them are not installed '.
$this->assertEquals($hint_text, $this->query('xpath://button[@data-hintbox]')->one()
->getAttribute('data-hintbox-contents'));
$this->checkButtons('first section');
$this->assertScreenshot($form, 'Welcome_En');
$language_field->fill('Russian (ru_RU)');
$this->page->refresh()->waitUntilReady();
$this->assertEquals("Добро пожаловать в\nZabbix ".ZABBIX_EXPORT_VERSION, $this->query('xpath://div[@class="setup-title"]')->one()->getText());
$this->checkButtons('russian');
$this->assertScreenshotExcept($form, $this->query('id:default-lang')->one(), 'Welcome_Rus');
public function testFormSetup_prerequisitesSectionLayout() {
$this->page->login()->open('setup.php')->waitUntilReady();
$this->query('button:Next step')->one()->click();
$this->checkPageTextElements('Check of pre-requisites');
$headers = $this->query('class:list-table')->asTable()->one()->getHeadersText();
$this->assertEquals(['', 'Current value', 'Required', ''], $headers);
'PHP option "memory_limit"',
'PHP option "post_max_size"',
'PHP option "upload_max_filesize"',
'PHP option "max_execution_time"',
'PHP option "max_input_time"',