fix(qa): inspect the refreshed HTML preview document

This commit is contained in:
Agent Workbench Dev
2026-11-04 20:13:54 +08:00
parent b4e1569cb8
commit 401a39a824
3 changed files with 10 additions and 2 deletions
+7 -2
View File
@@ -91,8 +91,13 @@ try {
await (await application.browserWindow(desktopPage)).evaluate(window => { window.showInactive(); window.setContentSize(1440, 960); });
await desktopPage.locator('.connection.connected').waitFor(); await desktopPage.getByRole('combobox', { name: '当前项目', exact: true }).selectOption(project.id);
await fileFlow(desktopPage, 'electron'); await overflow(desktopPage);
const rejected = await desktopPage.frameLocator('iframe').locator('body').evaluate(() => ({ bridge: typeof window.desktopWorkbench, require: typeof window.require }));
assert.deepEqual(rejected, { bridge: 'undefined', require: 'undefined' }); record('electron: preview subframe has no native bridge or Node');
// A saved-file refresh replaces the iframe. Reacquire its actual document
// for this read-only check if the old document detaches during inspection.
await expect(async () => {
const rejected = await desktopPage.frameLocator('iframe').locator('body').evaluate(() => ({ bridge: typeof window.desktopWorkbench, require: typeof window.require }));
assert.deepEqual(rejected, { bridge: 'undefined', require: 'undefined' });
}).toPass({ timeout: 10000 });
record('electron: preview subframe has no native bridge or Node');
await desktopPage.getByRole('button', { name: '源码', exact: true }).click();
// Exercise the actual Windows openDirectory dialog contract with an explicit
// cancelled fixture, without asking the user to select a test-only project.