Closes #22028. Use new "Chrome for Testing" browser and driver.

This commit is contained in:
Miquel Simon 2023-06-16 09:19:08 +02:00 committed by Alexander Schwartz
parent c5d9e222db
commit 0dae40fc78
2 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1,38 @@
name: Install Chrome browser and driver for Testing
description: Download and install the latest available Chrome for Testing and Chromedriver
runs:
using: composite
steps:
- id: cache-chrome-browser
name: Chrome browser cache
uses: actions/cache@v3
with:
path: ./chrome
key: chrome
- id: cache-chromedriver
name: Chrome driver cache
uses: actions/cache@v3
with:
path: ./chromedriver
key: chromedriver
- id: install-chrome
name: Install Chrome
shell: bash
run: |
sudo apt-get remove google-chrome-stable
npx @puppeteer/browsers install chrome
npx @puppeteer/browsers install chromedriver
# In case there's more than one version of each package, let's use only the latest
LATEST_CHROME=$(ls -td $PWD/chrome/*/ | head -1)
LATEST_CHROMEDRIVER=$(ls -td $PWD/chromedriver/*/ | head -1)
sudo ln -s -f "${LATEST_CHROME}chrome-linux64/chrome" /usr/bin/chrome
sudo cp -u "${LATEST_CHROMEDRIVER}chromedriver-linux64/chromedriver" $CHROMEWEBDRIVER/
# Remove any older version of browser or driver so we don't keep it in the cache
cd chrome
rm -R $(ls -lt | grep '^d' | tail -1 | tr " " "\n" | tail -1)
cd ../chromedriver
rm -R $(ls -lt | grep '^d' | tail -1 | tr " " "\n" | tail -1)
cd ..

View file

@ -428,6 +428,11 @@ jobs:
name: Integration test setup name: Integration test setup
uses: ./.github/actions/integration-test-setup uses: ./.github/actions/integration-test-setup
- id: install-chrome
name: Install Chrome browser
uses: ./.github/actions/install-chrome
if: matrix.browser == 'chrome'
- name: Run Account Console IT - name: Run Account Console IT
run: ./mvnw test ${{ env.SUREFIRE_RETRY }} -Pauth-server-quarkus -Dtest=**.account2.**,!SigningInTest#passwordlessWebAuthnTest,!SigningInTest#twoFactorWebAuthnTest -Dbrowser=${{ matrix.browser }} "-Dwebdriver.chrome.driver=$CHROMEWEBDRIVER/chromedriver" "-Dwebdriver.gecko.driver=$GECKOWEBDRIVER/geckodriver" -f testsuite/integration-arquillian/tests/other/base-ui/pom.xml | misc/log/trimmer.sh run: ./mvnw test ${{ env.SUREFIRE_RETRY }} -Pauth-server-quarkus -Dtest=**.account2.**,!SigningInTest#passwordlessWebAuthnTest,!SigningInTest#twoFactorWebAuthnTest -Dbrowser=${{ matrix.browser }} "-Dwebdriver.chrome.driver=$CHROMEWEBDRIVER/chromedriver" "-Dwebdriver.gecko.driver=$GECKOWEBDRIVER/geckodriver" -f testsuite/integration-arquillian/tests/other/base-ui/pom.xml | misc/log/trimmer.sh
@ -458,6 +463,11 @@ jobs:
name: Integration test setup name: Integration test setup
uses: ./.github/actions/integration-test-setup uses: ./.github/actions/integration-test-setup
- id: install-chrome
name: Install Chrome browser
uses: ./.github/actions/install-chrome
if: matrix.browser == 'chrome'
- name: Run Forms IT - name: Run Forms IT
run: | run: |
TESTS=`testsuite/integration-arquillian/tests/base/testsuites/suite.sh forms` TESTS=`testsuite/integration-arquillian/tests/base/testsuites/suite.sh forms`
@ -493,6 +503,12 @@ jobs:
name: Integration test setup name: Integration test setup
uses: ./.github/actions/integration-test-setup uses: ./.github/actions/integration-test-setup
# Don't use Chrome for testing (just regular Chrome) until https://bugs.chromium.org/p/chromedriver/issues/detail?id=4533 is resolved
#- id: install-chrome
# name: Install Chrome browser
# uses: ./.github/actions/install-chrome
# if: matrix.browser == 'chrome'
- name: Run WebAuthn IT - name: Run WebAuthn IT
run: ./mvnw test ${{ env.SUREFIRE_RETRY }} -Pauth-server-quarkus -Dtest=org.keycloak.testsuite.webauthn.**.*Test -Dbrowser=${{ matrix.browser }} "-Dwebdriver.chrome.driver=$CHROMEWEBDRIVER/chromedriver" "-Dwebdriver.gecko.driver=$GECKOWEBDRIVER/geckodriver" -Pwebauthn -f testsuite/integration-arquillian/tests/other/pom.xml | misc/log/trimmer.sh run: ./mvnw test ${{ env.SUREFIRE_RETRY }} -Pauth-server-quarkus -Dtest=org.keycloak.testsuite.webauthn.**.*Test -Dbrowser=${{ matrix.browser }} "-Dwebdriver.chrome.driver=$CHROMEWEBDRIVER/chromedriver" "-Dwebdriver.gecko.driver=$GECKOWEBDRIVER/geckodriver" -Pwebauthn -f testsuite/integration-arquillian/tests/other/pom.xml | misc/log/trimmer.sh