cypress-log-to-output icon indicating copy to clipboard operation
cypress-log-to-output copied to clipboard

Electron support - possible solution?

Open Cleudi opened this issue 6 years ago • 7 comments

There is an env named ELECTRON_ENABLE_LOGGING=1 which seems to fix the electron issue. Can you please test this?

See also https://github.com/cypress-io/cypress/issues/3199#issuecomment-492728331

Cleudi avatar Jul 09 '19 14:07 Cleudi

There is an env named ELECTRON_ENABLE_LOGGING=1 which seems to fix the electron issue. Can you please test this?

I tried this today. But it didn't work. But it works okay with @xhubbsaxo's snippet

konekoya avatar Oct 07 '19 08:10 konekoya

You can also run Cypress with debug logs enabled to get the Electron logs in stderr:

  • On Linux/macOS: DEBUG=cypress:server:browsers:electron cypress ...
  • On Windows: npx cross-env DEBUG=cypress:server:browsers:electron cypress ...

It will share some extra data, but console.logs and stuff are in there too.

flotwig avatar Nov 07 '19 20:11 flotwig

Does the new browser launch API, with Cypress v4, make it possible to support Electron? https://docs.cypress.io/api/plugins/browser-launch-api.html#Usage

nmschulte-aviture avatar Mar 10 '20 16:03 nmschulte-aviture

unfortunately not @nmschulte-aviture

flotwig avatar Mar 16 '20 20:03 flotwig

You can also run Cypress with debug logs enabled to get the Electron logs in stderr:

  • On Linux/macOS: DEBUG=cypress:server:browsers:electron cypress ...
  • On Windows: npx cross-env DEBUG=cypress:server:browsers:electron cypress ...

It will share some extra data, but console.logs and stuff are in there too.

That works – thanks. But do you have an idea how we could filter + reformat the DEBUG-logs?

cypress:server:browsers:electron console message: { column: 1430321, level: 'log', line: 2, source: 'console-api', text: ' prev state color: #9E9E9E; font-weight: bold [object Object]', url: 'http://ui/static/js/2.feecd219.chunk.js' }
cypress:server:browsers:electron console message: { column: 1430441, level: 'log', line: 2, source: 'console-api', text: ' action     color: #03A9F4; font-weight: bold [object Object]', url: 'http://ui/static/js/2.feecd219.chunk.js' }

These super-noisy lines aren't helpful after all :(

pkyeck avatar Mar 15 '21 16:03 pkyeck

@pkyeck no possible way to do it currently. Maybe you could hack something by piping through awk/sed

flotwig avatar Mar 15 '21 16:03 flotwig

@flotwig yeah, already thought about that. But it's too late at this point because we have a lot of [object Object]s in there that should be stringified (or something similar) before printing them to stdout.

pkyeck avatar Mar 15 '21 20:03 pkyeck