Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: improve logs for e2e errors #28479

Merged
merged 9 commits into from
Nov 19, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion test/e2e/webdriver/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,20 @@ class Driver {

#getErrorFromEvent(event) {
// Extract the values from the array
const values = event.args.map((a) => a.value);
const values = event.args.map((a) => {
// Handle snaps error type
if (a && a.preview && Array.isArray(a.preview.properties)) {
return a.preview.properties
.filter((prop) => prop.value !== 'Object')
.map((prop) => prop.value)
.join(', ');
} else if (a.description) {
// Handle RPC error type
return a.description;
}
// Handle rest of error types
seaona marked this conversation as resolved.
Show resolved Hide resolved
return a.value;
});

if (values[0]?.includes('%s')) {
// The values are in the "printf" form of [message, ...substitutions]
Expand Down