Skip to content

Run All Tests Headless #48

Run All Tests Headless

Run All Tests Headless #48

Workflow file for this run

# https://github.com/marketplace/actions/cypress-io
name: Run All Tests Headless
on:
workflow_dispatch:
inputs:
ru:
description: The variable to be passed
required: false
default: TEST
schedule:
- cron: 0 7 * * 1
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
containers: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] # Uses 2 parallel instances
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.14.2
- name: Update & Install Ubuntu packages
run: |
env
sudo apt-get update && sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
- name: Update & Install NPM packages
run: |
npx browserslist@latest --update-db
npm ci
- name: Clear Report
run: |
echo "Clear the report"
npm run delete-mochawesome-report
npm run delete-results
- name: Run Tests
uses: cypress-io/github-action@v6
with:
browser: chrome
spec: 'cypress/e2e/**/*' # Run all tests. Same as empty string ''
env:
CYPRESS_RU: ${{ github.event.inputs.ru }}
SPLIT: ${{ strategy.job-total }}
SPLIT_INDEX: ${{ strategy.job-index }}
# CYPRESS_BASE_URL: '' # Fil in new baseUrl with https prefix
- name: Prepare report
if: success() || failure()
run: |
mkdir -p cypress/results/
cp -r cypress/reports/html/* cypress/results/
- name: Archive results
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: artifacts
path: |
cypress/results/**