Skip to content

refactor: extract navigateToToolsTab helper to pages/sessions.ts#881

Open
empiricalrun[bot] wants to merge 5 commits intomainfrom
chat-session_kn6o5pz11DId
Open

refactor: extract navigateToToolsTab helper to pages/sessions.ts#881
empiricalrun[bot] wants to merge 5 commits intomainfrom
chat-session_kn6o5pz11DId

Conversation

@empiricalrun
Copy link
Copy Markdown
Contributor

@empiricalrun empiricalrun Bot commented Apr 29, 2026

Summary

Extracted a commonly repeated inline pattern into a reusable helper method in tests/pages/sessions.ts.

Pattern extracted

The expression:

await page.getByRole('tab', { name: 'Tools', exact: true }).click();

...appeared 13 times across 3 test files but was never in a shared helper. This PR introduces:

/**
 * Navigates to the Tools tab in the session detail view.
 *
 * Assumes the page is already on a session detail page.
 *
 * @param page The Playwright page object
 */
export async function navigateToToolsTab(page: Page): Promise<void> {
  await page.getByRole('tab', { name: 'Tools', exact: true }).click();
}

Files changed

File Change
tests/pages/sessions.ts Added navigateToToolsTab helper
tests/tool-execution/session.spec.ts Replaced 11 inline usages with helper call
tests/my-sessions.spec.ts Replaced 1 inline usage with helper call
tests/issues.spec.ts Replaced 1 inline usage with helper call

This is a pure refactor — no test logic changed, just consolidated duplication into a single, well-documented helper consistent with the patterns already in pages/sessions.ts.

PR created from session #126049

Updated at 2026-04-29 04:56:05.866 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