Skip to content

Commit

Permalink
Merge branch 'master' into http-proxy-support
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-shehane authored Feb 4, 2025
2 parents 65540ea + 72adfaa commit 88a454f
Show file tree
Hide file tree
Showing 19 changed files with 214 additions and 71 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/example-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:

jobs:
example:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand All @@ -22,6 +21,14 @@ jobs:
firefox-esr,
included-as-non-root
]
os: [
ubuntu-24.04, # testing Linux/amd64 platform
ubuntu-24.04-arm # testing Linux/arm64 platform
]
exclude:
- os: ubuntu-24.04-arm
directory: chrome-for-testing #browser not available for Linux/arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Run test script
Expand Down
38 changes: 38 additions & 0 deletions base-internal/releases/node-20/20.18.1-bullseye/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,44 @@ RUN apt-get update && \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

USER root

RUN node --version

# Install dependencies
RUN apt-get update && \
apt-get install -y \
fonts-liberation \
git \
libcurl4 \
libcurl3-gnutls \
libcurl3-nss \
libvulkan1 \
xdg-utils \
wget \
# needed for circle orb browsers to install firefox
gpg \
# needed for circle orb browsers to install chromedriver
jq \
curl \
# chrome dependencies
libu2f-udev \
# firefox dependencies
bzip2 \
# add codecs needed for video playback in firefox
# https://github.com/cypress-io/cypress-docker-images/issues/150
mplayer \
\
# clean up
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

# install libappindicator3-1 - not included with Debian 11
RUN wget --no-verbose /usr/src/libappindicator3-1_0.4.92-7_amd64.deb "http://ftp.us.debian.org/debian/pool/main/liba/libappindicator/libappindicator3-1_0.4.92-7_amd64.deb" && \
dpkg -i /usr/src/libappindicator3-1_0.4.92-7_amd64.deb ; \
apt-get install -f -y && \
rm -f /usr/src/libappindicator3-1_0.4.92-7_amd64.deb

# a few environment variables to make NPM installs easier
# good colors for most applications
ENV TERM=xterm
Expand Down
25 changes: 21 additions & 4 deletions examples/basic-mini/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
#!/bin/bash
set -e # fail on error
#
# Run in examples/basic-mini directory
# (amd64 only)
# Run ./scripts/test.sh in examples/basic-mini directory
#
echo Test base-mini with cypress/included in Chrome
docker run --rm -v .:/app -w /app --entrypoint cypress cypress/included run -b chrome
ARCHITECTURE=$(uname -m)
echo Running on $ARCHITECTURE

echo Test basic-mini example

case $ARCHITECTURE in
x86_64)
echo Testing cypress/included in amd64 using Chrome
docker run --rm -v .:/app -w /app --entrypoint cypress cypress/included run -b chrome
;;
aarch64)
echo Testing cypress/included in arm64 using Electron
echo No other browsers available
docker run --rm -v .:/app -w /app cypress/included
;;
*)
echo Unsupported architecture
exit 1
;;
esac
10 changes: 5 additions & 5 deletions examples/basic/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"private": true,
"devDependencies": {
"cypress": "^13.17.0"
"cypress": "^14.0.0"
}
}
28 changes: 22 additions & 6 deletions examples/basic/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
#!/bin/bash
set -e # fail on error
#
# Run in examples/basic directory
# (amd64 only)
# Run ./scripts/test.sh in examples/basic directory
#
ARCHITECTURE=$(uname -m)
echo Running on $ARCHITECTURE

echo Test basic example
npm ci # Install dependencies
npm ci # Install dependencies
echo Build and test with cypress/base in Electron
docker build -f Dockerfile.base -t test-base . # Build a new image
docker run --rm --entrypoint bash test-base -c "npx cypress run" # Run Cypress test in container
echo Build and test with cypress/browsers in Chrome
docker build -f Dockerfile.browsers -t test-browsers . # Build a new image
docker run --rm --entrypoint bash test-browsers -c "npx cypress run -b chrome" # Run Cypress test in container using Chrome

