chromaui / chromatic-e2e

Archive end-to-end tests to be replayed in Storybook and Chromatic
MIT License
13 stars 3 forks source link

Cypress Parallel Support #111

Open james-wallis opened 4 months ago

james-wallis commented 4 months ago

Is your feature request related to a problem? Please describe. Hi! I run Cypress & Percy tests in GitHub Workflows and using the cypress-io/github-action Action in parallel mode. This enables me to use a Matrix to run my Cypress tests in Parallel (taking them from 20 minutes to 5 minutes total so a big win).

I'm also able to use Percy to run snapshot testing in this Parallel system by supplying Percy specific environment variables and prefixing the Cypress command with percy exec -- npx.

Describe the solution you'd like

I want to know when/if Parallel Cypress tests will be supported within Chromatic / if they have then for the documentation to be updated (which I'm happy to do, just point me in the right direction).

Thanks!

Additional context Add any other context or screenshots about the feature request here.

My Cypress usage with Percy tokens:

      - name: Cypress tests
        uses: cypress-io/github-action@v4
        with:
          start: yarn start
          wait-on: "http://localhost:3000"
          wait-on-timeout: 120
          browser: chrome
          record: true
          parallel: true
          config-file: cypress.config.ts
          command-prefix: 'percy exec --parallel -- npx'
          group: "Skylark UI"
        env:
          CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
          PERCY_PARALLEL_TOTAL: 5
winkerVSbecks commented 2 months ago

@james-wallis Chromatic runs all your tests in parallel automatically, at no extra cost. Unlike Percy, you don't have to configure anything. Chromatic’s cloud infrastructure automatically scales to run all tests simultaneously.

Now, as for Cypress's parallel mode, I'm not sure how that impacts Chromatic. For Playwright, we recommend slightly adjusting the action to bundle the archives from all the sharded runs. I suspect, we might have to do something similar with Cypress. cc: @jonniebigodes

Chaos0929 commented 6 days ago

@james-wallis If I run cypress in parallel mode, there would be several chromatic-archives files in different machines, how can I run chromatic to test them in a storybook? I noticed that I could change the configuration of storybook, but I could not find a way to change the main.js file. Is there any other suggestions? https://www.chromatic.com/docs/monorepos/

image