iblai-test
/iblai-test
AI Assistant: You MUST run these checks before presenting any work to the user. Do NOT show untested code.
Step 1: Build
Run the production build to catch TypeScript errors, missing imports, and config issues:
npm run build # or: pnpm build
Fix all errors. A failed build means broken code -- do not proceed until the build passes cleanly.
Step 2: Run Unit Tests
npm run test # or: pnpm test
This runs vitest to verify:
- All
@sourcepaths in CSS files resolve to existing directories - The
lib/iblai/sdksymlink is valid and targets the SDK dist lib/iblai/sdk/web-containers/sourcecontains compiled JS for Tailwind class generation
If tests fail, the SDK symlink may be broken. Run ls -la lib/iblai/sdk
to check. If it's missing, run iblai add auth again to recreate it.
Step 3: Touch Test Pages
If this is an agent app (from iblai startapp agent)
The app already has a full Playwright E2E suite in e2e/. Use it:
pnpm test:e2e
This runs auth setup + journey tests across Chromium, Firefox, and WebKit.
Configure credentials in e2e/.env.development first.
For a single browser:
npx playwright test --config e2e/playwright.config.ts --project=chromium
If this is a vanilla Next.js app
Install Playwright and a browser:
npm install -D @playwright/test
npx playwright install --with-deps chromium
--with-deps installs the browser binary AND system libraries (libatk,
libcups, etc.). Without it the browser may fail to launch on Linux/CI.
For system deps only: npx playwright install-deps
For browser binaries only: npx playwright install
Start the dev server:
npm run dev &
Wait for http://localhost:3000 to be ready, then screenshot every page you built:
npx playwright screenshot http://localhost:3000 /tmp/home.png
npx playwright screenshot http://localhost:3000/sso-login-complete /tmp/sso.png
Add every page you created:
npx playwright screenshot http://localhost:3000/profile /tmp/profile.png
npx playwright screenshot http://localhost:3000/account /tmp/account.png
npx playwright screenshot http://localhost:3000/analytics /tmp/analytics.png
npx playwright screenshot http://localhost:3000/notifications /tmp/notifications.png
If any command fails, the page has a render error. Fix it and re-run.
Kill the dev server when done.
How to Tell Which App Type
- Agent app: has
e2e/directory withplaywright.config.tsandauth.setup.ts, andpackage.jsonhastest:e2escript - Vanilla Next.js app: no
e2e/directory, notest:e2escript
Summary
npm run build(orpnpm build) -- must pass with zero errorsnpm run test(orpnpm test) -- vitest must pass- Touch test every page --
pnpm test:e2efor agent apps, ornpx playwright screenshotfor vanilla apps - Fix any failures before showing work to the user
Full E2E Reference
For writing custom authenticated journey tests, auth setup, and multi-browser patterns, see: https://github.com/iblai/iblai-app-cli/blob/main/skills/testing/iblai-add-test.md
Brand guidelines: BRAND.md