DEV: allows smoke test to run on macOS (#7735)
This commit is contained in:
parent
bae7b75e23
commit
8cd13b22a1
|
@ -2,12 +2,18 @@
|
|||
|
||||
desc "run chrome headless smoke tests on current build"
|
||||
task "smoke:test" do
|
||||
unless system("command -v google-chrome >/dev/null;")
|
||||
if RbConfig::CONFIG['host_os'][/darwin|mac os/]
|
||||
google_chrome_cli = "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
|
||||
else
|
||||
google_chrome_cli = "google-chrome"
|
||||
end
|
||||
|
||||
unless system("command -v \"#{google_chrome_cli}\" >/dev/null")
|
||||
abort "Chrome is not installed. Download from https://www.google.com/chrome/browser/desktop/index.html"
|
||||
end
|
||||
|
||||
if Gem::Version.new(`$(command -v google-chrome) --version`.match(/[\d\.]+/)[0]) < Gem::Version.new("59")
|
||||
abort "Chrome 59 or higher is required to run smoke tests in headless mode."
|
||||
if Gem::Version.new(`\"#{google_chrome_cli}\" --version`.match(/[\d\.]+/)[0]) < Gem::Version.new("59")
|
||||
abort "Chrome 59 or higher is required to run tests in headless mode."
|
||||
end
|
||||
|
||||
system("yarn install --dev")
|
||||
|
|
Loading…
Reference in New Issue