Skip to content

Commit

Permalink
support Chromium Browser (#4027)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rmott-littler authored and danepowell committed Feb 27, 2020
1 parent 0ce2101 commit e895d05
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Robo/Commands/Tests/TestsCommandBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();

Expand Down

0 comments on commit e895d05

Please sign in to comment.