[FE][TEST][E2E]- Cypress #34
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2023 Contributors to the Eclipse Foundation | |
# | |
# See the NOTICE file(s) distributed with this work for additional | |
# information regarding copyright ownership. | |
# | |
# This program and the accompanying materials are made available under the | |
# terms of the Apache License, Version 2.0 which is available at | |
# https://www.apache.org/licenses/LICENSE-2.0. | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
# License for the specific language governing permissions and limitations | |
# under the License. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
# Require to set secrets: | |
# - ORG_IRS_JIRA_USERNAME | |
# - ORG_IRS_JIRA_PASSWORD | |
name: "[FE][TEST][E2E]- Cypress" | |
on: | |
# triggered manually by Test Manager | |
workflow_dispatch: | |
inputs: | |
jira_filter_id: | |
description: 'Jira filter ID to fetch test scenarios' | |
required: false | |
# by default, we use this filter: https://jira.catena-x.net/issues/?filter=11645 | |
default: 11645 | |
# or automatically by merge to main | |
#push: | |
branches: main | |
paths: | |
- 'frontend/**' | |
jobs: | |
install: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: frontend | |
# Install YARN dependencies, cache them correctly | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Run yarn install | |
uses: Borales/actions-yarn@v5 | |
with: | |
cmd: install # will run `yarn install` command | |
# Fetch feature files | |
- name: Fetch .feature files from Jira Xray | |
env: | |
JIRA_USERNAME: ${{ secrets.ORG_IRS_JIRA_USERNAME }} | |
JIRA_PASSWORD: ${{ secrets.ORG_IRS_JIRA_PASSWORD }} | |
JIRA_FILTER_ID: ${{ github.event.inputs.jira_filter_id }} | |
working-directory: frontend | |
run: ./scripts/xray-download-feature-files.sh | |
- name: Save cypress/e2e folder | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cypress - e2e | |
if-no-files-found: error | |
path: frontend/cypress/e2e | |
overwrite: true | |
cypress-run-chrome: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: frontend | |
container: | |
# if you need to change image please make sure use the same version in all places | |
# (here and in cypress/Dockerfile) | |
image: cypress/browsers:node16.16.0-chrome107-ff107-edge | |
options: --user 1001 | |
needs: install | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download the cypress/e2e folder | |
uses: actions/download-artifact@v4 | |
with: | |
name: cypress - e2e | |
path: frontend/cypress/e2e | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Install Angular CLI | |
run: npm install -g @angular/cli | |
- name: Run yarn install | |
uses: Borales/actions-yarn@v5 | |
with: | |
cmd: install # will run `yarn install` command | |
dir: frontend | |
- name: Start Frontend Application | |
working-directory: frontend | |
run: | | |
npm run start:auth:e2ea & | |
sleep 60 && | |
curl http://localhost:4200 -I | |
- name: Cypress run all tests | |
uses: cypress-io/[email protected] # use the explicit version number | |
with: | |
browser: chrome | |
working-directory: frontend | |
# using wait-on parameter causes "Error: connect ECONNREFUSED 127.0.0.1:4200" | |
env: | |
CYPRESS_SUPERVISOR_LOGIN: ${{ secrets.TRACE_X_SUPERVISOR_LOGIN }} | |
CYPRESS_SUPERVISOR_PW: ${{ secrets.TRACE_X_SUPERVISOR_PW }} | |
CYPRESS_ADMIN_LOGIN: ${{ secrets.TRACE_X_ADMIN_LOGIN }} | |
CYPRESS_ADMIN_PW: ${{ secrets.TRACE_X_ADMIN_PW }} | |
CYPRESS_USER_LOGIN: ${{ secrets.TRACE_X_USER_LOGIN }} | |
CYPRESS_USER_PW: ${{ secrets.TRACE_X_USER_PW }} | |
CYPRESS_REDIRECT_URI: https://traceability-portal-e2e-a.dev.demo.catena-x.net/dashboard | |
- name: Submit results to Xray | |
# we don't want to submit results to xray when it was run by PR | |
if: github.event_name != 'pull_request' && (success() || failure()) | |
env: | |
JIRA_USERNAME: ${{ secrets.ORG_IRS_JIRA_USERNAME }} | |
JIRA_PASSWORD: ${{ secrets.ORG_IRS_JIRA_PASSWORD }} | |
run: | | |
./scripts/xray-push-test-results.sh | |
- name: Archive cypress artifacts | |
if: success() || failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cypress generated files - chrome | |
path: | | |
frontend/cypress/videos/ | |
frontend/cypress/screenshots/ | |
# cypress-run-firefox: | |
# timeout-minutes: 15 | |
# runs-on: ubuntu-latest | |
# defaults: | |
# run: | |
# working-directory: frontend | |
# container: | |
# # if you need to change image please make sure use the same version in all places | |
# # (here and in cypress/Dockerfile) | |
# image: cypress/browsers:node16.16.0-chrome107-ff107-edge | |
# options: --user 1001 | |
# needs: install | |
# | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# | |
# - name: Download the cypress/e2e folder | |
# uses: actions/download-artifact@v4 | |
# with: | |
# name: cypress - e2e | |
# path: frontend/cypress/e2e | |
# | |
# - name: Use Node.js 18.x | |
# uses: actions/setup-node@v4 | |
# with: | |
# node-version: 18.x | |
# | |
# - name: Cypress run all tests | |
# uses: cypress-io/[email protected] # use the explicit version number | |
# with: | |
# start: npm start | |
# wait-on: "http://localhost:4200" | |
# wait-on-timeout: 120 | |
# browser: firefox | |
# working-directory: frontend | |
# | |
# - name: Submit results to Xray | |
# # we don't want to submit results to xray when it was run by PR | |
# if: github.event_name != 'pull_request' && (success() || failure()) | |
# env: | |
# JIRA_USERNAME: ${{ secrets.ORG_IRS_JIRA_USERNAME }} | |
# JIRA_PASSWORD: ${{ secrets.ORG_IRS_JIRA_PASSWORD }} | |
# run: | | |
# ./scripts/xray-push-test-results.sh | |
# | |
# - name: Archive cypress artifacts | |
# if: success() || failure() | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: cypress generated files - firefox | |
# path: | | |
# frontend/cypress/videos/ | |
# frontend/cypress/screenshots/ | |
# | |
# cypress-run-webkit: | |
# timeout-minutes: 15 | |
# runs-on: ubuntu-latest | |
# defaults: | |
# run: | |
# working-directory: frontend | |
# needs: install | |
# | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# | |
# - name: Download the cypress/e2e folder | |
# uses: actions/download-artifact@v4 | |
# with: | |
# name: cypress - e2e | |
# path: frontend/cypress/e2e | |
# commented because if we use it here, we face with that problem: | |
# "http://localhost:4200 timed out on retry 151 of 5, elapsed 150449ms, limit 150000ms | |
# Error: connect ECONNREFUSED 127.0.0.1:4200" | |
# - name: Use Node.js 18.x | |
# uses: actions/setup-node@v4 | |
# with: | |
# node-version: 18.x | |
# - name: Use Node.js 16.x | |
# uses: actions/setup-node@v4 | |
# with: | |
# node-version: 16.x | |
# | |
# # https://docs.cypress.io/guides/guides/launching-browsers#Linux-Dependencies | |
# - name: Install additional dependencies | |
# run: npx playwright install --with-deps webkit | |
# | |
# - name: Cypress run all tests | |
# uses: cypress-io/[email protected] # use the explicit version number | |
# with: | |
# start: npm start:auth:e2ea | |
# wait-on: "http://localhost:4200" | |
# wait-on-timeout: 120 | |
# browser: webkit | |
# working-directory: frontend | |
# | |
# - name: Submit results to Xray | |
# # we don't want to submit results to xray when it was run by PR | |
# if: github.event_name != 'pull_request' && (success() || failure()) | |
# env: | |
# JIRA_USERNAME: ${{ secrets.ORG_IRS_JIRA_USERNAME }} | |
# JIRA_PASSWORD: ${{ secrets.ORG_IRS_JIRA_PASSWORD }} | |
# run: | | |
# ./scripts/xray-push-test-results.sh | |
# | |
# - name: Archive cypress artifacts | |
# if: success() || failure() | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: cypress generated files - webkit | |
# path: | | |
# frontend/cypress/videos/ | |
# frontend/cypress/screenshots/ |