Skip to content

Commit

Permalink
ci: add scheduled prod website e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aquint-zama committed Feb 28, 2024
1 parent 6febe35 commit 3d3941e
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 30 deletions.
7 changes: 7 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
ENV=production
SECRET_WORDS='test test test test test test test test test test test junk'
NETWORK_NAME=zamatest
RPC_URL=https://devnet.zama.ai
CHAIN_ID=8009
SYMBOL=ZAMA
BLOCK_EXPLORER=https://main.explorer.zama.ai/
IS_TESTNET=true
72 changes: 72 additions & 0 deletions .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: "Regular test of Dapps Website"

on:
schedule:
- cron: "0 0 * * *"

pull_request:
branches: ["main"]

# Default to bash
defaults:
run:
shell: bash

jobs:
e2e_test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # pin@v2

- name: Install pnpm
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # [email protected]
with:
version: latest

- name: Setup node
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # [email protected]
with:
node-version: 18.16

- name: Set pnpm cache directory
run: pnpm config set store-dir .pnpm-store
continue-on-error: true

- name: Setup cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # pin@v2
with:
path: |
.pnpm-store
node_modules
/home/runner/.cache/Cypress
key: ${{ runner.os }}-pnpm-v1-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-v1-
continue-on-error: true

- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline

- name: Install linux deps
run: |
sudo apt-get install --no-install-recommends -y \
fluxbox \
xvfb
- name: Run e2e tests (headful)
run: |
Xvfb :0 -screen 0 1024x768x24 -listen tcp -ac &
fluxbox &
pnpm synpress:run-prod
env:
DISPLAY: :0.0

- name: Archive e2e artifacts
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # pin@v2
if: always()
with:
name: dapps-video
path: |
tests/e2e/videos
continue-on-error: true
28 changes: 0 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"start": "cross-env GATSBY_TELEMETRY_DISABLED=1 NODE_ENV=development gatsby develop",
"synpress:open": "env-cmd -f .env.development synpress open -cf synpress.config.js",
"synpress:run": "env-cmd -f .env.development synpress run --config baseUrl=http://localhost:8000",
"synpress:run-headless": "env-cmd -f .env.development synpress run --config baseUrl=http://localhost:8000 --headless",
"synpress:run-prod": "env-cmd -f .env.production synpress run --config baseUrl=https://dapps.zama.ai,taskTimeout=120000",
"test": "start-server-and-test 'pnpm start' http://localhost:8000 'pnpm synpress:run'"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/specs/erc20-deploy-mint.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
describe('Erc20 Deploy / Mint / Transfer', () => {
before(() => {
cy.visit('http://localhost:8000/erc20');
cy.visit('/erc20');
});

it('should connect wallet with success', () => {
Expand Down

0 comments on commit 3d3941e

Please sign in to comment.