Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
330 views
in Technique[技术] by (71.8m points)

vue.js - Github Actions with Cypress and Quasar

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/[email protected]
        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
question from:https://stackoverflow.com/questions/65917906/github-actions-with-cypress-and-quasar

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...