Skip to content

Commit 13c90bd

Browse files
authored
e2e: verify session tab click landed before reading metadata (#14903)
1 parent d92e201 commit 13c90bd

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

test/e2e/pages/sessions.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff 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(/tab-button--active/);
694+
}, `Select session tab: ${sessionId}`).toPass({ timeout: 10000 });
688695
}
689696

690697
const metadata = await this.extractMetadataFromDialog();

0 commit comments

Comments
 (0)