Verify real app restart and stopped-service restoration
This commit is contained in:
1 parent
0f26b6d072
commit
f78575792c
2 files changed
+12
-6
No files matched your search
@@ -54,10 +54,14 @@ test('existing work survives a full app restart and restarts a stopped service w
|
||||
expect(started).toMatchObject({ status: 'ready', browser: { state: 'attached' } });
|
||||
expect(await (await fetch(started.browser!.url)).text()).toBe(html);
|
||||
expect(await hostRequest(page, listPath)).toEqual(before);
|
||||
await page.evaluate(() => { window.location.hash = '/chat'; });
|
||||
await page.getByRole('tab', { name: '作品', exact: true }).click();
|
||||
await expect(page.getByRole('button', { name: '刷新网页', exact: true })).toBeEnabled();
|
||||
await expect(page.getByText('作品还没有打开', { exact: true })).toHaveCount(0);
|
||||
// Use the real native presentation route; this fixture has no authenticated
|
||||
// cloud account and must not fabricate one to enter the guarded Code UI.
|
||||
await hostRequest(page, '/api/agent-browser/present', { project_id: project.id, visible: true,
|
||||
bounds: { x: 20, y: 70, width: 420, height: 300 } });
|
||||
expect(await restarted.evaluate(async ({ webContents }, expectedUrl) => {
|
||||
const contents = webContents.getAllWebContents().find((item) => item.getURL() === expectedUrl);
|
||||
return await contents?.executeJavaScript('document.querySelector("h1")?.textContent');
|
||||
}, started.browser!.url)).toBe('My existing game');
|
||||
await page.screenshot({ path: test.info().outputPath('restored-work-without-model.png') });
|
||||
} finally {
|
||||
if (!serverClosed) await new Promise<void>((resolve) => server.close(() => resolve()));
|
||||
|
||||
Reference in new issue
Block a user