github-action icon indicating copy to clipboard operation
github-action copied to clipboard

Impossible to activate headed mode

Open nboisteault opened this issue 3 years ago • 4 comments

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.

nboisteault avatar Jul 22 '21 14:07 nboisteault

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')

Sergiu-B avatar Aug 03 '21 14:08 Sergiu-B

+1

juandavidkincaid avatar Oct 07 '21 13:10 juandavidkincaid

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

andrewalc avatar Nov 30 '21 14:11 andrewalc

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

HansKre avatar Dec 04 '21 19:12 HansKre

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               │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

ricardo-dematos avatar Jul 11 '23 15:07 ricardo-dematos

@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.

MikeMcC399 avatar Jul 11 '23 15:07 MikeMcC399

@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?

ricardo-dematos avatar Jul 11 '23 15:07 ricardo-dematos

@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.

MikeMcC399 avatar Jul 11 '23 15:07 MikeMcC399

Closing as resolved

nagash77 avatar Jul 12 '23 18:07 nagash77