Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/scripts/github-actions/delete-browsers-drivers.sh
11810 views
1
#!/usr/bin/env bash
2
#
3
# Delete pre-installed browsers and WebDriver binaries so browser tests resolve
4
# the bazel-pinned / Selenium-Manager-downloaded versions instead of the system
5
# copies. Runs on Linux and macOS.
6
7
set -u
8
9
echo "Removing pre-installed drivers and browsers"
10
11
# Drivers: the runner exposes their locations via env vars on Linux and macOS.
12
# `--` guards against any env value that begins with a dash.
13
sudo rm -rf -- "${CHROMEWEBDRIVER:-}" "${EDGEWEBDRIVER:-}" "${GECKOWEBDRIVER:-}"
14
15
# Browsers: no env var points at these, so the paths are OS-specific.
16
if [ "${RUNNER_OS:-}" = "macOS" ]; then
17
sudo rm -rf -- "/Applications/Google Chrome.app" \
18
"/Applications/Firefox.app" \
19
"/Applications/Microsoft Edge.app"
20
else
21
sudo rm -rf -- /opt/google/chrome /opt/firefox /opt/microsoft/msedge
22
fi
23
24