Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress is executing twice, making an additional electron execution #974

Closed
Shashikapiletilevi opened this issue Jul 24, 2023 · 3 comments
Closed
Assignees
Labels
unexpected behavior User expected result, but got another

Comments

@Shashikapiletilevi
Copy link

I have the following Workflow,

name: End-to-end tests
on:
  push:

jobs:
  cypress-run:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          ref: epic/routing-tests

      - name: Cypress run
        uses: cypress-io/github-action@v5
        continue-on-error: true
        with:
          working-directory: shop
          start: npm run cypress:run
#          record: false
          #parallel: true # Runs test in parallel using settings above
#        env:
          # For recording and parallelization to work you must set your CYPRESS_RECORD_KEY
#          CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
#          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Upload screenshots
        uses: actions/upload-artifact@v3
        with:
          name: cypress-snapshots
          path: shop/cypress/screenshots



This is somehow been executed in github actions twice, once with the browser I have defined and another time with electron browser. I can see the node versions are different.

cypress2023-07-25 000858

@MikeMcC399
Copy link
Collaborator

@Shashikapiletilevi

The start parameter is intended to start a dev server. It is not designed to run the Cypress tests.

uses: cypress-io/github-action@v5 on its own will run the Cypress tests.

Remove

start: npm run cypress:run

and use the browser parameter to specify which browser you want to run the tests with, for example:

with:
    browser: chrome

@nagash77 nagash77 self-assigned this Jul 25, 2023
@Shashikapiletilevi
Copy link
Author

@MikeMcC399 Thanks. You are correct, that was my issue :)

@MikeMcC399
Copy link
Collaborator

@Shashikapiletilevi

You are correct, that was my issue

I'm happy that you have been able to correct your issue! I will make some documentation suggestions to better explain how the action works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unexpected behavior User expected result, but got another
Projects
None yet
Development

No branches or pull requests

3 participants