This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { createRequire } from 'node:module';
|
||||
import { readFileSync, mkdirSync, writeFileSync } from 'node:fs';
|
||||
import { mkdirSync, writeFileSync } from 'node:fs';
|
||||
import { resolve, dirname, join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
@@ -20,8 +20,8 @@ import { fileURLToPath } from 'node:url';
|
||||
//
|
||||
// We cannot create an app + share link through the LLM-less UI, so we seed engine
|
||||
// state directly into the throwaway DB + workspace dir (same handoff the
|
||||
// tool-request spec uses): the DB path is written by playwright.config.ts to
|
||||
// ui/.e2e-db-path, and the workspace dir is its sibling 'workspaces' folder
|
||||
// tool-request spec uses): the DB path comes from the run-scoped E2E_TMP, and
|
||||
// the workspace dir is its sibling 'workspaces' folder
|
||||
// (E2E_TMP/{e2e.db, workspaces}). We create a space via the built Repository,
|
||||
// drop an entry HTML under {worktree}/space/{id}/files/apps/{app}/index.html
|
||||
// (matching spaceFilesDir + findEntryPath), and mint a share token. Then the
|
||||
@@ -34,8 +34,9 @@ const repoRoot = resolve(__dirname, '..', '..');
|
||||
// playwright.config.ts hands off DB_PATH = {E2E_TMP}/e2e.db and
|
||||
// WORKTREE_DIR = {E2E_TMP}/workspaces (siblings). Derive the worktree dir from
|
||||
// the DB path so both agree on the SAME temp tree the webServer booted with.
|
||||
const dbPath = readFileSync(resolve(__dirname, '..', '.e2e-db-path'), 'utf-8').trim();
|
||||
const e2eTmp = dirname(dbPath);
|
||||
const e2eTmp = process.env.E2E_TMP;
|
||||
if (!e2eTmp) throw new Error('E2E_TMP must be set by playwright.config.ts');
|
||||
const dbPath = join(e2eTmp, 'e2e.db');
|
||||
const WORKTREE_DIR = join(e2eTmp, 'workspaces');
|
||||
|
||||
const APP_NAME = 'e2e-public-app';
|
||||
|
||||
Reference in New Issue
Block a user