case $ARCHITECTURE in
x86_64)
echo Testing browsers in amd64
echo Build and test with cypress/browsers in Chrome
docker build -f Dockerfile.browsers -t test-browsers . # Build a new image
docker run --rm --entrypoint bash test-browsers -c "npx cypress run -b chrome" # Run Cypress test in container using Chrome
;;
aarch64)
echo Skipping browser tests for arm64
echo No browsers available
;;
*)
echo Unsupported architecture
exit 1
;;
esac
10 changes: 5 additions & 5 deletions examples/chrome-for-testing/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/chrome-for-testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"private": true,
"devDependencies": {
"@puppeteer/browsers": "^2.6.1",
"cypress": "^13.17.0"
"cypress": "^14.0.0"
}
}
54 changes: 35 additions & 19 deletions examples/chrome-for-testing/scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,40 @@ set -e # fail on error
#
# Test building and running custom Cypress Docker image with different
# versions of Chrome for Testing
# Run in directory examples/chrome-for-testing
# (amd64 only)
#
npm ci # Install dependencies
# Run ./scripts/test.sh in directory examples/chrome-for-testing
#
chromeVersion=(
'stable'
'beta'
'dev'
'canary'
'130'
'131.0.6778.204'
)
# Build, show Cypress info and run Cypress test
for i in ${!chromeVersion[@]}; do
echo
echo CHROME_VERSION ${chromeVersion[$i]}
docker build --build-arg CHROME_VERSION=${chromeVersion[$i]} -t test-chrome-for-testing .
docker run --rm --entrypoint bash test-chrome-for-testing -c "npx cypress info"
docker run --rm --entrypoint bash test-chrome-for-testing -c "npx cypress run --browser chrome-for-testing"
done
ARCHITECTURE=$(uname -m)
echo Running on $ARCHITECTURE

case $ARCHITECTURE in
x86_64)
echo Testing Chrome for Testing in amd64
npm ci # Install dependencies
#
chromeVersion=(
'stable'
'beta'
'dev'
'canary'
'130'
'131.0.6778.204'
)
# Build, show Cypress info and run Cypress test
for i in ${!chromeVersion[@]}; do
echo
echo CHROME_VERSION ${chromeVersion[$i]}
docker build --build-arg CHROME_VERSION=${chromeVersion[$i]} -t test-chrome-for-testing .
docker run --rm --entrypoint bash test-chrome-for-testing -c "npx cypress info"
docker run --rm --entrypoint bash test-chrome-for-testing -c "npx cypress run --browser chrome-for-testing"
done
;;
aarch64)
echo Skipping Chrome for Testing for arm64
echo This browser is not available for Linux/arm64
;;
*)
echo Unsupported architecture
exit 1
;;
esac
10 changes: 5 additions & 5 deletions examples/chromium/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/chromium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
},
"private": true,
"devDependencies": {
"cypress": "^13.17.0"
"cypress": "^14.0.0"
}
}
22 changes: 19 additions & 3 deletions examples/chromium/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
#!/bin/bash
set -e # fail on error
#
# Run in examples/chromium directory
# Run ./scripts/test.sh in examples/chromium directory
#
ARCHITECTURE=$(uname -m)
echo Running on $ARCHITECTURE

case $ARCHITECTURE in
x86_64)
echo Testing Chromium browser in amd64
;;
aarch64)
echo Testing Chromium browser in arm64
;;
*)
echo Unsupported architecture
exit 1
;;
esac

echo Test Chromium in cypress/base
npm ci # Install dependencies
docker build -t test-chromium . # Build a new image
npm ci # Install dependencies
docker build -t test-chromium . # Build a new image
docker run --rm --entrypoint bash test-chromium -c "npx cypress run --browser chromium" # Run Cypress test using Chromium
10 changes: 5 additions & 5 deletions examples/firefox-esr/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/firefox-esr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
},
"private": true,
"devDependencies": {
"cypress": "^13.17.0"
"cypress": "^14.0.0"
}
}
Loading

0 comments on commit 88a454f

Please sign in to comment.