File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -188,6 +188,25 @@ def _compute_hash(self, text: str) -> str:
188188 """Compute SHA256 hash of text."""
189189 return hashlib .sha256 (text .encode ("utf-8" )).hexdigest ()
190190
191+ async def _best_effort_post_snapshot_digest (self , goal : str ) -> str | None :
192+ """
193+ Best-effort post-action snapshot digest for tracing (async).
194+ """
195+ try :
196+ snap_opts = SnapshotOptions (
197+ limit = min (10 , self .default_snapshot_limit ),
198+ goal = f"{ goal } (post)" ,
199+ )
200+ snap_opts .screenshot = False
201+ snap_opts .show_overlay = self .config .show_overlay if self .config else None
202+ post_snap = await snapshot_async (self .browser , snap_opts )
203+ if post_snap .status != "success" :
204+ return None
205+ digest_input = f"{ post_snap .url } { post_snap .timestamp } "
206+ return f"sha256:{ self ._compute_hash (digest_input )} "
207+ except Exception :
208+ return None
209+
191210 def _best_effort_post_snapshot_digest (self , goal : str ) -> str | None :
192211 """
193212 Best-effort post-action snapshot digest for tracing.
You can’t perform that action at this time.
0 commit comments