File size: 1,864 Bytes
3b6afc0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Playwright Tests
on:
  push:
    branches: [feat/playwright-jest-cicd]
  pull_request:
    branches: [feat/playwright-jest-cicd]
jobs:
  tests_e2e:
    name: Run Playwright tests
    timeout-minutes: 60
    runs-on: ubuntu-latest
    env:
      #   BINGAI_TOKEN: ${{ secrets.BINGAI_TOKEN }}
      #   CHATGPT_TOKEN: ${{ secrets.CHATGPT_TOKEN }}
      MONGO_URI: ${{ secrets.MONGO_URI }}
      OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
      E2E_USER_EMAIL: ${{ secrets.E2E_USER_EMAIL }}
      E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }}
      JWT_SECRET: ${{ secrets.JWT_SECRET }}
      CREDS_KEY: ${{ secrets.CREDS_KEY }}
      CREDS_IV: ${{ secrets.CREDS_IV }}
      # NODE_ENV: ${{ vars.NODE_ENV }}
      DOMAIN_CLIENT: ${{ vars.DOMAIN_CLIENT }}
      DOMAIN_SERVER: ${{ vars.DOMAIN_SERVER }}
    # PALM_KEY: ${{ secrets.PALM_KEY }}
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 18
          cache: 'npm'

      - name: Install global dependencies
        run: npm ci --ignore-scripts

      - name: Install API dependencies
        working-directory: ./api
        run: npm ci --ignore-scripts

      - name: Install Client dependencies
        working-directory: ./client
        run: npm ci --ignore-scripts

      - name: Build Client
        run: cd client && npm run build:ci

      - name: Install Playwright Browsers
        run: npx playwright install --with-deps && npm install -D @playwright/test

      - name: Start server
        run: |
          npm run backend & sleep 10

      - name: Run Playwright tests
        run: npx playwright test --config=e2e/playwright.config.ts

      - uses: actions/upload-artifact@v3
        if: always()
        with:
          name: playwright-report
          path: e2e/playwright-report/
          retention-days: 30