Skip to content

Commit

Permalink
chore: use e2e test in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
saleel committed Feb 1, 2024
1 parent f829c75 commit 939b25a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 2 additions & 0 deletions packages/app/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_CONTRACT_ADDRESS=0x86D390fDed54447fD244eD0718dbFCFCcbbA7edc
VITE_CIRCUIT_ARTIFACTS_URL=https://storage.googleapis.com/proof-of-twitter-artifacts/
5 changes: 2 additions & 3 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion packages/app/scripts/test-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# Execute E2E test
# This file is required in the CI
yarn start-e2e-test-server & yarn test:e2e-ui
yarn start-e2e-test-server & yarn test:e2e-zkp
7 changes: 4 additions & 3 deletions packages/app/tests/e2e-dl-zkp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 939b25a

Please sign in to comment.