cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.47k stars 3.15k forks source link

Firefox crashes when uploaderButtonLink is clicked in headless mode #25607

Open manoj-fd opened 1 year ago

manoj-fd commented 1 year ago

Current behavior

While trying to click the uploaderButtonLink in firefox headless mode, getting crashed, screenshot mentioned below,

But the same working fine in Firefox normal mode and chrome/edge headless mode.

image

Desired behavior

Should be able to click uploaderButtonLink successfully in Firefox headless mode.

Test code to reproduce

cy.contains('or upload photo').click()

Cypress Version

11.2.0

Node version

v18.0.0

Operating System

macOS 12.6.1

ZachJW34 commented 1 year ago

I was able to reproduce this with a simple cy.get('input').click() given <input type="file" />

We don't recommend clicking the file-uploader but rather use the selectFile API. That said, I don't think Cypress should outright crash. Below are the debug logs collected:

cypress:launcher:browsers firefox stderr: Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error. +4ms
  cypress:launcher:browsers firefox stdout: [GFX1-]: Receive IPC close with reason=AbnormalShutdown +0ms
  cypress:launcher:browsers firefox exited: { code: 1, signal: null }

Cypress has no way to interact with the File Chooser window that spawns which is why the selectFile API exists. I'll get this routed to the appropriate team in the meantime.

sabrina-brunner-werk commented 1 year ago

We are currently encountering the same problem when running cypress tests in headless mode in firefox. In our implementation the browser crashes when uploading files using the SelectFile API. We are currently using Cypress v12.7.0, Node v18.6 and Ubuntu v22.04.

Below I have added the debug logs:

cypress:launcher:browsers firefox stderr: [Parent 7115, Main Thread] WARNING: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:167

(firefox:7115): Gtk-CRITICAL **: 12:13:39.770: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
[Parent 7115, Main Thread] WARNING: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:167

(firefox:7115): Gtk-CRITICAL **: 12:13:39.770: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed
[Parent 7115, Main Thread] WARNING: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed: 'glib warning', file /builds/worker/checkouts/gecko/toolkit/xre/nsSigHandlers.cpp:167

(firefox:7115): Gtk-CRITICAL **: 12:13:39.770: _gtk_style_provider_private_get_settings: assertion 'GTK_IS_STYLE_PROVIDER_PRIVATE (provider)' failed +16s
  cypress:launcher:browsers firefox stderr: ExceptionHandler::GenerateDump cloned child 8180
ExceptionHandler::SendContinueSignalToChild sent continue signal to child
ExceptionHandler::WaitForContinueSignal waiting for continue signal... +6ms
  cypress:launcher:browsers firefox exited: { code: 11, signal: null } +117ms
  cypress:server:preprocessor removeFile /home/sbrunner/web-tools/packages/lib-e-field/cypress/e2e/enum/import.cy.ts +31s
  cypress:server:preprocessor base emitter plugin close event +0ms
  cypress:server:preprocessor base emitter native close event +0ms
  cypress:server:preprocessor base emitter native close event +0ms
  cypress:server:browsers:firefox closing remote interface client +41s
  cypress:webpack close {filename} +22s
  cypress:launcher:browsers firefox stderr: Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error.
Exiting due to channel error. +11ms
faraktingi commented 1 month ago

hello @sabrina-brunner-werk, I get the same problem you described in your comment above. Did you finally find a solution please?