0

I have an electron app with many webviews. I am testing it with Spectron. I have accelerators like

  • Cmd+ to zoom in
  • Cmd- to zoom out
  • Cmdr to reload the page

I read here that RobotJS can be used for the same. The problem is that

  1. RobotJS doesn't recognize the + key, - key, etc.
  2. I followed this and this link to make RobotJS work with electron. My electron version is 11.4.5. So I ran npm rebuild --runtime=electron --target=11.4.5 --disturl=https://atom.io/download/atom-shell --abi=67. When I run the test I get
The module '/Users/.../node_modules/robotjs/build/Release/robotjs.node'was compiled against a different Node.js version using
NODE_MODULE_VERSION 85. This version of Node.js requires
NODE_MODULE_VERSION 72. Please try re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`).

I tried using this stackoverflow link to fix the above version issue but to no avail.

I also tried using webdriver keys but it has no effect. I don't get any error but nothing happens when I run the integration test.

Update:

  1. I opened a Github issue on the RobotJS repo.
coda
  • 1,642
  • 2
  • 16
  • 23

0 Answers0