Source
throw new Exception($message.' ('.$compare['error'].")\nReference saved: ".PHPUNIT_SCREENSHOT_URL.'ref_'.$name);
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 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 __DIR__.'/CTest.php';
require_once __DIR__.'/web/CPage.php';
require_once __DIR__.'/helpers/CXPathHelper.php';
require_once __DIR__.'/helpers/CImageHelper.php';
require_once __DIR__.'/../../include/classes/helpers/CMessageHelper.php';
require_once __DIR__.'/../../include/classes/routing/CUrl.php';
define('TEST_GOOD', 0);
define('TEST_BAD', 1);
define('TEST_ERROR', 2);
/**
* Base class for Selenium tests.
*/
class CWebTest extends CTest {
// Network throttling emulation modes.
const NETWORK_THROTTLING_NONE = 'none';
const NETWORK_THROTTLING_OFFLINE = 'offline';
const NETWORK_THROTTLING_SLOW = 'slow';
const NETWORK_THROTTLING_FAST = 'fast';
const HOST_LIST_PAGE = 'zabbix.php?action=host.list';
// Screenshot capture on error.
private $capture_screenshot = true;
// Screenshot taken on test failure.
private $screenshot = null;
// Errors captured during the test.
protected $errors = [];
// Failed test URL.
private $current_url = null;
// Browser errors captured during test.
private $browser_errors = null;
// Shared page instance.
private static $shared_page = null;
// Enable suppressing of browser errors on test case level.
private $supress_case_errors = false;
// Enable suppressing of browser errors on test suite level.
private static $supress_suite_errors = false;