Skip to content

refactor: extract navigateToApiKeys helper to pages/settings.ts#813

Open
empiricalrun[bot] wants to merge 4 commits intomainfrom
chat-session_p8IH4C8qvk8F
Open

refactor: extract navigateToApiKeys helper to pages/settings.ts#813
empiricalrun[bot] wants to merge 4 commits intomainfrom
chat-session_p8IH4C8qvk8F

Conversation

@empiricalrun
Copy link
Copy Markdown
Contributor

@empiricalrun empiricalrun Bot commented Apr 2, 2026

Summary

Identified that the 3-step navigation pattern to the API Keys settings page was copy-pasted 15 times in api-keys.spec.ts (and once more in temp-api-keys-cleanup.spec.ts):

await page.goto("/");
// Navigate to the API keys section
await page.getByRole('link', { name: 'Settings' }).click();
await page.getByRole('link', { name: 'API Keys' }).click();

Changes

  1. Created tests/pages/settings.ts — new page helper file with a navigateToApiKeys(page) function, following the same pattern as existing helpers in tests/pages/ (e.g., navigateToSessions in sessions.ts).

  2. Updated tests/api-keys.spec.ts — replaced all 15 occurrences of the 3-line navigation block with await navigateToApiKeys(page) and added the import.

  3. Updated tests/temp-api-keys-cleanup.spec.ts — replaced the 1 occurrence similarly.

Test run

The refactored test was verified to pass:

  • API Keys > create new api key and make API requestReport

PR created from session #110928

Updated at 2026-04-02 04:56:30.790 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