File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,20 @@ export const runAriaSnapshotTest = ({
271271
272272 await page . waitForTimeout ( 1000 ) ; // We wait a little bit until everything loaded
273273
274- let snapshot = await page . locator ( 'main' ) . ariaSnapshot ( ) ;
274+ // Scope snapshot to the DBBreadcrumb section to avoid unrelated page-level landmarks
275+ const breadcrumbSection = page
276+ . getByRole ( 'heading' , { name : 'DBBreadcrumb' , level : 1 } )
277+ . locator ( 'xpath=ancestor::section[1]' ) ;
278+
279+ let snapshot : string ;
280+ try {
281+ // If the section exists, snapshot only that region
282+ await expect ( breadcrumbSection ) . toBeVisible ( { timeout : 5000 } ) ;
283+ snapshot = await breadcrumbSection . ariaSnapshot ( ) ;
284+ } catch {
285+ // Fallback to the full main snapshot if section resolution fails
286+ snapshot = await page . locator ( 'main' ) . ariaSnapshot ( ) ;
287+ }
275288
276289 // Remove `/url` in snapshot because they differ in every showcase
277290 const lines = snapshot . split ( '\n' ) ;
You can’t perform that action at this time.
0 commit comments