Source
$this->zbxTestAssertElementPresentXpath('//div[@class="msg-details"]//li[contains(text(), '.CXPathHelper::escapeQuotes($string).')]');
<?php
/*
** Zabbix
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once 'vendor/autoload.php';
require_once dirname(__FILE__).'/CWebTest.php';
use Facebook\WebDriver\WebDriverBy;
use Facebook\WebDriver\Exception\StaleElementReferenceException;
/**
* Base class for legacy Selenium tests.
*/
class CLegacyWebTest extends CWebTest {
const WAIT_ITERATION = 50;
// List of strings that SHOULD appear on every page.
public $failIfNotExists = [
'Zabbix Integrations',
'Help',
'Admin',
'Sign out'
];
protected function putBreak() {
fwrite(STDOUT, "\033[s \033[93m[Breakpoint] Press \033[1;93m[RETURN]\033[0;93m to continue...\033[0m");
while (fgets(STDIN, 1024) == '') {}
fwrite(STDOUT, "\033[u");
return;
}
public function authenticate() {
$this->page->login('09e7d4286dfdca4ba7be15e0f3b2b55a', 1);
}
public function authenticateUser($sessionid, $userId) {
$this->page->login($sessionid, $userId);
}
public function zbxTestOpen($url) {
$this->page->open($url);
}
public function zbxTestLogin($url, $server_name = true) {
global $ZBX_SERVER_NAME;