diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml new file mode 100644 index 0000000..a307f90 --- /dev/null +++ b/.github/workflows/playwright.yml @@ -0,0 +1,33 @@ +name: Playwright Tests +on: + push: + branches: [ main, master ] + pull_request: + branches: [ main, master ] +jobs: + test: + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Install dependencies + run: npm install -g yarn && yarn + - name: Install Playwright Browsers + run: yarn playwright install --with-deps + - name: Run Playwright tests + run: npx playwright test + env: + NEXT_PUBLIC_RPC: https://o.pacmon.suijin.xyz/rpc/ + NEXT_PUBLIC_EXPLORER: https://o.pacmon.suijin.xyz/explorer + NEXT_PUBLIC_API_URL: https://o.pacmon.suijin.xyz/api + NEXT_PUBLIC_PLAYWRIGHT_TESTING: 1 + NEXT_PUBLIC_PLAYWRIGHT_PROJECT_ID: 1 + - uses: actions/upload-artifact@v3 + if: always() + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 diff --git a/.gitignore b/.gitignore index 21d9056..d470f9f 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,8 @@ next-env.d.ts # npm lock package-lock.json _static +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ +.env \ No newline at end of file diff --git a/components/demo/DemoApp.tsx b/components/demo/DemoApp.tsx index 7fe2335..ff61f2e 100644 --- a/components/demo/DemoApp.tsx +++ b/components/demo/DemoApp.tsx @@ -200,32 +200,41 @@ const DemoTokenBox = ({
| Oracle Price: | -- ${formatBigInt(price, PRICE_PRECISION)} - | -
| AMM Price: | -- ${formatBigInt(ammPrice * quotePrice, PRICE_PRECISION * 2)} - | -
| Deposited Balance: | -- - {formatBigInt(balance, Number(baseTokenInfo.decimals))} {bSymbol} - - | -
| Deposited Value: | -- ${formatBigInt(value, PRICE_PRECISION)} - | -
| Oracle Price: | ++ + ${formatBigInt(price, PRICE_PRECISION)} + + | +
| AMM Price: | ++ + ${formatBigInt(ammPrice * quotePrice, PRICE_PRECISION * 2)} + + | +
| Deposited Balance: | ++ + {formatBigInt(balance, Number(baseTokenInfo.decimals))}{" "} + {bSymbol} + + | +
| Deposited Value: | ++ + ${formatBigInt(value, PRICE_PRECISION)} + + | +