test(e2e): smoke test verifying v0.2 inbox empty state
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) <noreply@anthropic.com>
This commit is contained in:
8
playwright.config.ts
Normal file
8
playwright.config.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { defineConfig } from '@playwright/test';
|
||||||
|
export default defineConfig({
|
||||||
|
testDir: './tests/e2e',
|
||||||
|
timeout: 60_000,
|
||||||
|
retries: 0,
|
||||||
|
workers: 1,
|
||||||
|
reporter: 'list'
|
||||||
|
});
|
||||||
14
tests/e2e/smoke.spec.ts
Normal file
14
tests/e2e/smoke.spec.ts
Normal file
@@ -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();
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user