fix: release v1.0.3 预设渲染与语言搬运监督修复
web-platform-ci / Standalone decision service (no cloud credentials) (push) Has been cancelled
web-platform-ci / TypeScript, lint, unit, build (push) Has been cancelled
web-platform-ci / Playwright E2E (push) Has been cancelled
lekiwi-compatibility / cpu-compatibility (push) Has been cancelled

This commit is contained in:
2026-09-24 17:02:10 +08:00
parent 0d986f60bd
commit 7519309a27
17 changed files with 623 additions and 27 deletions
@@ -30,3 +30,39 @@ test('主工作台:加载预设、语言命名目标及连续自由坐标抓
await expect(page.getByRole('button', { name: '强化学习任务', exact: true })).toBeVisible();
await page.screenshot({ path: info.outputPath('language-workbench.png') });
});
test.describe('预设画布高 DPI 回归', () => {
test.use({ deviceScaleFactor: 2 });
test('主画布不被 DPR 放大裁切,双相机共用高分辨率绘图缓冲', async ({ page }) => {
let inference = 0;
await page.route('**/api/decision/v1/**', async (route) => {
if (/\/(command|plan|decide|test)$/.test(new URL(route.request().url()).pathname)) {
inference++;
await route.abort();
} else await route.continue();
});
await page.goto('/');
await page.getByRole('tab', { name: '控制台', exact: true }).click();
await page.getByRole('button', { name: '机器人语言控制', exact: true }).click();
const panel = page.getByLabel('机器人语言控制', { exact: true });
await panel.getByRole('button', { name: '载入预设场景' }).click();
await expect(panel.getByRole('status')).toContainText('预设已载入并暂停', { timeout: 90000 });
for (const name of ['腕部摄像头', '前置摄像头']) {
await page.getByRole('combobox', { name: '摄像头视角' }).selectOption({ label: name });
const size = await page
.locator('canvas')
.first()
.evaluate((canvas: HTMLCanvasElement) => ({
css: [canvas.clientWidth, canvas.clientHeight],
host: [canvas.parentElement!.clientWidth, canvas.parentElement!.clientHeight],
pixels: [canvas.width, canvas.height],
}));
expect(size.css).toEqual(size.host);
for (let i = 0; i < 2; i++) {
expect(size.pixels[i] / size.css[i]).toBeGreaterThanOrEqual(1.74);
expect(size.pixels[i] / size.css[i]).toBeLessThanOrEqual(2);
}
}
expect(inference).toBe(0);
});
});