assertTrue(isset($db_map['sysmapid'])); $this->zbxTestLogin('sysmaps.php'); $this->zbxTestCheckTitle('Configuration of network maps'); $this->zbxTestClickLinkTextWait($map_name); $this->zbxTestContentControlButtonClickTextWait('Edit map'); // checking if appropriate value for grid size is selected $this->assertTrue($this->zbxTestGetValue('//z-select[@id="gridsize"]') == $db_map['grid_size']); // grid should be shown by default if ($db_map['grid_show'] == SYSMAP_GRID_SHOW_ON) { $this->zbxTestTextPresent('Shown'); $this->zbxTestTextNotPresent('Hidden'); } else { $this->zbxTestTextPresent('Hidden'); $this->zbxTestTextNotPresent('Shown'); } // auto align should be on by default if ($db_map['grid_align'] == SYSMAP_GRID_ALIGN_ON) { $this->zbxTestAssertElementText("//button[@id='gridautoalign']", 'On'); } else { $this->zbxTestAssertElementText("//button[@id='gridautoalign']", 'Off'); } // selecting new grid size $this->zbxTestDropdownSelect('gridsize', $gridSize); $this->zbxTestAssertElementValue('gridsize', strstr($gridSize, 'x', true)); // changing other two options if they are not already set as needed if (($db_map['grid_show'] == SYSMAP_GRID_SHOW_ON && $showGrid == 0) || ($db_map['grid_show'] == SYSMAP_GRID_SHOW_OFF && $showGrid == 1)) { $this->zbxTestClickWait('gridshow'); } if (($db_map['grid_align'] == SYSMAP_GRID_ALIGN_ON && $autoAlign == 0) || ($db_map['grid_align'] == SYSMAP_GRID_ALIGN_OFF && $autoAlign == 1)) { $this->zbxTestClickWait('gridautoalign'); } $this->zbxTestClickAndAcceptAlert('sysmap_update'); $db_map = CDBHelper::getRow('SELECT * FROM sysmaps WHERE name='.zbx_dbstr($map_name)); $this->assertTrue(isset($db_map['sysmapid'])); $this->assertTrue( $db_map['grid_size'] == substr($gridSize, 0, strpos($gridSize, 'x')) && $db_map['grid_show'] == $showGrid && $db_map['grid_align'] == $autoAlign ); $this->zbxTestClickLinkTextWait($map_name); $this->zbxTestContentControlButtonClickTextWait('Edit map'); // checking if all options remain as they were set $this->zbxTestDropdownAssertSelected('gridsize', $gridSize); if ($showGrid) { $this->zbxTestTextPresent('Shown'); $this->zbxTestTextNotPresent('Hidden'); } else { $this->zbxTestTextPresent('Hidden'); $this->zbxTestTextNotPresent('Shown'); } if ($autoAlign) { $this->zbxTestAssertElementText("//button[@id='gridautoalign']", 'On'); } else { $this->zbxTestAssertElementText("//button[@id='gridautoalign']", 'Off'); } } /** * Check the screenshot of the trigger container in trigger map element. */ public function testFormMap_MapElementScreenshot() { // Open map "Test map 1" in edit mode. $this->page->login()->open('sysmap.php?sysmapid=3')->waitUntilReady(); // Click on map element "Trigger element (CPU load)". $this->query('xpath://div[@data-id="5"]')->waitUntilVisible()->one()->click(); $form = $this->query('id:map-window')->asForm()->one()->waitUntilVisible(); $form->getField('New triggers')->selectMultiple([ 'First test trigger with tag priority', 'Fourth test trigger with tag priority', 'Linux: Lack of available memory' ], 'ЗАББИКС Сервер' ); $form->query('button:Add')->one()->click(); // Take a screenshot to test draggable object position for triggers of trigger type map element. // TODO: screenshot should be changed after fix ZBX-22528 $this->page->removeFocus(); $this->assertScreenshot($this->query('id:triggerContainer')->waitUntilVisible()->one(), 'Map element'); } }