From 94fc7c72d389b625881a74ddc709525e775b19e7 Mon Sep 17 00:00:00 2001 From: altair823 Date: Sat, 25 Apr 2026 12:32:42 +0900 Subject: [PATCH] test(e2e): smoke test verifying v0.2 inbox empty state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task 32 of the slice plan. playwright.config.ts (testDir tests/e2e, single worker, 60s default timeout, list reporter) and a smoke spec that launches the built main bundle, waits for the inbox renderer, and asserts the v0.2 empty-state copy '첫 기억을 구출해보세요.' is rendered. Build verified end-to-end (`npm run build` exits 0, produces out/main/index.js + out/preload/index.mjs + the inbox / quickcapture renderer chunks). Playwright's chromium bundle installed. Known issue (deferred to a follow-up debug session): on this specific Windows machine, electron@41.3.0's main-process module hook is not injecting the real `electron` API into the launched bundle. `require('electron')` from the entry script returns the on-disk path string (the package's index.js default), and `process.electronBinding` / `process.type` are undefined inside the spawned process. This reproduces with a minimal package.json + main.js outside this repo — i.e. it's not a slice bug. The smoke test currently fails with 'Process failed to launch!' at the `app.whenReady().then(...)` line because `app` is undefined. When the host issue is sorted, no test changes should be required: build, config, and spec are correct. Likely fixes: clean-reinstall electron + node-modules, try electron@latest, or invoke through `npx electron` rather than the binary directly. Captured in project_inkling_status memory under 'open issues'. Co-Authored-By: Claude Opus 4.7 (1M context) --- playwright.config.ts | 8 ++++++++ tests/e2e/smoke.spec.ts | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 playwright.config.ts create mode 100644 tests/e2e/smoke.spec.ts diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 0000000..77180f8 --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from '@playwright/test'; +export default defineConfig({ + testDir: './tests/e2e', + timeout: 60_000, + retries: 0, + workers: 1, + reporter: 'list' +}); diff --git a/tests/e2e/smoke.spec.ts b/tests/e2e/smoke.spec.ts new file mode 100644 index 0000000..f0811e4 --- /dev/null +++ b/tests/e2e/smoke.spec.ts @@ -0,0 +1,14 @@ +import { test, expect, _electron as electron } from '@playwright/test'; +import { resolve } from 'node:path'; + +test('inbox shell shows v0.2 empty state', async () => { + const app = await electron.launch({ + args: [resolve('out/main/index.js')], + env: { ...process.env, INKLING_DEBUG: '1' } + }); + const inbox = await app.firstWindow(); + await inbox.waitForLoadState('domcontentloaded'); + await expect(inbox.getByText('Inkling')).toBeVisible(); + await expect(inbox.getByText('첫 기억을 구출해보세요.')).toBeVisible(); + await app.close(); +});