initialize Electron desktop app and remove unused files
Build / build (push) Canceled after 0s
Playwright / browser (push) Canceled after 0s

This commit is contained in:
2026-10-25 01:09:01 +08:00
commit 01d9e301fc
877 changed files with 262513 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
import { expect, test } from '@playwright/test'
import { mockHermesApi } from './fixtures'
test('a CLI timeout does not redirect to the installation guide', async ({ page }) => {
await mockHermesApi(page)
await page.route(url => url.pathname === '/api/hermes/cli-status', route => route.fulfill({
json: { available: false, reason: 'timeout', bin: '/opt/hermes/bin/hermes' },
}))
await page.goto('/')
await expect(page.getByPlaceholder('Username')).toBeVisible()
await expect(page.getByText('pip install hermes-agent')).toHaveCount(0)
})
for (const [reason, title] of [
['permission_denied', 'Hermes CLI cannot be executed'],
['failed', 'Hermes CLI failed to start'],
['missing', 'Hermes CLI not detected'],
]) {
test(`explains ${reason} and retries without waiting for the server cache`, async ({ page }) => {
await mockHermesApi(page)
let forced = false
await page.route(url => url.pathname === '/api/hermes/cli-status', async route => {
forced = new URL(route.request().url()).searchParams.get('refresh') === '1'
await route.fulfill({ json: { available: forced, reason: forced ? 'ready' : reason, bin: '/opt/hermes/bin/hermes' } })
})
await page.goto('/')
await expect(page.getByRole('heading', { name: title, exact: true })).toBeVisible()
if (reason !== 'missing') await expect(page.getByText('pip install hermes-agent')).toHaveCount(0)
await page.getByRole('button', { name: 'Re-check' }).click()
await expect(page.getByPlaceholder('Username')).toBeVisible()
expect(forced).toBe(true)
})
}