@@ -9,6 +9,18 @@ function main(page: Page) {
99 return page . locator ( 'main:visible' )
1010}
1111
12+ /**
13+ * A record's bar: the outermost block holding its Back navigation and not its heading, so a wrapper
14+ * around Back cannot stand in for the bar.
15+ */
16+ function recordBar ( page : Page , back : string ) {
17+ return main ( page )
18+ . locator ( 'div' )
19+ . filter ( { has : page . getByRole ( 'navigation' , { name : `${ back } navigation` } ) } )
20+ . filter ( { hasNot : page . getByRole ( 'heading' , { level : 1 } ) } )
21+ . first ( )
22+ }
23+
1224/** Record every DOM state of the content region while `action` runs. */
1325async function watchFrames ( page : Page , action : ( ) => Promise < void > ) {
1426 await page . evaluate ( ( ) => {
@@ -208,7 +220,7 @@ test('a record keeps its identifiers in its facts, and the rail line spans only
208220 await page . goto ( fixtureUrl ( '/workspace/it/issues/IT-136?state=full' ) )
209221 const facts = page . getByRole ( 'complementary' , { name : 'Facts' } )
210222 await expect ( facts . locator ( 'dd' , { hasText : / ^ I T - 1 3 6 $ / } ) ) . toBeVisible ( )
211- const bar = main ( page ) . getByRole ( 'navigation' , { name : 'Issues navigation' } ) . locator ( 'xpath=.. ')
223+ const bar = recordBar ( page , 'Issues' )
212224 await expect ( bar ) . toContainText ( 'Approve' )
213225 await expect ( bar ) . not . toContainText ( 'IT-136' )
214226 const rail = await facts . evaluate ( ( aside ) => {
@@ -246,9 +258,7 @@ test('a run opens its trace and selected step, with its execution ID among its f
246258 const executionId = new URL ( page . url ( ) ) . pathname . split ( '/' ) . at ( - 1 ) ?? ''
247259 const runFacts = main ( page ) . getByLabel ( 'Run facts' )
248260 await expect ( runFacts . locator ( 'dd' , { hasText : new RegExp ( `^${ executionId } $` ) } ) ) . toBeVisible ( )
249- await expect (
250- main ( page ) . getByRole ( 'navigation' , { name : 'Logs navigation' } ) . locator ( 'xpath=..' )
251- ) . not . toContainText ( executionId )
261+ await expect ( recordBar ( page , 'Logs' ) ) . not . toContainText ( executionId )
252262 const trace = main ( page ) . getByRole ( 'list' , { name : / s t e p s $ / } )
253263 await trace . getByRole ( 'button' , { name : / s e a r c h _ k n o w l e d g e / } ) . click ( )
254264 await expect ( main ( page ) . getByRole ( 'region' , { name : 'search_knowledge step' } ) ) . toContainText (
0 commit comments