Skip to content

Commit 71445d5

Browse files
committed
Add Chrome stable and beta tests
1 parent a773ad9 commit 71445d5

File tree

3 files changed

+22
-37
lines changed

3 files changed

+22
-37
lines changed

.github/workflows/test.yml

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ jobs:
1818
include:
1919
- job: lint
2020
INFO: "lint"
21-
# No BROWSER variable needed for linting
22-
# Don't test Chrome in non-mv3 codebase
2321
- job: firefox
2422
INFO: "Firefox"
2523
BROWSER: "firefox"
@@ -39,6 +37,15 @@ jobs:
3937
- job: edge-beta
4038
INFO: "Edge Beta"
4139
BROWSER: "microsoft-edge-beta"
40+
# Move Chrome tests into mv3 repo after testing:
41+
- job: chrome
42+
INFO: "Chrome"
43+
BROWSER: "google-chrome-stable"
44+
CHROME_VERSION: "stable"
45+
- job: chrome-beta
46+
INFO: "Chrome Beta"
47+
BROWSER: "google-chrome-beta"
48+
CHROME_VERSION: "beta"
4249
env:
4350
INFO: ${{ matrix.INFO }}
4451
BROWSER: ${{ matrix.BROWSER }}
@@ -73,39 +80,17 @@ jobs:
7380
with:
7481
edge-version: beta
7582
# Why do we test with Edge Beta but not Edge?
76-
77-
# - run: Xvfb :99 &
78-
# - name: Install Browser Dependencies # Firefox documentation
79-
# run: |
80-
# sudo apt update
81-
# # Install Xvfb (replacing xvfb in Travis services)
82-
# sudo apt-get install -y xvfb
83-
# # Install browsers as needed:
84-
# if [[ "${BROWSER}" == "firefox" ]]; then
85-
# sudo install -d -m 0755 /etc/apt/keyrings
86-
# wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
87-
# gpg -n -q --import --import-options import-show /etc/apt/keyrings/packages.mozilla.org.asc | awk '/pub/{getline; gsub(/^ +| +$/,""); if($0 == "35BAA0B33E9EB396F59CA838C0BA5CE6DC6315A3") print "\nThe key fingerprint matches ("$0").\n"; else print "\nVerification failed: the fingerprint ("$0") does not match the expected one.\n"}'
88-
# echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null
89-
# echo '
90-
# Package: *
91-
# Pin: origin packages.mozilla.org
92-
# Pin-Priority: 1000
93-
# ' | sudo tee /etc/apt/preferences.d/mozilla
94-
# sudo apt-get update && sudo apt-get install firefox
95-
# # Print the Firefox binary path
96-
# echo "Firefox binary path:"
97-
# which firefox
98-
# ls -l "$(which firefox)"
99-
# # Print the version to confirm it's installed correctly
100-
# firefox --version
101-
# elif [[ "${BROWSER}" == "microsoft-edge-beta" ]]; then
102-
# curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
103-
# sudo install -o root -g root -m 644 microsoft.gpg /usr/share/keyrings/
104-
# sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-beta.list'
105-
# sudo rm microsoft.gpg
106-
# sudo apt update
107-
# sudo apt install microsoft-edge-beta
108-
# fi
83+
84+
- name: Set up Chrome
85+
if: ${{ contains(matrix.BROWSER, 'chrome') }}
86+
uses: browser-actions/setup-chrome@v1
87+
with:
88+
chrome-version: ${{ matrix.CHROME_VERSION }}
89+
install-chromedriver: true
90+
91+
# - name: Install Chrome Driver
92+
# if: ${{ contains(matrix.BROWSER, 'chrome') }}
93+
# uses: browser-actions/setup-geckodriver@latest
10994

11095
- name: Run Setup Script
11196
run: ./scripts/setup_travis.sh

scripts/setup_travis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ check_browser() {
7979
case $INFO in
8080
*Chrome*)
8181
check_browser
82-
"$toplevel"/scripts/chromedriver.sh "$BROWSER" || exit 1
82+
# "$toplevel"/scripts/chromedriver.sh "$BROWSER" || exit 1
8383
install_python_deps
8484
;;
8585
*Firefox*)

tests/selenium/pbtest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def edge_manager(self):
190190
opts = EdgeOptions()
191191
opts.add_argument("--load-extension=" + self.extension_path)
192192
opts.add_argument("--headless")
193-
opts.add_argument("--edge-skip-compat-layer-relaunch") # https://github.com/SeleniumHQ/selenium/issues/15340#issuecomment-2689372248
193+
# opts.add_argument("--edge-skip-compat-layer-relaunch") # https://github.com/SeleniumHQ/selenium/issues/15340#issuecomment-2689372248
194194
opts.binary_location = self.browser_path
195195

196196
for i in range(5):

0 commit comments

Comments
 (0)