octalmage / robotjs

Node.js Desktop Automation.
http://robotjs.io
MIT License
12.37k stars 961 forks source link

Harden screen test #568

Closed FossPrime closed 4 years ago

FossPrime commented 4 years ago

The screen test randomly fails if your window manager takes a little bit longer than normal. Which is particularly the case in large screens such as 4k+ monitors or slow GPUs.

I added an optional 1 second delay if the first attempt fails. In Mocha it runs in parallel, so using interval might slow down other tests without any real benefit... hence why I'm using timeout. Speaking of Mocha, it supports retries and is generally better supported than Jasmine... we should switch. The syntax is very similar.

oktapodia commented 4 years ago

Thank you for your PR