From 859988d168c921ecf939ae090a156fc01efbc233 Mon Sep 17 00:00:00 2001 From: meirk-brd Date: Tue, 2 Dec 2025 17:25:53 +0200 Subject: [PATCH] Handle non-string Playwright snapshots without crashing --- aria_snapshot_filter.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aria_snapshot_filter.js b/aria_snapshot_filter.js index abb877d..b6e4e0e 100644 --- a/aria_snapshot_filter.js +++ b/aria_snapshot_filter.js @@ -65,6 +65,16 @@ export class Aria_snapshot_filter { } static filter_snapshot(snapshot_text){ + if (typeof snapshot_text!=='string') + { + try { + return typeof snapshot_text==='object' + ? JSON.stringify(snapshot_text, null, 2) + : String(snapshot_text); + } catch(e){ + return String(snapshot_text); + } + } try { const elements = this.parse_playwright_snapshot(snapshot_text); if (elements.length==0)