From 939b25abe90b5549ead643cb5692880168d11446 Mon Sep 17 00:00:00 2001 From: Saleel Date: Wed, 31 Jan 2024 19:42:08 +0530 Subject: [PATCH] chore: use e2e test in CI --- .github/workflows/action.yml | 2 +- packages/app/.env | 2 ++ packages/app/package.json | 5 ++--- packages/app/scripts/test-e2e.sh | 2 +- packages/app/tests/e2e-dl-zkp.test.ts | 7 ++++--- 5 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 packages/app/.env diff --git a/.github/workflows/action.yml b/.github/workflows/action.yml index cb29dd3..504ca9b 100644 --- a/.github/workflows/action.yml +++ b/.github/workflows/action.yml @@ -85,5 +85,5 @@ jobs: env: CI: "true" with: - args: yarn workspace @zk-email/twitter-verifier-app test:full-e2e + args: yarn workspace @zk-email/twitter-verifier-app test:e2e-zkp diff --git a/packages/app/.env b/packages/app/.env new file mode 100644 index 0000000..3692ab7 --- /dev/null +++ b/packages/app/.env @@ -0,0 +1,2 @@ +VITE_CONTRACT_ADDRESS=0x86D390fDed54447fD244eD0718dbFCFCcbbA7edc +VITE_CIRCUIT_ARTIFACTS_URL=https://storage.googleapis.com/proof-of-twitter-artifacts/ diff --git a/packages/app/package.json b/packages/app/package.json index 7d612d2..d231f17 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -23,9 +23,8 @@ "serve": "PORT=3000 vite preview", "test": "jest --runInBand --testPathIgnorePatterns='e2e' --reporters=default --reporters=jest-junit", "start-e2e-test-server": "yarn serve", - "test:e2e-ui": "CI=true jest ./tests/e2e-ui*.test.*", - "test:full-e2e": "bash scripts/test-e2e.sh", - "test:e2e-zkp": "CI=true jest ./tests/e2e-dl-zkp.test.ts" + "test:e2e-ui": "yarn start-e2e-test-server & CI=true jest ./tests/e2e-ui*.test.*", + "test:e2e-zkp": "yarn start-e2e-test-server & CI=true jest ./tests/e2e-dl-zkp.test.ts" }, "eslintConfig": { "extends": [ diff --git a/packages/app/scripts/test-e2e.sh b/packages/app/scripts/test-e2e.sh index 7f38cb8..8c8901f 100644 --- a/packages/app/scripts/test-e2e.sh +++ b/packages/app/scripts/test-e2e.sh @@ -2,4 +2,4 @@ # Execute E2E test # This file is required in the CI -yarn start-e2e-test-server & yarn test:e2e-ui \ No newline at end of file +yarn start-e2e-test-server & yarn test:e2e-zkp \ No newline at end of file diff --git a/packages/app/tests/e2e-dl-zkp.test.ts b/packages/app/tests/e2e-dl-zkp.test.ts index 0da80f7..c227d8c 100644 --- a/packages/app/tests/e2e-dl-zkp.test.ts +++ b/packages/app/tests/e2e-dl-zkp.test.ts @@ -12,8 +12,8 @@ const ethInputSelector = "input[placeholder='Ethereum Address']"; const proofTextareaSelector = "textarea[aria-label='Proof Output']"; const pageUrl = "http://localhost:3000"; -const downloadTimeout = 10000000; -const proofTimeout = 10000000; +const downloadTimeout = 1000000; +const proofTimeout = 1000000; const setTextAreaValue = async (page: Page, selector: string, value: string) => { // This is a workaround for the fact that page.keyboard.type() is too slow. @@ -56,8 +56,9 @@ describe("App.js", () => { beforeAll(async () => { browser = await puppeteer.launch({ - // headless: true, headless: false, + args: ['--no-sandbox'], + executablePath: process.env.PUPPETEER_EXEC_PATH, slowMo: 100 }); page = await browser.newPage();