File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -683,8 +683,15 @@ export class Sessions {
683683 const isSingleSession = ( await this . getSessionCount ( ) ) === 1 ;
684684
685685 if ( ! isSingleSession && sessionId ) {
686- // Use force to bypass notification toasts that may overlay the tab
687- await this . page . getByTestId ( `console-tab-${ sessionId } ` ) . click ( { force : true } ) ;
686+ const targetTab = this . getSessionTab ( sessionId ) ;
687+ await expect ( async ( ) => {
688+ // Use force to bypass notification toasts that may overlay the tab. A
689+ // toast can also swallow the click outright (it's on top, so the real
690+ // tab never receives it) -- verify the tab actually went active instead
691+ // of assuming the click landed, and retry if it didn't.
692+ await targetTab . click ( { force : true } ) ;
693+ await expect ( targetTab ) . toHaveClass ( / t a b - b u t t o n - - a c t i v e / ) ;
694+ } , `Select session tab: ${ sessionId } ` ) . toPass ( { timeout : 10000 } ) ;
688695 }
689696
690697 const metadata = await this . extractMetadataFromDialog ( ) ;
You can’t perform that action at this time.
0 commit comments