Cypress not working with firefox in github actions #20687
solangeDev
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have this problem, in my local my tests running well with firefox, In the github action all tests not running, I test in local with the same firefox version. In my local all well.
My project is angular 12 with single spa
"dependencies": {
"@angular/animations": "~12.2.0",
"@angular/cdk": "^13.1.1",
"@angular/common": "~12.2.0",
"@angular/compiler": "~12.2.0",
"@angular/core": "~12.2.0",
"@angular/forms": "~12.2.0",
"@angular/platform-browser": "~12.2.0",
"@angular/platform-browser-dynamic": "~12.2.0",
"@angular/router": "~12.2.0",
"@auth0/angular-jwt": "^5.0.2",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"metises-cdk": "^1.0.169",
"moment": "^2.29.1",
"rxjs": "~6.6.0",
"single-spa": ">=4.0.0",
"single-spa-angular": "^5.0.2",
"systemjs": "^6.11.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
This the file for github actions, in chrome run well but not firefox
test_on_chrome:
runs-on: ubuntu-latest
needs: [ build ]
steps:
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
submodules: recursive
uses: actions/checkout@v2
with:
repository: timgchile/dockerfiles.git
ref: master
path: dockerfiles
token: ${{ secrets.GH_TOKEN }}
submodules: recursive
shell: bash
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
TAG="${BRANCH_NAME////-}"
if [[ ${TAG} == "master" ]]; then TAG="unstable"; fi
if [[
REAL_NAME=${{ github.event.repository.name }}
NAME=$(echo ${REAL_NAME}| sed 's/myapp-//g')
MS_NAME=$(echo ${REAL_NAME}| sed 's/myapp-mf-//g')
echo "::set-output name=real_name::${REAL_NAME}"
echo "::set-output name=name::${NAME}"
echo "::set-output name=ms_name::${MS_NAME}"
echo "::set-output name=branch::${TAG}"
echo "::set-output name=build_number::${GITHUB_RUN_NUMBER}"
id: repository_info
uses: actions/download-artifact@v2
with:
name: image
path: /tmp
run: |
docker load --input /tmp/image.tar
docker image ls -a
uses: docker/login-action@v1
with:
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.myapp_GCP_SA }}
shell: bash
run: |
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.0.0/docker-compose-linux-amd64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
TAG=${{ steps.repository_info.outputs.branch }}
docker pull us-docker.pkg.dev/myapp-com/myapp/mf-shell:unstable
docker tag us-docker.pkg.dev/myapp-com/myapp/mf-shell:unstable myapp/mf-main
docker tag us-docker.pkg.dev/myapp-com/myapp/mf-shell:unstable myapp/mf-shell
docker pull us-docker.pkg.dev/myapp-com/myapp/mf-dashboard:unstable
docker tag us-docker.pkg.dev/myapp-com/myapp/mf-dashboard:unstable myapp/mf-dashboard
docker tag us-docker.pkg.dev/myapp-com/myapp/${{ steps.repository_info.outputs.name }}:${{ steps.repository_info.outputs.branch }} myapp/spa
cp .github/workflows/files/docker-compose.yml docker-compose.yml
docker compose up -d
docker compose ps
docker compose exec cypress npm install --include=dev -f
while [[ $(docker compose ps mf-main --status running --format json | jq -r '.[].Health') != 'healthy' ]]; do
printf ">> \e[21m\e[32mwait mf-main service to come healthy its $(docker compose ps mf-main --status running --format json | jq -r '.[].Health')\n\e[0m"
docker compose ps mf-main | cut -d$'\n' -f 3
sleep 10
done
while [[ $(docker compose ps mf-shell --status running --format json | jq -r '.[].Health') != 'healthy' ]]; do
printf ">> \e[21m\e[32mwait mf-shell service to come healthy its $(docker compose ps mf-shell --status running --format json | jq -r '.[].Health')\n\e[0m"
docker compose ps mf-shell | cut -d$'\n' -f 3
sleep 10
done
while [[ $(docker compose ps mf-dashboard --status running --format json | jq -r '.[].Health') != 'healthy' ]]; do
printf ">> \e[21m\e[32mwait mf-dashboard service to come healthy its $(docker compose ps mf-dashboard --status running --format json | jq -r '.[].Health')\n\e[0m"
docker compose ps mf-dashboard | cut -d$'\n' -f 3
sleep 10
done
while [[ $(docker compose ps spa --status running --format json | jq -r '.[].Health') != 'healthy' ]]; do
printf ">> \e[21m\e[32mwait spa service to come healthy its $(docker compose ps spa --status running --format json | jq -r '.[].Health')\n\e[0m"
docker compose ps spa | cut -d$'\n' -f 3
sleep 10
done
docker compose ps
shell: bash
run: |
BROWSER="chrome"
CYPRESS_BUILD_ID="${GITHUB_RUN_NUMBER}-${GITHUB_SHA}"
docker compose exec cypress node_modules/.bin/cypress run
--headless
--browser "${BROWSER}"
--tag "${CYPRESS_BUILD_ID}"
--group "${CYPRESS_BUILD_ID}-${BROWSER}"
--ci-build-id "${CYPRESS_BUILD_ID}"
--record
--key ${{ secrets.myapp_CYPRESS_RECORD_KEY }}
--env GITHUB_TOKEN=${{ secrets.GH_TOKEN }} || (docker compose logs mf-main && docker compose logs mf-shell && docker compose logs mf-dashboard && docker compose logs spa && docker compose logs traefik && exit 1)
test_on_firefox:
runs-on: ubuntu-latest
needs: [ build ]
steps:
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
submodules: recursive
uses: actions/checkout@v2
with:
repository: timgchile/dockerfiles.git
ref: master
path: dockerfiles
token: ${{ secrets.GH_TOKEN }}
submodules: recursive
shell: bash
run: |
BRANCH_NAME=${GITHUB_REF#refs/heads/}
TAG="${BRANCH_NAME////-}"
if [[ ${TAG} == "master" ]]; then TAG="unstable"; fi
if [[
REAL_NAME=${{ github.event.repository.name }}
NAME=$(echo ${REAL_NAME}| sed 's/myapp-//g')
MS_NAME=$(echo ${REAL_NAME}| sed 's/myapp-mf-//g')
echo "::set-output name=real_name::${REAL_NAME}"
echo "::set-output name=name::${NAME}"
echo "::set-output name=ms_name::${MS_NAME}"
echo "::set-output name=branch::${TAG}"
echo "::set-output name=build_number::${GITHUB_RUN_NUMBER}"
id: repository_info
uses: actions/download-artifact@v2
with:
name: image
path: /tmp
run: |
docker load --input /tmp/image.tar
docker image ls -a
uses: docker/login-action@v1
with:
registry: us-docker.pkg.dev
username: _json_key
password: ${{ secrets.myapp_GCP_SA }}
shell: bash
run: |
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.0.0/docker-compose-linux-amd64 -o ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
TAG=${{ steps.repository_info.outputs.branch }}
docker pull us-docker.pkg.dev/myapp-com/myapp/mf-shell:unstable
docker tag us-docker.pkg.dev/myapp-com/myapp/mf-shell:unstable myapp/mf-main
docker tag us-docker.pkg.dev/myapp-com/myapp/mf-shell:unstable myapp/mf-shell
docker pull us-docker.pkg.dev/myapp-com/myapp/mf-dashboard:unstable
docker tag us-docker.pkg.dev/myapp-com/myapp/mf-dashboard:unstable myapp/mf-dashboard
docker tag us-docker.pkg.dev/myapp-com/myapp/${{ steps.repository_info.outputs.name }}:${{ steps.repository_info.outputs.branch }} myapp/spa
cp .github/workflows/files/docker-compose.yml docker-compose.yml
docker compose up -d
docker compose ps
docker compose exec cypress npm install --include=dev -f
while [[ $(docker compose ps mf-main --status running --format json | jq -r '.[].Health') != 'healthy' ]]; do
printf ">> \e[21m\e[32mwait mf-main service to come healthy its $(docker compose ps mf-main --status running --format json | jq -r '.[].Health')\n\e[0m"
docker compose ps mf-main | cut -d$'\n' -f 3
sleep 10
done
while [[ $(docker compose ps mf-shell --status running --format json | jq -r '.[].Health') != 'healthy' ]]; do
printf ">> \e[21m\e[32mwait mf-shell service to come healthy its $(docker compose ps mf-shell --status running --format json | jq -r '.[].Health')\n\e[0m"
docker compose ps mf-shell | cut -d$'\n' -f 3
sleep 10
done
while [[ $(docker compose ps mf-dashboard --status running --format json | jq -r '.[].Health') != 'healthy' ]]; do
printf ">> \e[21m\e[32mwait mf-dashboard service to come healthy its $(docker compose ps mf-dashboard --status running --format json | jq -r '.[].Health')\n\e[0m"
docker compose ps mf-dashboard | cut -d$'\n' -f 3
sleep 10
done
while [[ $(docker compose ps spa --status running --format json | jq -r '.[].Health') != 'healthy' ]]; do
printf ">> \e[21m\e[32mwait spa service to come healthy its $(docker compose ps spa --status running --format json | jq -r '.[].Health')\n\e[0m"
docker compose ps spa | cut -d$'\n' -f 3
sleep 10
done
docker compose ps
shell: bash
run: |
BROWSER="firefox"
CYPRESS_BUILD_ID="${GITHUB_RUN_NUMBER}-${GITHUB_SHA}"
docker compose exec cypress node_modules/.bin/cypress run
--headless
--browser "${BROWSER}"
--tag "${CYPRESS_BUILD_ID}"
--group "${CYPRESS_BUILD_ID}-${BROWSER}"
--ci-build-id "${CYPRESS_BUILD_ID}"
--record
--key ${{ secrets.myapp_CYPRESS_RECORD_KEY }}
--env GITHUB_TOKEN=${{ secrets.GH_TOKEN }} || (docker compose logs mf-main && docker compose logs mf-shell && docker compose logs mf-dashboard && docker compose logs spa && docker compose logs traefik && exit 1)
Beta Was this translation helpful? Give feedback.
All reactions