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

use viewport in github actions #635

Closed
SaadUsmanitk opened this issue Nov 18, 2022 · 3 comments
Closed

use viewport in github actions #635

SaadUsmanitk opened this issue Nov 18, 2022 · 3 comments

Comments

@SaadUsmanitk
Copy link

is there any way to use set viewport in github actions?

@kryshenp
Copy link

kryshenp commented Nov 24, 2022

I've solved it by creating a separate config file named cypress-ci.config.ts, which is identical to cypress.config.ts, but I removed viewportHeight, viewportWidth parameters from there.

In my github action I can set my own viewportHeight & viewportWidth. config file is my cypress-ci.config.ts, that doesn't contain viewportHeight, viewportWidth parameters.

     - name: Cypress run
        uses: cypress-io/github-action@032c1ed6197b579a85b6759a05daa6370ea71f8b # v4.2.1
        env:
          CYPRESS_BASE_URL: ${{ inputs.base-url }}
        with:
          browser: ${{ inputs.browser }}
          spec: ${{ inputs.specs }}
          working-directory: cypress
          install-command: npm ci
          headed: ${{ inputs.headed }}
          config-file: cypress-ci.config.ts
          config: video=${{ inputs.video == 'true' && 'true' || 'false' }},retries=2,viewportHeight=1243,viewportWidth=1792

Of course, you could set viewportHeight & viewportWidth from workflow input, for example:
config: viewportHeight=${{ github.event.inputs.viewportHeight }},viewportWidth=${{ github.event.inputs.viewportWidth }}

@MikeMcC399
Copy link
Collaborator

@SaadUsmanitk

Did the answer from @kryshenp help you?

There is nothing specific in github-action regarding viewports.

@MikeMcC399
Copy link
Collaborator

Closing as this is a stale issue.

@MikeMcC399 MikeMcC399 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants