Github Actions with Cypress and Quasar

Viewed 267

I am trying to get GitHub actions to run Cypress test in a Vue/Quasar project with the quasar/testing extension which adds the following npm script

"test:e2e:ci": "cross-env E2E_TEST=true start-test \"quasar dev\" http-get://localhost:8080 \"cypress run\""

But all my tests fail because it looks like the app is stuck at the root route and can't assert for anything else that lives on other routes even tho the router should redirect there as it does on localhost, the very same script works flawlessly on localhost...

My GitHub CI file looks like this:

name: CI Build

on:
  pull_request:
    branches: [master]
    paths-ignore:
      - '**.md'
      - '**/android-build.yml'
      - '**/ios-build.yml'
      - '**/stage-build-deploy.yml'

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@master

      - name: Verify Changed files
        uses: tj-actions/verify-changed-files@v5
        id: changed_files
        with:
          files: |
            capacitor.config.json

      - name: Cancel build if files changed
        uses: andymckay/cancel-action@0.2
        if: steps.changed_files.outputs.files_changed == 'true'

      - name: Use Node.js 12
        uses: actions/setup-node@master
        with:
          node-version: '12.x'

      - name: Get npm cache directory
        id: npm-cache
        run: |
          echo "::set-output name=dir::$(npm config get cache)"

      - name: Cache node modules
        uses: actions/cache@master
        env:
          cache-name: cache-node-modules
        with:
          # npm cache files are stored in `~/.npm` on Linux/macOS
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
          restore-keys: |
            ${{ runner.os }}-node-

      - name: Install Dependencies
        if: steps.cache.outputs.cache-hit != 'true'
        run: npm install
 
      - name: Run Cypress Tests
        run: npm run test:e2e:ci
0 Answers
Related