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

Made '--debug-brk' parameter optional to be able run testcafe on Electron > 19 #92

Merged
merged 5 commits into from
Oct 12, 2022

Conversation

lenchvolodymyr
Copy link
Contributor

--debug-brk was deprecated since nodejs 7.7.0 and in electron 1.7.4 was added a support for --inspect. In Electron 19 --debug-brk was supressed and no longer works, which leads to an error: "Unable to connect".

I added a new option enableDebug that allows using an old parameter --debug-brk for Electron < 1.7.4 and use --inspect by default for newer Electron versions.

Related issue: #90

lenchvolodymyr and others added 2 commits August 5, 2022 11:26
@github-actions
Copy link

github-actions bot commented Aug 8, 2022

Thank you for your contribution to TestCafe. We will review this PR.

README.md Outdated
@@ -175,6 +175,10 @@ __Optional.__ `testcafe-browser-provider-electron` suppresses `did-navigate` and

__Optional.__ If `true`, DevTools will be opened just before tests start.

### enableDebug
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need an extra option.
You can calculating the module logic depending on Electron version:

  • if Electron < 19, use the old behavior (the --debug-brk=<port> will be used`).
  • if Electron >= 19, use the --inspect-brk=${ports[1]} parameter.

Copy link
Contributor Author

@lenchvolodymyr lenchvolodymyr Aug 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it, but how can I get the electron version?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a few ideas on how to implement it in another way. We will check them and update this thread as soon we have any news.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miherlosev any news here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if someone needs this update urgently, you can install it from fork, but hope changes will be released soon
npm i github:hackolade/testcafe-browser-provider-electron#feat/v0.0.19

@AndreyBelym
Copy link
Contributor

Hi @lenchvolodymyr! Thank you for your contribution. I discussed your PR with the team and we decided we should drop supporting older Electron versions that use the --debug-brk switch. This way there is no need for an additional option in the config. Please let me know if you are interested in reworking your PR. Otherwise, team members can do it in the next several weeks.

@lenchvolodymyr
Copy link
Contributor Author

Hi @AndreyBelym , this even better:

we decided we should drop supporting older Electron versions

I'll update PR soon

@lenchvolodymyr
Copy link
Contributor Author

@AndreyBelym it's done

@miherlosev
Copy link
Contributor

miherlosev commented Oct 6, 2022

Hi @lenchvolodymyr,

Thank you for your work. We will review it.

@AndreyBelym AndreyBelym merged commit 194ae8d into DevExpress:master Oct 12, 2022
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

Successfully merging this pull request may close these issues.

4 participants