mirror of
https://github.com/getpaseo/paseo.git
synced 2026-08-14 12:23:16 +00:00
* Update files * Git panel: share checkout actions Hoist checkout-scoped async git actions into a shared store and keep primary Push CTA loading in-place. Also stabilize e2e git flows. * Stabilize git panel async actions and fix e2e flakes
43 lines
1.5 KiB
TypeScript
43 lines
1.5 KiB
TypeScript
import { test, expect } from './fixtures';
|
|
|
|
test('no hosts shows welcome; direct connection adds host and lands on agent create', async ({ page }) => {
|
|
const daemonPort = process.env.E2E_DAEMON_PORT;
|
|
const serverId = process.env.E2E_SERVER_ID;
|
|
if (!daemonPort) {
|
|
throw new Error('E2E_DAEMON_PORT is not set (expected from globalSetup).');
|
|
}
|
|
if (!serverId) {
|
|
throw new Error('E2E_SERVER_ID is not set (expected from globalSetup).');
|
|
}
|
|
|
|
await page.addInitScript(() => {
|
|
localStorage.setItem('@paseo:daemon-registry', JSON.stringify([]));
|
|
localStorage.removeItem('@paseo:create-agent-preferences');
|
|
localStorage.removeItem('@paseo:settings');
|
|
});
|
|
|
|
await page.goto('/');
|
|
|
|
await expect(page.getByText('Welcome to Paseo', { exact: true })).toBeVisible();
|
|
|
|
await page.getByText('Direct connection', { exact: true }).click();
|
|
|
|
await page.getByPlaceholder('host:6767').fill(`127.0.0.1:${daemonPort}`);
|
|
|
|
await page.getByText('Connect', { exact: true }).click();
|
|
|
|
// First-time connection prompts for an optional label.
|
|
const nameModal = page.getByTestId('name-host-modal');
|
|
const showedNameModal = await nameModal
|
|
.waitFor({ state: 'visible', timeout: 5000 })
|
|
.then(() => true)
|
|
.catch(() => false);
|
|
if (showedNameModal) {
|
|
await nameModal.getByTestId('name-host-skip').click();
|
|
}
|
|
|
|
await expect(page.getByTestId('sidebar-new-agent')).toBeVisible();
|
|
await expect(page.getByText(serverId, { exact: true })).toBeVisible();
|
|
await expect(page.getByText('Online', { exact: true })).toBeVisible({ timeout: 15000 });
|
|
});
|