2026-03-01 11:24:15 +00:00
|
|
|
|
import { defineConfig, devices } from '@playwright/test';
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Playwright config for holdout scenarios.
|
|
|
|
|
|
*
|
2026-03-03 19:57:34 +00:00
|
|
|
|
* Holdout specs are cloned from the separate harb-holdout-scenarios repo
|
|
|
|
|
|
* into .holdout-scenarios/ by evaluate.sh and reuse the existing tests/setup/
|
|
|
|
|
|
* infrastructure (wallet-provider, stack, navigate).
|
2026-03-01 11:24:15 +00:00
|
|
|
|
*
|
|
|
|
|
|
* The evaluator boots the stack first, then runs:
|
|
|
|
|
|
* npx playwright test --config scripts/harb-evaluator/holdout.config.ts
|
|
|
|
|
|
*
|
|
|
|
|
|
* Required env vars (set by evaluate.sh):
|
2026-03-03 19:57:34 +00:00
|
|
|
|
* STACK_RPC_URL – Anvil JSON-RPC endpoint
|
|
|
|
|
|
* STACK_WEBAPP_URL – Vite dev server URL
|
|
|
|
|
|
* STACK_GRAPHQL_URL – Ponder GraphQL endpoint
|
2026-03-03 20:59:32 +00:00
|
|
|
|
* HOLDOUT_SCENARIOS_DIR – Path to cloned scenarios
|
2026-03-01 11:24:15 +00:00
|
|
|
|
*/
|
2026-03-03 20:59:32 +00:00
|
|
|
|
|
|
|
|
|
|
const scenariosDir = process.env.HOLDOUT_SCENARIOS_DIR;
|
|
|
|
|
|
if (!scenariosDir) {
|
|
|
|
|
|
throw new Error('HOLDOUT_SCENARIOS_DIR env var required — run via evaluate.sh');
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-03-01 11:24:15 +00:00
|
|
|
|
export default defineConfig({
|
2026-03-03 20:59:32 +00:00
|
|
|
|
testDir: scenariosDir,
|
2026-03-01 11:24:15 +00:00
|
|
|
|
fullyParallel: false,
|
2026-03-01 12:04:35 +00:00
|
|
|
|
// evaluate.sh sets CI=true before invoking playwright, so forbidOnly is always
|
|
|
|
|
|
// active in the evaluator context. Accidental test.only() in any scenario file
|
|
|
|
|
|
// causes an immediate failure rather than a silent partial run.
|
2026-03-01 11:24:15 +00:00
|
|
|
|
forbidOnly: !!process.env.CI,
|
|
|
|
|
|
retries: 0,
|
|
|
|
|
|
workers: 1,
|
|
|
|
|
|
reporter: 'list',
|
|
|
|
|
|
timeout: 5 * 60 * 1000, // 5 min per test — scenarios involve on-chain txns
|
|
|
|
|
|
expect: {
|
|
|
|
|
|
timeout: 30_000,
|
|
|
|
|
|
},
|
|
|
|
|
|
use: {
|
|
|
|
|
|
headless: true,
|
|
|
|
|
|
viewport: { width: 1280, height: 720 },
|
|
|
|
|
|
screen: { width: 1280, height: 720 },
|
|
|
|
|
|
actionTimeout: 60_000,
|
|
|
|
|
|
launchOptions: {
|
|
|
|
|
|
args: ['--disable-dev-shm-usage', '--no-sandbox'],
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
projects: [
|
|
|
|
|
|
{
|
|
|
|
|
|
name: 'chromium',
|
|
|
|
|
|
use: { ...devices['Desktop Chrome'] },
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
});
|