Skip to content

Commit

Permalink
Chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
justfizah authored Jan 12, 2025
1 parent a0d35fa commit 0c2b5a8
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1 +1,71 @@
name: E2E Tests

on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Enable Corepack
run: corepack enable

- name: Prepare Yarn
run: corepack prepare [email protected] --activate

- name: Install dependencies
run: yarn install

- name: Install Playwright Browsers
run: yarn playwright install --with-deps

- name: Verify GraphQL API availability
run: |
curl -X POST -H "Content-Type: application/json" \
--data '{"query":"query { categories { id name } }"}' \
https://api.kwekmarket.com/v1/kwekql || exit 1
- name: Update Browserslist DB
run: npx update-browserslist-db@latest

- name: Install Sharp
run: yarn add sharp

- name: Build the application
run: yarn build
env:
NEXT_PUBLIC_PUSHER_KEY: ${{ secrets.NEXT_PUBLIC_PUSHER_KEY }}

- name: Start the application
run: yarn start &
env:
PORT: 3100
NEXT_PUBLIC_PUSHER_KEY: ${{ secrets.NEXT_PUBLIC_PUSHER_KEY }}

- name: Wait for the application to be ready
run: npx wait-on http://localhost:3100

- name: Run Playwright tests
env:
GRAPHQL_API_URL: https://api.kwekmarket.com/v1/kwekql
PORT: 3100
run: yarn run test

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30

0 comments on commit 0c2b5a8

Please sign in to comment.