Improve profile runtime controls (#868)

* Improve profile runtime controls

* Restore profile selector test id

* Update profile switch e2e flow
This commit is contained in:
ekko
2026-05-20 12:59:34 +08:00
committed by GitHub
parent 479fef8a84
commit 663afb61ff
15 changed files with 864 additions and 40 deletions
+3 -2
View File
@@ -98,9 +98,10 @@ test('uses the newly selected profile for the next chat-run socket after profile
}, defaultRun.run.session_id)
await expect(page.getByRole('button', { name: 'Stop' })).toHaveCount(0)
await page.locator('[data-testid="profile-selector-select"] .n-base-selection').click()
await page.getByTestId('profile-selector-select').click()
await expect(page.getByRole('dialog').filter({ hasText: 'research' })).toBeVisible()
const reloadPromise = page.waitForEvent('framenavigated', frame => frame === page.mainFrame())
await page.locator('.n-base-select-option', { hasText: /^research$/ }).click()
await page.locator('.profile-runtime-item').filter({ hasText: /^research/ }).getByRole('button', { name: 'Switch Profile' }).click()
await reloadPromise
await page.waitForLoadState('domcontentloaded')
await expect(page.getByTestId('profile-selector-select').filter({ hasText: 'research' })).toBeVisible()
+18
View File
@@ -159,6 +159,24 @@ export async function mockHermesApi(page: Page, options: MockHermesApiOptions =
return
}
if (pathname === '/api/hermes/profiles/runtime-statuses') {
await route.fulfill(jsonResponse({
profiles: [
{
profile: 'default',
bridge: { running: activeProfileName === 'default', profile: 'default', reachable: true },
gateway: { running: true, profile: 'default' },
},
{
profile: 'research',
bridge: { running: activeProfileName === 'research', profile: 'research', reachable: true },
gateway: { running: true, profile: 'research' },
},
],
}))
return
}
if (pathname === '/api/hermes/profiles/active') {
if (request.method() !== 'PUT') {
await route.fulfill(jsonResponse({ error: 'Method not allowed' }, 405))