Sending error messages/logs to Percy-API, which will analyze and suggest some fixes for the issue that occurred.
The SuggestionResponse will be an array where each suggestion item will contain 3 thing
Failure: Failure title
FailureReason: string
Suggestion/summary: string
Reference Doc Links: Array of string
Errors are categorised in 2 cases
Build level error
Snapshot level error [ the format of response changes a little for this ]
Cases covered:
Snapshot command not called
Error occurred at starting Percy server
Launching browser
Error navigating to Page
Page load failed
Network idle timed-out
Error occurred at asset discovery, taking Snapshot, uploading snapshot stage.
Error occurred at uploading snapshot resource [ Pending: thinking of where to add this, as it doesn't throw any error only logs it ].
Error verifying comparison tile failure.
Reference pic:
For snapshot level:
[ Faillure Reason is not there on the API side yet, so it is coming empty string 😓 ]
Testing scenario:
1st and foremost priority is nothing should break on the existing flow. So an e2e
Web, automate, App Percy, ( using CLI commands like npx Percy snapshot, npx percy exec:start etc. )
Start the Percy server and terminate it. It should show [ No snapshot command was called ].
Port in use [ start a local server at 5338 ] and then start Percy server, it should hit Api for analysis.
Trying setting up throw new Errors at different places
Inside discover.js, snapshot.js
In browser.js [ under launch() function ]
and check if the Send for log analysis is getting called or not.
You may encounter that for some errors, there will be no suggestions as they are not added in our rule engine. Most common errors as handled, and should show suggestions for.
What is this?
Cases covered:
Reference pic:![Screenshot 2024-06-21 at 1 06 05 PM](https://github.com/percy/cli/assets/140813296/17eef7fd-c6ab-4cd1-8111-645203599918)
For snapshot level:
[ Faillure Reason is not there on the API side yet, so it is coming empty string 😓 ]
Testing scenario:
npx Percy snapshot
,npx percy exec:start
etc. )throw new Errors
at different placesRelated PR: https://github.com/percy/percy-api/pull/3678