require_once dirname(__FILE__).'/../include/CLegacyWebTest.php';
class testPageAdministrationGeneralImages extends CLegacyWebTest {
public static function allImages() {
return CDBHelper::getDataProvider('SELECT imageid,imagetype,name FROM images LIMIT 5');
public function testPageAdministrationGeneralImages_CheckLayoutIcons() {
$this->zbxTestLogin('zabbix.php?action=image.list');
$this->zbxTestAssertElementPresentXpath('//button[text()="Create icon"]');
$this->zbxTestCheckTitle('Configuration of images');
$this->zbxTestCheckHeader('Images');
$this->zbxTestTextPresent('Type');
$this->zbxTestDropdownHasOptions('imagetype', ['Icon', 'Background']);
$db_images = DBfetchArray(DBselect('SELECT name FROM images WHERE imagetype=1 LIMIT 5'));
$this->zbxTestTextPresent('No data found.');
foreach ($db_images as $db_image) {
$this->zbxTestAssertElementPresentXpath("//div[@id='image']//a[text()='".$db_image['name']."']");
public function testPageAdministrationGeneralImages_CheckLayoutBgImages() {
$this->zbxTestLogin('zabbix.php?action=image.list');
$this->zbxTestDropdownSelectWait('imagetype', 'Background');
$this->zbxTestAssertElementPresentXpath('//button[text()="Create background"]');
$this->zbxTestCheckTitle('Configuration of images');
$this->zbxTestCheckHeader('Images');
$this->zbxTestDropdownHasOptions('imagetype', ['Icon', 'Background']);
$db_images = DBfetchArray(DBselect('SELECT name FROM images WHERE imagetype=2 LIMIT 5'));
$this->zbxTestTextPresent('No data found.');
foreach ($db_images as $db_image) {