@@ -149,8 +149,9 @@ async function testBasic(page: Page) {
149149
150150 // selecting steps should open source code view
151151 await expect ( page . getByTestId ( 'btn-report' ) ) . toContainClass ( 'tab-button-active' )
152- await traceStepNames . getByText ( 'Render simple' ) . click ( )
152+ await traceSteps . nth ( 0 ) . click ( )
153153 await expect ( page . getByTestId ( 'btn-code' ) ) . toContainClass ( 'tab-button-active' )
154+ await expect ( traceSteps . nth ( 0 ) ) . toBeFocused ( )
154155
155156 // verify source location highlight
156157 const activeLine = page . getByTestId ( 'editor' ) . locator ( '.CodeMirror-activeline' )
@@ -169,20 +170,32 @@ async function testBasic(page: Page) {
169170 // verify selector highlight
170171 await expect ( traceFrame . getByTestId ( 'trace-view-highlight' ) ) . toBeVisible ( )
171172
172- // selecting 2nd trace step and verify again
173- await traceStepNames . getByText ( 'Render another' ) . click ( )
173+ // selecting 2nd trace step with keyboard and verify again
174+ await traceSteps . nth ( 0 ) . press ( 'ArrowDown' )
174175 await expect ( traceFrame . getByRole ( 'button' , { name : 'Another' } ) ) . toBeVisible ( )
175176 await expect ( activeLine ) . toContainText ( 'Render another' )
176- await expect ( traceSteps . nth ( 1 ) ) . toHaveAttribute ( 'aria-current' , 'step' )
177+ await expect ( traceSteps . nth ( 1 ) ) . toBeFocused ( )
178+ await expect ( traceSteps . nth ( 1 ) ) . toHaveAttribute ( 'aria-selected' , 'true' )
177179 await expect ( traceEditorMarkers . nth ( 1 ) ) . not . toHaveAttribute ( 'aria-current' , 'step' )
178180 await expect ( traceEditorMarkers . nth ( 2 ) ) . toHaveAttribute ( 'aria-current' , 'step' )
179181
182+ await traceSteps . nth ( 1 ) . press ( 'End' )
183+ await expect ( traceSteps . nth ( 2 ) ) . toBeFocused ( )
184+ await expect ( traceSteps . nth ( 2 ) ) . toHaveAttribute ( 'aria-selected' , 'true' )
185+ await traceSteps . nth ( 2 ) . press ( 'ArrowDown' )
186+ await expect ( traceSteps . nth ( 2 ) ) . toBeFocused ( )
187+ await traceSteps . nth ( 2 ) . press ( 'Home' )
188+ await expect ( traceSteps . nth ( 0 ) ) . toBeFocused ( )
189+ await expect ( traceSteps . nth ( 0 ) ) . toHaveAttribute ( 'aria-selected' , 'true' )
190+ await traceSteps . nth ( 0 ) . press ( 'ArrowUp' )
191+ await expect ( traceSteps . nth ( 0 ) ) . toBeFocused ( )
192+
180193 // selecting 1st trace step from editor and verify again
181194 await traceEditorMarkers . nth ( 1 ) . click ( )
182195 await expect ( traceFrame . getByRole ( 'button' , { name : 'Simple' } ) ) . toBeVisible ( )
183196 await expect ( traceEditorMarkers . nth ( 1 ) ) . toHaveAttribute ( 'aria-current' , 'step' )
184197 await expect ( traceEditorMarkers . nth ( 2 ) ) . not . toHaveAttribute ( 'aria-current' , 'step' )
185- await expect ( traceSteps . nth ( 0 ) ) . toHaveAttribute ( 'aria-current ' , 'step ' )
198+ await expect ( traceSteps . nth ( 0 ) ) . toHaveAttribute ( 'aria-selected ' , 'true ' )
186199
187200 // verify selecting another test switches trace viewer
188201 await openExplorerItem ( page , 'switch-target' )
0 commit comments