Skip to content

Commit 7758a94

Browse files
authored
🤖 fix: skip splash screen in E2E tests (#230)
## Problem E2E tests are flaky because `app.firstWindow()` grabs the splash screen instead of the main window. The test expects the "Projects" navigation to be visible, but that only exists in the main window. ## Solution Skip splash screen when `CMUX_E2E=1`. E2E tests don't need startup feedback and need deterministic window ordering. ## Testing E2E tests should now pass consistently. _Generated with `cmux`_
1 parent 3a22a64 commit 7758a94

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,11 @@ if (gotTheLock) {
378378
// 2. Load services while splash visible (fast - ~100ms)
379379
// 3. Create window and start loading content (splash stays visible)
380380
// 4. When window ready-to-show: close splash, show main window
381-
await showSplashScreen(); // Wait for splash to actually load
381+
//
382+
// Skip splash in E2E tests to avoid app.firstWindow() grabbing the wrong window
383+
if (!isE2ETest) {
384+
await showSplashScreen(); // Wait for splash to actually load
385+
}
382386
await loadServices();
383387
createWindow();
384388
// Note: splash closes in ready-to-show event handler

0 commit comments

Comments
 (0)