From 9db8cd3e1f5b715a899f2c0754a86242ba349a3d Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 6 Jun 2024 01:09:47 -0400 Subject: [PATCH] build outside of playwright --- .github/workflows/playwright.yml | 5 ++++- apps/dapp/package.json | 3 +-- apps/dapp/playwright.config.ts | 9 +-------- yarn.lock | 5 ----- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 6d3b0a982..5dda36b1f 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -22,9 +22,12 @@ jobs: with: node-version: lts/* cache: yarn - - run: yarn install + - name: Install packages + run: yarn install - name: Install Playwright browsers run: yarn playwright install --with-deps + - name: Build dApp + run: yarn dapp build - name: Run Playwright tests run: yarn test:e2e - uses: actions/upload-artifact@v4 diff --git a/apps/dapp/package.json b/apps/dapp/package.json index 6b354b709..f24982fbf 100644 --- a/apps/dapp/package.json +++ b/apps/dapp/package.json @@ -15,7 +15,7 @@ "start": "next start", "test": "jest --passWithNoTests", "test:watch": "jest --watch", - "test:e2e": "cp .env.testnet .env && playwright test", + "test:e2e": "cp .env.testnet .env.local && playwright test", "ts": "tsc --noEmit --incremental", "ts:watch": "ts --watch" }, @@ -62,7 +62,6 @@ "@types/node": "^20.14.2", "@types/react": "^17.0.37", "autoprefixer": "^9.8.6", - "dotenv": "^16.4.5", "eslint": "^8.23.1", "eslint-plugin-header": "^3.1.1", "next-i18next": "^11.0.0", diff --git a/apps/dapp/playwright.config.ts b/apps/dapp/playwright.config.ts index 1807ce34e..d31a351d8 100644 --- a/apps/dapp/playwright.config.ts +++ b/apps/dapp/playwright.config.ts @@ -1,13 +1,6 @@ // GNU AFFERO GENERAL PUBLIC LICENSE Version 3. Copyright (C) 2022 DAO DAO Contributors. // See the "LICENSE" file in the root directory of this package for more copyright information. import { defineConfig, devices } from '@playwright/test' -import dotenv from 'dotenv' - -/** - * Read environment variables from file. - * https://github.com/motdotla/dotenv - */ -dotenv.config() /** * See https://playwright.dev/docs/test-configuration. @@ -73,7 +66,7 @@ export default defineConfig({ /* Build and run server before starting the tests */ webServer: { - command: 'yarn build && yarn start', + command: 'yarn start', url: 'http://127.0.0.1:3000', reuseExistingServer: !process.env.CI, // allow 10 minutes for the server to build diff --git a/yarn.lock b/yarn.lock index 6e99b189f..b0985b4b9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12854,11 +12854,6 @@ dotenv@^16.0.0, dotenv@^16.3.1: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.3.1.tgz#369034de7d7e5b120972693352a3bf112172cc3e" integrity sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ== -dotenv@^16.4.5: - version "16.4.5" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" - integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== - dotenv@^8.0.0: version "8.6.0" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b"