Skip to content

refactor: extract openToolsTab helper to pages/sessions#853

Open
empiricalrun[bot] wants to merge 7 commits intomainfrom
chat-session_ptfOIOtvpTjt
Open

refactor: extract openToolsTab helper to pages/sessions#853
empiricalrun[bot] wants to merge 7 commits intomainfrom
chat-session_ptfOIOtvpTjt

Conversation

@empiricalrun
Copy link
Copy Markdown
Contributor

@empiricalrun empiricalrun Bot commented Apr 16, 2026

Summary

Identified that page.getByRole('tab', { name: 'Tools', exact: true }).click() was repeated 13 times across 3 spec files:

  • tests/tool-execution/session.spec.ts (11 occurrences)
  • tests/my-sessions.spec.ts (1 occurrence)
  • tests/issues.spec.ts (1 occurrence)

Change

Added a single openToolsTab(page) helper function to tests/pages/sessions.ts and replaced all 13 inline usages across the 3 files.

export async function openToolsTab(page: Page): Promise<void> {
  await page.getByRole('tab', { name: 'Tools', exact: true }).click();
}

This follows the existing pattern in pages/sessions.ts where session UI interactions (e.g. navigateToSessions, createSession, sendMessage, closeSession) are centralised as reusable helpers, making tests more readable and easier to maintain.

PR created from session #119811

Updated at 2026-04-16 04:58:20.398 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants