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

Impossible to activate headed mode #403

Closed
nboisteault opened this issue Jul 22, 2021 · 9 comments
Closed

Impossible to activate headed mode #403

nboisteault opened this issue Jul 22, 2021 · 9 comments

Comments

@nboisteault
Copy link

Hi,
It seems impossible to activate headed mode with Cypress (8.0) and its Github action.
Look at https://github.com/nboisteault/lizmap-web-client/runs/3134874027?check_suite_focus=true#step:9:5 , I did put :

headless: false
headed: true

But action is ran headless : https://github.com/nboisteault/lizmap-web-client/runs/3134874027?check_suite_focus=true#step:9:51

Thanks for you help.

@Sergiu-B
Copy link

Sergiu-B commented Aug 3, 2021

Seeing the same issue. It's especially annoying when running visual regression tests, because headed vs headless renderings of the same page/ component are different. Same goes for using the clipboard which is unavailable in headless Chrome.

From what I see in the code it doesn't even look for the headed prop:
const headless = getInputBool('headless')

@juandavidkincaid
Copy link

+1

@andrewalc
Copy link

andrewalc commented Nov 30, 2021

realized this today after trying headless: false and seeing it still run in headless mode. seems misleading to me if the headless option is always the default anyway, would really appreciate a headed option

update: as a workaround i was able to get headed mode working by using the command option

    - name: Install Cypress and run tests
      uses: cypress-io/github-action@v2
      with:
        command: yarn cypress run --headed --browser chrome

@HansKre
Copy link

HansKre commented Dec 4, 2021

Thank you, @andrewalc!
A little hint for anyone coming here in the future, you still need to specify the build and start commands:

uses: cypress-io/github-action@v2
  with:
    build: npm run build
    start: npm start
    command: yarn cypress run --headed --browser chrome

@ricardo-dematos
Copy link

I noticed the same.

      - name: 'Run end-to-end tests'
        id: cypress
        timeout-minutes: 15
        uses: cypress-io/github-action@v5  # see https://github.com/cypress-io/github-action/issues/620
        env:
          ELECTRON_EXTRA_LAUNCH_ARGS: '--disable-gpu'  # see https://github.com/cypress-io/cypress/issues/25357
        with:
          working-directory: 'e2e-tests'
          config: 'specPattern="**/*.cy.ts"'
          env: 'host="${{ steps.setup.outputs.deployment_url }}",username="${{ steps.setup.outputs.deployment_username }}",password="${{ steps.setup.outputs.deployment_password }}"'
          browser: '${{ steps.setup.outputs.browser }}'
          headed: false
Run cypress-io/github-action@v5
  with:
    working-directory: ***-tests
    config: specPattern="**/*.cy.ts"
    env: host="***",username="***",***
    browser: edge
    headed: false
    record: false
    publish-summary: true
    component: false
  env:
    ELECTRON_EXTRA_LAUNCH_ARGS: --disable-gpu
(...)
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        12.17.1                                                                        │
  │ Browser:        Edge 114 (headless)                                                            │
  │ Node Version:   v16.16.0 (/home/runner/runners/2.305.0/externals/node16/bin/node)              │
  │ Specs:          6 found (login/login-message.cy.ts, login/login.cy.ts, login/reset-password.cy │
  │                 .ts, specifications/specifications.cy.ts, wizards/quick-start/quick-start-wiza │
  │                 rd.cy.ts, wizards/welcome/welcome-wizard.cy.ts)                                │
  │ Searched:       **/*.cy.ts                                                                     │
  │ Experiments:    experimentalMemoryManagement=true,experimentalWebKitSupport=true               │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

@MikeMcC399
Copy link
Collaborator

@ricardo-dematos

I don't see any remaining problem with github-action@v5 using the option headed: true or headed: false.

Could you please explain what you think should be different?

In your example you specified headed: false and Cypress ran headless, which is correct.

@ricardo-dematos
Copy link

@ricardo-dematos

I don't see any remaining problem with github-action@v5 using the option headed: true or headed: false.

Could you please explain what you think should be different?

In your example you specified headed: false and Cypress ran headless, which is correct.

You are absolutely correct! I misinterpreted the action option. :shame:

Should I delete these messages, to avoid confusing other users?

@MikeMcC399
Copy link
Collaborator

@ricardo-dematos

You are absolutely correct! I misinterpreted the action option. :shame:

Should I delete these messages, to avoid confusing other users?

Since you have commented on this stale issue it has become reactivated in the triage process.

I did check that headed: true and headed: false work as expected with Edge and the workflow to prove it is on https://github.com/MikeMcC399/github-action/actions/runs/5521971740

So I suggest to leave your comments and wait for a member of the Cypress team to pick up this issue.

My recommendation would be to close this issue as it is resolved and no longer reproducible.

@nagash77
Copy link
Contributor

Closing as resolved

alishaevn added a commit to notch8/webstore that referenced this issue Feb 13, 2024
when running specs locally with "cypress open" (headed), they pass.
they fail locally when running "cypress run"(headless) for timeout issues.
ci also runs headless, and gets timeout issues. I'm updating the config
to run headed in ci in an attempt to get them to pass.

ref: cypress-io/github-action#403 (comment)
alishaevn added a commit to notch8/webstore that referenced this issue Feb 13, 2024
the change in 3479ce0 still erred. I created a new
script for the cypress workflow to call specifically.

ref: cypress-io/github-action#403 (comment)
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

8 participants