DevExpress / testcafe-browser-provider-electron

This is the Electron browser provider plugin for TestCafe.
https://testcafe.io
MIT License
49 stars 30 forks source link

Allow debugging the stdout of the electron main process #53

Closed Raynos closed 4 years ago

Raynos commented 4 years ago

When using testcafe to run tests against an electron app we do not have any visibility into the behavior of the electron main process.

If anything writes to stdout or stderr its ignored by default.

Raynos commented 4 years ago

@AndreyBelym Any update on this PR ?

Improving debugging would be great and the change is pretty small.

If you want me to change the behavior like using a command line flag instead of an environment variable then I can do that too.

Raynos commented 4 years ago

I addressed feedback; cc @AndreyBelym

I looked at the source code of testcafe itself and it looks like the debug(testcafe:${scope}) convention is used.

Here I am using debug(testcafe:electron) and for these specific output lines I am using spawn:stdout and spawn:stderr` as the suffix so that stdout & stderr can be differentiated.

By using testcafe:electron:spawn we can add other debug log lines in the future for testcafe:electron:${some_feature}

By prefixing with testcafe: the upstream user can set DEBUG=testcafe:* when submitting a bug report to the DevExpress team and it will contain all debug logs related to testcafe incluidng first party browser providers like electron.

Raynos commented 4 years ago

This time actually passing CI. I can squash these commits if you want.

Raynos commented 4 years ago

Addressed feedback.

Raynos commented 4 years ago

@andreybelym

Thanks, addressed feedback again.

AndreyBelym commented 4 years ago

Thank you again, I will publish a new version in a couple of hours 👍

Raynos commented 4 years ago

@AndreyBelym The new version has not been published yet.

AndreyBelym commented 4 years ago

I apologize for the delay. testcafe-browser-provider-electron@0.0.14 contains this feature and should be available now.

Raynos commented 4 years ago

Awesome thanks.