selenium-ide icon indicating copy to clipboard operation
selenium-ide copied to clipboard

jest's console.log output is super slow in selenium-side-runner

Open karstenBriksoft opened this issue 3 years ago • 1 comments

🐛 Bug Report

We're using selenium-side-runner to run .side files. Our files contain quite a number of echo commands. The commands are transformed to Javascript code via selianize into console.log() calls. The output in stdout is then similar to this: console.log commons.js:5380 and on the next line the actual data from the echo command is shown.

After profiling a lengthly test-run i've noticed that long tests run slower than short tests. The reason for that is the commons.js:5380.

When jest is running a test, it'll try to give additional information about where a console.log was initiated from. That's a great idea when running tests, but it's useless information when using selenium-side-runner because the commons.js file is generated anyway.

A possible solution for the problem could be to inject let console = require("console"); at the beginning of the commons.js file. It doubled the execution time of my tests (which use tons of debug-output).

To Reproduce

  • create a .side file with plenty of echo commands

Expected behavior

  • the runtime should be reasonable even for large files

Environment

OS: Windows 10 Selenium IDE Version: na Selenium SIDE Runner Version: 3.17.0 Node version: na Browser: na Browser Version: na

karstenBriksoft avatar Mar 15 '22 17:03 karstenBriksoft

@karstenBriksoft - Thank you so much for the in-depth issue report! Through April, I'm committed to trying to get an alpha and beta of v4 of the IDE out, and after that, I'm going to be going 100% after these issues.

toddtarsi avatar Mar 15 '22 17:03 toddtarsi

Okay, I appear to have been lying. I'm not doing any v3 issues any more tbh, and I can tell you that this should be less bad now on v4. We no longer do the selianize thing. It's all a bit simpler now. We just use chromedriver for local playback so the side-runner basically does the tests in IDE and playback. There's no generated code. It's just a shared runtime. So, things should be a good bit quicker. I'm going to close this issue, but if you try v4 and it doesn't do this, feel free to re-open. Thanks!

toddtarsi avatar Nov 11 '22 03:11 toddtarsi

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Dec 12 '22 10:12 github-actions[bot]