-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathplaywright.import-console.config.ts
More file actions
56 lines (54 loc) · 2.56 KB
/
Copy pathplaywright.import-console.config.ts
File metadata and controls
56 lines (54 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { defineConfig, devices } from '@playwright/test';
/**
* REAL-CONSOLE import-wizard E2E — the most faithful "how a user actually does
* it" test: it logs into the real `apps/console`, navigates to an object's list
* view (ObjectView), clicks the real toolbar Import button, and drives the
* wizard through a BACKGROUND import → History → Undo, asserting the backend
* record count before/after each step. No hand-mounted harness — the wizard is
* reached exactly the way the product surfaces it.
*
* This differs from:
* - playwright.live.config.ts — general live console specs
* - playwright.import-harness.config.ts — a standalone hand-mounted wizard
*
* Prereqs (long-lived dev processes — NOT started by this config):
* 1. An ObjectStack backend with the async import-job routes
* (`/api/v1/data/import/jobs`), e.g. the framework `data-import` build:
* objectstack serve --dev --port 3002 (from examples/app-crm)
* 2. The console dev server pointed at that backend AND at an
* import-job-capable `@objectstack/client`. The published client (11.2.0)
* predates the async import API, so the console must alias it via
* OBJECTSTACK_CLIENT_DIST (see apps/console/vite.config.ts):
* cd apps/console && VITE_SERVER_URL= VITE_USE_MOCK_SERVER=false \
* DEV_PROXY_TARGET=http://localhost:3002 \
* OBJECTSTACK_CLIENT_DIST=<framework>/packages/client \
* pnpm dev --port 5180 --strictPort
*
* Because the flow only works once that unshipped client is wired in, the spec
* is gated on IMPORT_CONSOLE_LIVE=1 and additionally skips if the backend has
* no import-job route — so an unconfigured CI run reports skipped, not failed.
*
* Run: IMPORT_CONSOLE_LIVE=1 pnpm test:e2e:import-console
* IMPORT_CONSOLE_LIVE=1 pnpm test:e2e:import-console --headed
*
* Overrides: LIVE_APP_URL (console, default :5180), LIVE_API_URL (backend,
* default :3000 — set :3002 for app-crm), LIVE_EMAIL / LIVE_PASSWORD,
* LIVE_IMPORT_APP (default crm_app), LIVE_IMPORT_OBJECT (default crm_lead).
*/
const APP = process.env.LIVE_APP_URL || 'http://localhost:5180';
export default defineConfig({
testDir: './e2e/import-console',
fullyParallel: false,
workers: 1,
retries: 0,
reporter: [['list']],
globalSetup: './e2e/live/global-setup.ts',
use: {
baseURL: APP,
storageState: 'e2e/live/.auth/state.json',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }],
});