Skip to content

Commit

Permalink
.......... [ZBXNEXT-686] added output the version of the browser
Browse files Browse the repository at this point in the history
(cherry picked from commit bda6360)
(cherry picked from commit 668ff81)
(cherry picked from commit afc3c4c)
  • Loading branch information
alexv123456 committed Oct 27, 2023
1 parent f48b5c8 commit 718a32a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
<replace file="ui/tests/bootstrap.php" token="{PHPUNIT_DATA_SOURCES_DIR}" value="${basedir}/ui/tests/selenium/data/sources/"/>
</target>

<target name="show-browser-info">
<exec executable="ui/tests/browser.php" failonerror="on"/>
</target>

<target name="create-saml-configs">
<property name="phpunit_simplesaml_baseurl" value="${PHPUNIT_SIMPLESAML_BASEURL}"/>
<property name="phpunit_sp_entity_id" value="${PHPUNIT_SP_ENTITY_ID}"/>
Expand Down Expand Up @@ -502,8 +506,8 @@
</target>

<target name="build-phpunit" depends="test-phpunit"/>
<target name="build-mysql" depends="init-frontend-mysql,test-frontend"/>
<target name="build-postgresql" depends="init-frontend-postgresql,test-frontend"/>
<target name="build-mysql" depends="init-frontend-mysql,show-browser-info,test-frontend"/>
<target name="build-postgresql" depends="init-frontend-postgresql,show-browser-info,test-frontend"/>
<target name="build-api-mysql" depends="init-api-mysql,test-api"/>
<target name="build-api-postgresql" depends="init-api-postgresql,test-api"/>
<target name="build-integration-mysql" depends="init-integration-mysql,test-integration"/>
Expand Down
27 changes: 27 additions & 0 deletions ui/tests/browser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/php

<?php

include __DIR__."/bootstrap.php";
include __DIR__."/include/web/CPage.php";

class CBrowserStats extends CPage {
public function getBrowserInfo() {
$capabilities = $this->driver->getCapabilities();

return [
"browser" => $capabilities->getBrowserName(),
"version" => $capabilities->getVersion()
];
}
}

$browser_stats = new CBrowserStats();
$info = $browser_stats->getBrowserInfo();
echo "***********************************************************\n".
"Frontend URL: ".PHPUNIT_URL."\n".
"Browser: ".$info["browser"]."\n".
"Version: ".$info["version"]."\n".
"PHP version: ".phpversion()."\n".
"***********************************************************\n";
$browser_stats->destroy();

0 comments on commit 718a32a

Please sign in to comment.