Improve profile runtime controls (#868)
* Improve profile runtime controls * Restore profile selector test id * Update profile switch e2e flow
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user