test(pi): select packaged resilience target deterministically
This commit is contained in:
@@ -427,10 +427,27 @@ export async function runPackagedProductProof(options) {
|
||||
await page.getByTestId('main-layout').waitFor({ state: 'visible', timeout: 10_000 });
|
||||
}
|
||||
await page.evaluate(() => { window.location.hash = '/chat'; });
|
||||
const resilienceTarget = page.locator('aside').getByRole('button', {
|
||||
name: 'Resilience fault target',
|
||||
exact: true,
|
||||
});
|
||||
await resilienceTarget.waitFor({ state: 'visible', timeout: 30_000 });
|
||||
await resilienceTarget.click();
|
||||
const resilienceComposer = page.getByRole('textbox');
|
||||
await resilienceComposer.waitFor({ state: 'visible', timeout: 30_000 });
|
||||
await resilienceComposer.fill('RESILIENCE_TARGET_ACTIVE');
|
||||
await page.getByRole('button', { name: '发送' }).click({ timeout: 30_000 });
|
||||
try {
|
||||
await page.getByRole('button', { name: '发送' }).click({ timeout: 30_000 });
|
||||
} catch (error) {
|
||||
const [bodyText, status] = await Promise.all([
|
||||
page.locator('body').innerText().catch(() => '<unavailable>'),
|
||||
evaluateProof(electronApplication, 'resilience.status').catch(() => null),
|
||||
]);
|
||||
throw new Error(
|
||||
`${error instanceof Error ? error.message : String(error)}; `
|
||||
+ `UI=${bodyText}; resilience=${JSON.stringify(status?.resilience ?? status)}`,
|
||||
);
|
||||
}
|
||||
|
||||
const activeResilience = await waitForResilienceProof(
|
||||
electronApplication,
|
||||
|
||||
Reference in New Issue
Block a user