feat(import): complete OpenAPI onboarding and verify delivery
This commit is contained in:
1 parent
bb3e376767
commit
e93de7015a
244 files changed
+57020
-5139
No files matched your search
@@ -133,6 +133,59 @@ test('optional Getting Started checklist is server-derived, resumable, bilingual
|
||||
await expect(page.getByTestId('onboarding-checklist')).toHaveCSS('scroll-behavior', 'auto');
|
||||
});
|
||||
|
||||
test('onboarding return context drops unknown query secrets and bounds allowlisted navigation context', async ({ page }) => {
|
||||
await login(page);
|
||||
const workspace = await getCurrentWorkspace(page);
|
||||
await routeOnboarding(page, async (route) => {
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify(onboardingSnapshot(workspace.id)),
|
||||
});
|
||||
});
|
||||
|
||||
await page.goto('/agents?onboarding=1&token=crk_return_secret_canary');
|
||||
if (!await page.getByTestId('onboarding-checklist').isVisible()) await page.getByTestId('onboarding-trigger').click();
|
||||
const returnContext = page.getByTestId('onboarding-return-context');
|
||||
await expect(returnContext).toHaveText('/agents?onboarding=1');
|
||||
await expect(returnContext).not.toContainText('crk_return_secret_canary');
|
||||
|
||||
await page.goto('/logs?log_id=' + 'a'.repeat(128) + '&agent_id=' + 'b'.repeat(128) + '&operation_id=' + 'c'.repeat(128));
|
||||
if (!await page.getByTestId('onboarding-checklist').isVisible()) await page.getByTestId('onboarding-trigger').click();
|
||||
await expect(page.getByTestId('onboarding-return-context')).toHaveText('/logs');
|
||||
await page.goto('/secrets?token=crk_return_secret_canary');
|
||||
if (!await page.getByTestId('onboarding-checklist').isVisible()) await page.getByTestId('onboarding-trigger').click();
|
||||
await expect(page.getByTestId('onboarding-return-context')).toHaveText('/secrets');
|
||||
});
|
||||
|
||||
test('a stale onboarding-pinned wizard version is rejected before loading or saving another Draft', async ({ page }) => {
|
||||
await login(page);
|
||||
const workspace = await getCurrentWorkspace(page);
|
||||
const operationId = 'op_pinned';
|
||||
let versionReads = 0;
|
||||
let writes = 0;
|
||||
await page.route(`**/workspaces/${workspace.id}/operations/${operationId}`, async (route) => {
|
||||
if (route.request().method() !== 'GET') writes += 1;
|
||||
await route.fulfill({ contentType: 'application/json', body: JSON.stringify({
|
||||
id: operationId, protocol: 'rest', current_draft_version: 3,
|
||||
draft_version_ref: { version: 3 },
|
||||
}) });
|
||||
});
|
||||
await page.route(`**/operations/${operationId}/versions/*`, async (route) => {
|
||||
versionReads += 1;
|
||||
await route.fulfill({ contentType: 'application/json', body: JSON.stringify({ version: 3 }) });
|
||||
});
|
||||
await page.goto(`/wizard/?mode=edit&operationId=${operationId}&operationVersion=2`);
|
||||
await page.waitForFunction(() => window.CrankWizardReady === true);
|
||||
await expect(page.locator('#wizard-live-status')).toBeVisible();
|
||||
await expect(page.locator('#tool-name')).not.toHaveValue('wrong newer Draft');
|
||||
await page.locator('.btn-save-draft').click();
|
||||
expect(versionReads).toBe(0);
|
||||
expect(writes).toBe(0);
|
||||
expect(await page.evaluate(() => window.wizardCurrentOperation)).toBeNull();
|
||||
|
||||
});
|
||||
|
||||
test('onboarding error exposes safe support correlation and retries without a client completion bypass', async ({ page }) => {
|
||||
await login(page);
|
||||
const workspace = await getCurrentWorkspace(page);
|
||||
@@ -156,6 +209,7 @@ test('onboarding error exposes safe support correlation and retries without a cl
|
||||
});
|
||||
|
||||
await page.goto('/');
|
||||
await expect(page.getByTestId('onboarding-trigger')).toContainText(/3\s*\/\s*7/);
|
||||
if (!await page.getByTestId('onboarding-checklist').isVisible()) {
|
||||
await page.getByTestId('onboarding-trigger').click();
|
||||
}
|
||||
@@ -183,7 +237,7 @@ test('validation, upstream and compatibility errors recover from the last author
|
||||
];
|
||||
let failureIndex = -1;
|
||||
await routeOnboarding(page, async (route) => {
|
||||
if (failureIndex >= 0) {
|
||||
if (failureIndex >= 0 && route.request().method() === 'GET') {
|
||||
const failure = failures[failureIndex];
|
||||
await route.fulfill({
|
||||
status: failure.status,
|
||||
@@ -201,6 +255,7 @@ test('validation, upstream and compatibility errors recover from the last author
|
||||
});
|
||||
|
||||
await page.goto('/');
|
||||
await expect(page.getByTestId('onboarding-trigger')).toContainText(/3\s*\/\s*7/);
|
||||
if (!await page.getByTestId('onboarding-checklist').isVisible()) {
|
||||
await page.getByTestId('onboarding-trigger').click();
|
||||
}
|
||||
@@ -237,7 +292,9 @@ test('authentication recovery returns to an incomplete authoritative onboarding
|
||||
});
|
||||
|
||||
await page.goto('/');
|
||||
await page.getByTestId('onboarding-trigger').click();
|
||||
if (!await page.getByTestId('onboarding-checklist').isVisible()) {
|
||||
await page.getByTestId('onboarding-trigger').click();
|
||||
}
|
||||
rejectOnce = true;
|
||||
await page.getByTestId('onboarding-refresh').click();
|
||||
await expect(page).toHaveURL(/\/login/);
|
||||
|
||||
Reference in new issue
Block a user