From 0d3c3ed999e991d59335d170123d83c7849f5333 Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 13:21:23 -0300 Subject: [PATCH 01/20] fixes to add stability to crisp_e2e test --- Cargo.lock | 1 + crates/program-server/Cargo.toml | 1 + crates/program-server/src/types.rs | 6 +++++- examples/CRISP/Cargo.lock | 1 + examples/CRISP/Cargo.toml | 1 + examples/CRISP/client/package.json | 1 + examples/CRISP/client/vite.config.ts | 3 ++- examples/CRISP/scripts/dev_client.sh | 2 +- examples/CRISP/server/Cargo.toml | 1 + examples/CRISP/server/src/server/models.rs | 7 +++++-- scripts/run-crisp-test.sh | 3 +++ 11 files changed, 22 insertions(+), 5 deletions(-) create mode 100755 scripts/run-crisp-test.sh diff --git a/Cargo.lock b/Cargo.lock index d6d0d4860e..d1d949e6ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3059,6 +3059,7 @@ version = "0.1.5" dependencies = [ "actix-web", "anyhow", + "derivative", "e3-compute-provider", "hex", "reqwest", diff --git a/crates/program-server/Cargo.toml b/crates/program-server/Cargo.toml index 8b96c7e1e8..847c78911b 100644 --- a/crates/program-server/Cargo.toml +++ b/crates/program-server/Cargo.toml @@ -15,3 +15,4 @@ e3-compute-provider.workspace = true reqwest.workspace = true anyhow.workspace = true hex.workspace = true +derivative.workspace = true diff --git a/crates/program-server/src/types.rs b/crates/program-server/src/types.rs index 2b3e1bfac4..49c729fb14 100644 --- a/crates/program-server/src/types.rs +++ b/crates/program-server/src/types.rs @@ -5,6 +5,7 @@ // or FITNESS FOR A PARTICULAR PURPOSE. use anyhow::Result; +use derivative::Derivative; use serde::{Deserialize, Deserializer, Serialize, Serializer}; #[derive(Serialize, Deserialize, Debug)] @@ -23,12 +24,15 @@ pub struct ComputeRequest { pub callback_url: Option, } -#[derive(Serialize, Debug)] +#[derive(Derivative, Serialize)] +#[derivative(Debug)] pub struct WebhookPayload { pub e3_id: u64, #[serde(serialize_with = "serialize_as_hex")] + #[derivative(Debug = "ignore")] pub ciphertext: Vec, #[serde(serialize_with = "serialize_as_hex")] + #[derivative(Debug = "ignore")] pub proof: Vec, } diff --git a/examples/CRISP/Cargo.lock b/examples/CRISP/Cargo.lock index 05848091ff..ce1179f339 100644 --- a/examples/CRISP/Cargo.lock +++ b/examples/CRISP/Cargo.lock @@ -1963,6 +1963,7 @@ dependencies = [ "chrono", "clap", "config", + "derivative", "dialoguer", "dotenvy", "e3-compute-provider 0.1.5", diff --git a/examples/CRISP/Cargo.toml b/examples/CRISP/Cargo.toml index 7177a0e5d1..7cc68bf774 100644 --- a/examples/CRISP/Cargo.toml +++ b/examples/CRISP/Cargo.toml @@ -28,6 +28,7 @@ anyhow = { version = "=1.0.98" } actix-web = "=4.11.0" bincode = { version = "=1.3.3" } bytemuck = { version = "=1.23.1" } +derivative = "=2.2.0" eyre = "=0.6.12" env_logger = "=0.11.8" hex = { version = "=0.4.3" } diff --git a/examples/CRISP/client/package.json b/examples/CRISP/client/package.json index a4146af16c..3106ce5666 100644 --- a/examples/CRISP/client/package.json +++ b/examples/CRISP/client/package.json @@ -11,6 +11,7 @@ "scripts": { "cli": "pnpm sh ./scripts/cli.sh", "dev": "vite --no-open --host", + "dev-static": "NO_HOT=1 vite --no-open --host", "build": "tsc && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", diff --git a/examples/CRISP/client/vite.config.ts b/examples/CRISP/client/vite.config.ts index e85435a221..15ae99975d 100644 --- a/examples/CRISP/client/vite.config.ts +++ b/examples/CRISP/client/vite.config.ts @@ -13,8 +13,8 @@ import topLevelAwait from 'vite-plugin-top-level-await' import path from 'path' import { nodePolyfills } from 'vite-plugin-node-polyfills' +process.env.NO_HOT && console.log('Running without HMR') // const development: boolean = !process.env.NODE_ENV || process.env.NODE_ENV === 'development' - export default defineConfig({ base: '/', define: { @@ -52,5 +52,6 @@ export default defineConfig({ open: true, // this sets a default port to 3000 port: 3000, + hmr: !!process.env.NO_HOT, }, }) diff --git a/examples/CRISP/scripts/dev_client.sh b/examples/CRISP/scripts/dev_client.sh index 1209f9ba9b..b9e102c4a6 100755 --- a/examples/CRISP/scripts/dev_client.sh +++ b/examples/CRISP/scripts/dev_client.sh @@ -4,4 +4,4 @@ set -euo pipefail sleep 4 -(cd ./client && pnpm dev) +(cd ./client && pnpm dev-static) diff --git a/examples/CRISP/server/Cargo.toml b/examples/CRISP/server/Cargo.toml index 307c45a21c..45e606b10f 100644 --- a/examples/CRISP/server/Cargo.toml +++ b/examples/CRISP/server/Cargo.toml @@ -53,6 +53,7 @@ bincode.workspace = true serde.workspace = true serde_json.workspace = true eyre.workspace = true +derivative.workspace = true # Utility libraries bigdecimal = "=0.4.3" diff --git a/examples/CRISP/server/src/server/models.rs b/examples/CRISP/server/src/server/models.rs index 9c394398a6..0cb7b945d4 100644 --- a/examples/CRISP/server/src/server/models.rs +++ b/examples/CRISP/server/src/server/models.rs @@ -5,14 +5,18 @@ // or FITNESS FOR A PARTICULAR PURPOSE. use anyhow::Result; +use derivative::Derivative; use serde::{Deserialize, Deserializer, Serialize}; -#[derive(Deserialize, Debug)] +#[derive(Derivative, Deserialize)] +#[derivative(Debug)] pub struct WebhookPayload { pub e3_id: u64, #[serde(deserialize_with = "deserialize_hex_string")] + #[derivative(Debug = "ignore")] pub ciphertext: Vec, #[serde(deserialize_with = "deserialize_hex_string")] + #[derivative(Debug = "ignore")] pub proof: Vec, } @@ -132,7 +136,6 @@ pub struct E3StateLite { pub balance_threshold: String, } - #[derive(Debug, Deserialize, Serialize)] pub struct E3 { // Identifiers diff --git a/scripts/run-crisp-test.sh b/scripts/run-crisp-test.sh new file mode 100755 index 0000000000..4a29c9b6ea --- /dev/null +++ b/scripts/run-crisp-test.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +rm -rf * && git reset --hard HEAD && git submodule update --init --recursive && pnpm install && cargo build && cd examples/CRISP && pnpm test:e2e --ui From 930537cdb1fc7493b60a30c6b1a69f006843833a Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 13:27:06 -0300 Subject: [PATCH 02/20] use input to add --ui --- scripts/run-crisp-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-crisp-test.sh b/scripts/run-crisp-test.sh index 4a29c9b6ea..5b18389181 100755 --- a/scripts/run-crisp-test.sh +++ b/scripts/run-crisp-test.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -rm -rf * && git reset --hard HEAD && git submodule update --init --recursive && pnpm install && cargo build && cd examples/CRISP && pnpm test:e2e --ui +rm -rf * && git reset --hard HEAD && git submodule update --init --recursive && pnpm install && cargo build && cd examples/CRISP && pnpm test:e2e "$@" From f08affe559dc78983ea14995b676f0a3438bf9a1 Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 13:36:41 -0300 Subject: [PATCH 03/20] wait for network idle --- examples/CRISP/test/crisp.spec.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/CRISP/test/crisp.spec.ts b/examples/CRISP/test/crisp.spec.ts index 95e554920b..b564a3e5a6 100644 --- a/examples/CRISP/test/crisp.spec.ts +++ b/examples/CRISP/test/crisp.spec.ts @@ -15,7 +15,7 @@ async function runCliInit() { // Execute the command and wait for it to complete const output = execSync( "pnpm cli init --token-address 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 --balance-threshold 1000", - { encoding: "utf-8" } + { encoding: "utf-8" }, ); console.log("Command output:", output); return output; @@ -30,7 +30,7 @@ const { expect } = test; async function ensureHomePageLoaded(page: Page) { return await expect(page.locator("h4")).toHaveText( - "Coercion-Resistant Impartial Selection Protocol" + "Coercion-Resistant Impartial Selection Protocol", ); } @@ -44,11 +44,11 @@ test("CRISP smoke test", async ({ context, metamaskPage, basicSetup.walletPassword, - extensionId + extensionId, ); await runCliInit(); - await page.goto("/"); + await page.goto("/", { waitUntil: "networkidle" }); await ensureHomePageLoaded(page); await page.locator('button:has-text("Connect Wallet")').click(); await page.locator('button:has-text("MetaMask")').click(); @@ -62,9 +62,9 @@ test("CRISP smoke test", async ({ await page.locator('a:has-text("Historic polls")').click(); await expect(page.locator("h1")).toHaveText("Historic polls"); await expect( - page.locator("[data-test-id='poll-0-0'] [data-test-id='poll-result-0'] h3") + page.locator("[data-test-id='poll-0-0'] [data-test-id='poll-result-0'] h3"), ).toHaveText("100%"); await expect( - page.locator("[data-test-id='poll-0-0'] [data-test-id='poll-result-1'] h3") + page.locator("[data-test-id='poll-0-0'] [data-test-id='poll-result-1'] h3"), ).toHaveText("0%"); }); From 458a405b294c3094c2c931ec9d1b924d9a644350 Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 16:01:56 -0300 Subject: [PATCH 04/20] add waits to avoid local issues --- examples/CRISP/test/crisp.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/CRISP/test/crisp.spec.ts b/examples/CRISP/test/crisp.spec.ts index b564a3e5a6..c8637bcd64 100644 --- a/examples/CRISP/test/crisp.spec.ts +++ b/examples/CRISP/test/crisp.spec.ts @@ -48,10 +48,12 @@ test("CRISP smoke test", async ({ ); await runCliInit(); - await page.goto("/", { waitUntil: "networkidle" }); + await page.waitForTimeout(1000); + await page.goto("/"); await ensureHomePageLoaded(page); await page.locator('button:has-text("Connect Wallet")').click(); await page.locator('button:has-text("MetaMask")').click(); + await page.waitForTimeout(1000); await metamask.connectToDapp(); await page.locator('button:has-text("Try Demo")').click(); await page From e7c8449825746d976279bf9cafaaecfd9a16e181 Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 16:10:28 -0300 Subject: [PATCH 05/20] add network idle wait --- examples/CRISP/test/crisp.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/CRISP/test/crisp.spec.ts b/examples/CRISP/test/crisp.spec.ts index c8637bcd64..06b6b8adbc 100644 --- a/examples/CRISP/test/crisp.spec.ts +++ b/examples/CRISP/test/crisp.spec.ts @@ -54,6 +54,7 @@ test("CRISP smoke test", async ({ await page.locator('button:has-text("Connect Wallet")').click(); await page.locator('button:has-text("MetaMask")').click(); await page.waitForTimeout(1000); + await page.waitForLoadState("networkidle"); await metamask.connectToDapp(); await page.locator('button:has-text("Try Demo")').click(); await page From dde71a9decc174ef417032c17253668971a0370b Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 16:14:45 -0300 Subject: [PATCH 06/20] slow down playwright --- examples/CRISP/playwright.config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/CRISP/playwright.config.ts b/examples/CRISP/playwright.config.ts index 991541d20b..d0e32ed197 100644 --- a/examples/CRISP/playwright.config.ts +++ b/examples/CRISP/playwright.config.ts @@ -25,6 +25,9 @@ export default defineConfig({ use: { ...devices["Desktop Chrome"], headless: true, + launchOptions: { + slowMo: 100, + }, }, }, ], From 88efd5152909bcb34762bf56b19c7aa5c59ffe9b Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 18:33:05 -0300 Subject: [PATCH 07/20] build before running server --- examples/CRISP/scripts/dev_server.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/CRISP/scripts/dev_server.sh b/examples/CRISP/scripts/dev_server.sh index 928ad6c88b..7898303387 100755 --- a/examples/CRISP/scripts/dev_server.sh +++ b/examples/CRISP/scripts/dev_server.sh @@ -4,4 +4,4 @@ set -e export CARGO_INCREMENTAL=1 -(cd ./server && cargo run --bin server) +(cd ./server && cargo build --bin server && cargo build --bin cli && cargo run --bin server) From 8bd4dc103312f1f3bea20b0213c59fdb72f783a5 Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 18:37:24 -0300 Subject: [PATCH 08/20] wait on port --- examples/CRISP/scripts/dev_services.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/CRISP/scripts/dev_services.sh b/examples/CRISP/scripts/dev_services.sh index 1a2b970b99..fb876a98df 100755 --- a/examples/CRISP/scripts/dev_services.sh +++ b/examples/CRISP/scripts/dev_services.sh @@ -5,5 +5,5 @@ set -euo pipefail concurrently -kr \ "./scripts/dev_cipher.sh" \ "./scripts/dev_program.sh" \ - "sleep 3 && ./scripts/dev_server.sh" \ + "wait-on tcp:13151 && ./scripts/dev_server.sh" \ "wait-on tcp:4000 && ./scripts/dev_client.sh" From c7fa3286e66c3ec58f141d6c224f3315fd2bed6c Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 19:06:08 -0300 Subject: [PATCH 09/20] update scripts --- examples/CRISP/scripts/dev.sh | 6 ++++-- examples/CRISP/scripts/dev_client.sh | 2 +- examples/CRISP/scripts/dev_server.sh | 2 +- examples/CRISP/scripts/setup.sh | 3 ++- examples/CRISP/scripts/test_e2e.sh | 3 ++- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/examples/CRISP/scripts/dev.sh b/examples/CRISP/scripts/dev.sh index e146ee53eb..ea5e5d2ec3 100755 --- a/examples/CRISP/scripts/dev.sh +++ b/examples/CRISP/scripts/dev.sh @@ -29,10 +29,12 @@ cleanup() { trap cleanup INT TERM +echo "DEV SCRIPT STARTING..." + pnpm concurrently \ -ks first \ - --names "ANVIL,DEPLOY,NODES" \ - --prefix-colors "blue,green,yellow" \ + --names "HARDHAT,DEPLOY" \ + --prefix-colors "blue,green" \ "cd packages/crisp-contracts && pnpm hardhat node" \ "./scripts/crisp_deploy.sh && ./scripts/dev_services.sh" diff --git a/examples/CRISP/scripts/dev_client.sh b/examples/CRISP/scripts/dev_client.sh index b9e102c4a6..e78886cadc 100755 --- a/examples/CRISP/scripts/dev_client.sh +++ b/examples/CRISP/scripts/dev_client.sh @@ -2,6 +2,6 @@ set -euo pipefail -sleep 4 +echo "CLIENT SCRIPT RUNNING..." (cd ./client && pnpm dev-static) diff --git a/examples/CRISP/scripts/dev_server.sh b/examples/CRISP/scripts/dev_server.sh index 7898303387..928ad6c88b 100755 --- a/examples/CRISP/scripts/dev_server.sh +++ b/examples/CRISP/scripts/dev_server.sh @@ -4,4 +4,4 @@ set -e export CARGO_INCREMENTAL=1 -(cd ./server && cargo build --bin server && cargo build --bin cli && cargo run --bin server) +(cd ./server && cargo run --bin server) diff --git a/examples/CRISP/scripts/setup.sh b/examples/CRISP/scripts/setup.sh index 5256ca52ce..2428dd002f 100755 --- a/examples/CRISP/scripts/setup.sh +++ b/examples/CRISP/scripts/setup.sh @@ -4,6 +4,7 @@ set -e export CARGO_INCREMENTAL=1 +echo "SETUP..." echo "pnpm install" (cd ../../ && pnpm install --frozen-lockfile) echo "evm" @@ -19,4 +20,4 @@ if [[ ! -f ~/.cargo/bin/enclave ]]; then else echo "enclave CLI already installed, skipping build" fi -echo "Skipping circuit compilation - using pre-compiled circuits" \ No newline at end of file +echo "Skipping circuit compilation - using pre-compiled circuits" diff --git a/examples/CRISP/scripts/test_e2e.sh b/examples/CRISP/scripts/test_e2e.sh index dc17d06b1f..9712978cc9 100755 --- a/examples/CRISP/scripts/test_e2e.sh +++ b/examples/CRISP/scripts/test_e2e.sh @@ -13,4 +13,5 @@ else fi fi -concurrently -krs first "./scripts/setup.sh && ./scripts/dev.sh" "wait-on http://localhost:3000 && ${PLAYWRIGHT_CMD} && sleep 3" +echo "TEST E2E SCRIPT STARTING..." +pnpm concurrently -krs first "./scripts/setup.sh && ./scripts/dev.sh" "wait-on tcp:3000 && ${PLAYWRIGHT_CMD} && sleep 3" From 2b61cf009a555a464e5f4fa0d00ccb0b0fe7ce7f Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 19:06:59 -0300 Subject: [PATCH 10/20] remove prebuild --- scripts/run-crisp-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run-crisp-test.sh b/scripts/run-crisp-test.sh index 5b18389181..bbbaea8a24 100755 --- a/scripts/run-crisp-test.sh +++ b/scripts/run-crisp-test.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -rm -rf * && git reset --hard HEAD && git submodule update --init --recursive && pnpm install && cargo build && cd examples/CRISP && pnpm test:e2e "$@" +rm -rf * && git reset --hard HEAD && git submodule update --init --recursive && pnpm install && cd examples/CRISP && pnpm test:e2e "$@" From 4ff142b441c2144dd9952e77d2ed409b2552b9f8 Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 19:27:48 -0300 Subject: [PATCH 11/20] add stable mode --- examples/CRISP/scripts/test_e2e.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/CRISP/scripts/test_e2e.sh b/examples/CRISP/scripts/test_e2e.sh index 9712978cc9..aefb6e7234 100755 --- a/examples/CRISP/scripts/test_e2e.sh +++ b/examples/CRISP/scripts/test_e2e.sh @@ -7,9 +7,9 @@ if [ "$1" == "--ui" ]; then else # Use xvfb-run only on Linux systems if [[ "$OSTYPE" == "linux-gnu"* ]]; then - PLAYWRIGHT_CMD="pnpm synpress --headless && xvfb-run pnpm playwright test" + PLAYWRIGHT_CMD="STABLE_MODE=true pnpm synpress --headless && xvfb-run pnpm playwright test" else - PLAYWRIGHT_CMD="pnpm synpress --headless && pnpm playwright test" + PLAYWRIGHT_CMD="STABLE_MODE=true pnpm synpress --headless && pnpm playwright test" fi fi From 48433c6d2893841e173447e52d4b994109f12797 Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 19:33:16 -0300 Subject: [PATCH 12/20] remove --headless flag from xbf call because chrome should not need headless mode --- examples/CRISP/scripts/test_e2e.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/CRISP/scripts/test_e2e.sh b/examples/CRISP/scripts/test_e2e.sh index aefb6e7234..918412eadf 100755 --- a/examples/CRISP/scripts/test_e2e.sh +++ b/examples/CRISP/scripts/test_e2e.sh @@ -7,7 +7,7 @@ if [ "$1" == "--ui" ]; then else # Use xvfb-run only on Linux systems if [[ "$OSTYPE" == "linux-gnu"* ]]; then - PLAYWRIGHT_CMD="STABLE_MODE=true pnpm synpress --headless && xvfb-run pnpm playwright test" + PLAYWRIGHT_CMD="STABLE_MODE=true pnpm synpress && xvfb-run pnpm playwright test" else PLAYWRIGHT_CMD="STABLE_MODE=true pnpm synpress --headless && pnpm playwright test" fi From 076d3c0817c672d06b1b04ca5aff7dfa29fb2018 Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 19:51:44 -0300 Subject: [PATCH 13/20] use HEADLESS env var --- examples/CRISP/scripts/test_e2e.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/CRISP/scripts/test_e2e.sh b/examples/CRISP/scripts/test_e2e.sh index 918412eadf..f0135f1ff6 100755 --- a/examples/CRISP/scripts/test_e2e.sh +++ b/examples/CRISP/scripts/test_e2e.sh @@ -7,9 +7,9 @@ if [ "$1" == "--ui" ]; then else # Use xvfb-run only on Linux systems if [[ "$OSTYPE" == "linux-gnu"* ]]; then - PLAYWRIGHT_CMD="STABLE_MODE=true pnpm synpress && xvfb-run pnpm playwright test" + PLAYWRIGHT_CMD="pnpm synpress --headless && HEADLESS=true xvfb-run pnpm playwright test" else - PLAYWRIGHT_CMD="STABLE_MODE=true pnpm synpress --headless && pnpm playwright test" + PLAYWRIGHT_CMD="pnpm synpress --headless && HEADLESS=true pnpm playwright test" fi fi From f765edf615ce022bab8ca238927ed59e6bbbd4f8 Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 19:59:09 -0300 Subject: [PATCH 14/20] add sleep --- examples/CRISP/scripts/test_e2e.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/CRISP/scripts/test_e2e.sh b/examples/CRISP/scripts/test_e2e.sh index f0135f1ff6..8c779caad4 100755 --- a/examples/CRISP/scripts/test_e2e.sh +++ b/examples/CRISP/scripts/test_e2e.sh @@ -14,4 +14,4 @@ else fi echo "TEST E2E SCRIPT STARTING..." -pnpm concurrently -krs first "./scripts/setup.sh && ./scripts/dev.sh" "wait-on tcp:3000 && ${PLAYWRIGHT_CMD} && sleep 3" +pnpm concurrently -krs first "./scripts/setup.sh && ./scripts/dev.sh" "wait-on tcp:3000 && sleep 20 && ${PLAYWRIGHT_CMD} && sleep 3" From b7942267daf60100e459fb5a9ff40dfdb6b71614 Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 20:40:11 -0300 Subject: [PATCH 15/20] fix hmr logic and remove directive not doing anything --- examples/CRISP/client/vite.config.ts | 2 +- examples/CRISP/test/crisp.spec.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/CRISP/client/vite.config.ts b/examples/CRISP/client/vite.config.ts index 15ae99975d..b50269281c 100644 --- a/examples/CRISP/client/vite.config.ts +++ b/examples/CRISP/client/vite.config.ts @@ -52,6 +52,6 @@ export default defineConfig({ open: true, // this sets a default port to 3000 port: 3000, - hmr: !!process.env.NO_HOT, + hmr: !process.env.NO_HOT, }, }) diff --git a/examples/CRISP/test/crisp.spec.ts b/examples/CRISP/test/crisp.spec.ts index 06b6b8adbc..c8637bcd64 100644 --- a/examples/CRISP/test/crisp.spec.ts +++ b/examples/CRISP/test/crisp.spec.ts @@ -54,7 +54,6 @@ test("CRISP smoke test", async ({ await page.locator('button:has-text("Connect Wallet")').click(); await page.locator('button:has-text("MetaMask")').click(); await page.waitForTimeout(1000); - await page.waitForLoadState("networkidle"); await metamask.connectToDapp(); await page.locator('button:has-text("Try Demo")').click(); await page From ea8edca402f3a0adda72e9fc849db0c7e7aa691e Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 20:57:18 -0300 Subject: [PATCH 16/20] remove waits to see if there is improvement --- examples/CRISP/test/crisp.spec.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/CRISP/test/crisp.spec.ts b/examples/CRISP/test/crisp.spec.ts index c8637bcd64..69f4e7bda5 100644 --- a/examples/CRISP/test/crisp.spec.ts +++ b/examples/CRISP/test/crisp.spec.ts @@ -48,12 +48,10 @@ test("CRISP smoke test", async ({ ); await runCliInit(); - await page.waitForTimeout(1000); await page.goto("/"); await ensureHomePageLoaded(page); await page.locator('button:has-text("Connect Wallet")').click(); await page.locator('button:has-text("MetaMask")').click(); - await page.waitForTimeout(1000); await metamask.connectToDapp(); await page.locator('button:has-text("Try Demo")').click(); await page From 63cff7dafba5840bdbdea1759816e413ac658cae Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 21:03:34 -0300 Subject: [PATCH 17/20] remove slowMo --- examples/CRISP/playwright.config.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/examples/CRISP/playwright.config.ts b/examples/CRISP/playwright.config.ts index d0e32ed197..991541d20b 100644 --- a/examples/CRISP/playwright.config.ts +++ b/examples/CRISP/playwright.config.ts @@ -25,9 +25,6 @@ export default defineConfig({ use: { ...devices["Desktop Chrome"], headless: true, - launchOptions: { - slowMo: 100, - }, }, }, ], From 6bc84720df8b801e15e9fda5fd82f2d62196d290 Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 21:17:34 -0300 Subject: [PATCH 18/20] remove HEADLESS --- examples/CRISP/scripts/test_e2e.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/CRISP/scripts/test_e2e.sh b/examples/CRISP/scripts/test_e2e.sh index 8c779caad4..8083448cd2 100755 --- a/examples/CRISP/scripts/test_e2e.sh +++ b/examples/CRISP/scripts/test_e2e.sh @@ -7,9 +7,9 @@ if [ "$1" == "--ui" ]; then else # Use xvfb-run only on Linux systems if [[ "$OSTYPE" == "linux-gnu"* ]]; then - PLAYWRIGHT_CMD="pnpm synpress --headless && HEADLESS=true xvfb-run pnpm playwright test" + PLAYWRIGHT_CMD="pnpm synpress --headless && xvfb-run pnpm playwright test" else - PLAYWRIGHT_CMD="pnpm synpress --headless && HEADLESS=true pnpm playwright test" + PLAYWRIGHT_CMD="pnpm synpress --headless && pnpm playwright test" fi fi From 76d27f907a53402965808ad02b76bc31e2f3f133 Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 21:22:51 -0300 Subject: [PATCH 19/20] add screen size --- examples/CRISP/scripts/test_e2e.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/CRISP/scripts/test_e2e.sh b/examples/CRISP/scripts/test_e2e.sh index 8083448cd2..b188de1e15 100755 --- a/examples/CRISP/scripts/test_e2e.sh +++ b/examples/CRISP/scripts/test_e2e.sh @@ -7,7 +7,7 @@ if [ "$1" == "--ui" ]; then else # Use xvfb-run only on Linux systems if [[ "$OSTYPE" == "linux-gnu"* ]]; then - PLAYWRIGHT_CMD="pnpm synpress --headless && xvfb-run pnpm playwright test" + PLAYWRIGHT_CMD="pnpm synpress --headless && xvfb-run --auto-servernum --server-args=\"-screen 0 1280x960x24\" pnpm playwright test" else PLAYWRIGHT_CMD="pnpm synpress --headless && pnpm playwright test" fi From 8814858dd7ad980ccc8c5691e14976518f9c1726 Mon Sep 17 00:00:00 2001 From: ryardley Date: Wed, 29 Oct 2025 21:37:56 -0300 Subject: [PATCH 20/20] write better warning --- scripts/run-crisp-test.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/run-crisp-test.sh b/scripts/run-crisp-test.sh index bbbaea8a24..f13c1cccc1 100755 --- a/scripts/run-crisp-test.sh +++ b/scripts/run-crisp-test.sh @@ -1,3 +1,9 @@ #!/usr/bin/env bash +echo "This helper script will clean your repository and run end-to-end tests for CRISP." +echo "WARNING: This will reset your current workspace. Ensure all changes are committed before proceeding." +echo "Press any key to continue or Ctrl+C to cancel..." + +read + rm -rf * && git reset --hard HEAD && git submodule update --init --recursive && pnpm install && cd examples/CRISP && pnpm test:e2e "$@"