文件
mynode/packages/app-desktop/integration-tests/multiWindow.spec.ts
chen 301194963b
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
feat: Initial clean release of CHM
2026-11-04 11:29:39 +08:00

53 行
1.7 KiB
TypeScript

import { test } from './util/test';
import MainScreen from './models/MainScreen';
import NoteEditorScreen from './models/NoteEditor/NoteEditorScreen';
test.describe('multiWindow', () => {
// Disabled: Playwright's page.close() triggers a different code path than
// a user closing the window, causing the test to be unreliable.
// The fix works correctly in manual testing (see https://github.com/laurent22/joplin/issues/14628).
test.fixme('should not crash when closing a secondary window', async ({ mainWindow, electronApp }) => {
const mainPage = await new MainScreen(mainWindow).setup();
await mainPage.createNewNote('Test');
const window = await mainPage.openNewWindow(electronApp);
// Should load successfully
const screen = new NoteEditorScreen(window);
await screen.waitFor();
// Close the secondary window
await window.close();
// Wait for the Portal cleanup to complete before checking main window stability
await mainWindow.waitForTimeout(2000);
// Main window should remain stable — no white screen or renderer crash
await mainPage.noteEditor.waitFor();
});
test.fixme('should support quickly creating, then closing secondary windows', async ({ mainWindow, electronApp }) => {
const mainPage = await new MainScreen(mainWindow).setup();
await mainPage.createNewNote('Test');
const windows = [];
for (let i = 0; i < 4; i++) {
const window = await mainPage.openNewWindow(electronApp);
// Should load successfully
const screen = new NoteEditorScreen(window);
await screen.waitFor();
windows.push(window);
}
// Close them all, very quickly.
for (const window of windows) {
await window.close();
}
// Should not have crashed
await mainPage.noteEditor.waitFor();
});
});