From e895d05b6b9ac596f4b218c4715fc1d100ba9548 Mon Sep 17 00:00:00 2001 From: rmott-littler <44675841+rmott-littler@users.noreply.github.com> Date: Wed, 26 Feb 2020 19:39:06 -0600 Subject: [PATCH] support Chromium Browser (#4027) Relax the browser check to allow for chromium-browser as a direct alternative to google-chrome. Add a fallback for binary name and improve the version match. --- src/Robo/Commands/Tests/TestsCommandBase.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Robo/Commands/Tests/TestsCommandBase.php b/src/Robo/Commands/Tests/TestsCommandBase.php index 3c2b63155..7f99a01d1 100644 --- a/src/Robo/Commands/Tests/TestsCommandBase.php +++ b/src/Robo/Commands/Tests/TestsCommandBase.php @@ -135,6 +135,10 @@ protected function findChrome() { return 'google-chrome'; } + if ($this->getInspector()->commandExists('chromium-browser')) { + return 'chromium-browser'; + } + $osx_path = "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"; if (EnvironmentDetector::isDarwin() && file_exists($osx_path)) { return $osx_path; @@ -154,7 +158,7 @@ protected function findChrome() { */ protected function checkChromeVersion($bin) { $version = (int) $this->getContainer()->get('executor') - ->execute("'$bin' --version | cut -f3 -d' ' | cut -f1 -d'.'") + ->execute("'$bin' --version | cut -f1 -d'.' | rev | cut -f1 -d' ' | rev") ->run() ->getMessage();