argos-ci / argos-javascript

Official Argos SDKs for JavaScript
https://docs.argos-ci.com
MIT License
8 stars 5 forks source link

Improvement: I want to see which argos stabilizer failed so I can troubleshoot failed screenshots #133

Open tommy-anderson opened 2 months ago

tommy-anderson commented 2 months ago

Bug description

Argos has some internal stabilizers

waitForNoBusy
waitForImagesToLoad
waitForFontsToLoad

sometimes when taking screenshots they fail, and It's very hard to troubleshoot what happened.

Correct behavior expected

I want to see for that img src=X has not loaded, or that there are 2 elements with aria-busy currently on page.

Wrong behavior observed

Screenshot 2024-07-01 at 12 41 11 PM

Logs are not useful, and need to actually go into node_modules and add console messages to debug.

Reproduce

Have a image with a bad src in the page you're trying to screenshot. And screenshot it.

Notes

I wanted to open a PR where I would just add the errorMsg property to the waitUntil call, but since you currently have everything in a single function waitForStability the change would involve modifying the way stabilization is done, and would be too opinionated.

gregberge commented 2 months ago

Hello @tommy-anderson, yeah it would definitely be a good improvement. What we would do is another function to get some debug information: "what caused waitForStability" to not wait. So we could call this function in the error message to get debug information. What do you think?

tommy-anderson commented 1 month ago

Sure that could work !