-
Notifications
You must be signed in to change notification settings - Fork 23
58 lines (47 loc) · 1.42 KB
/
tests-cli-e2e-tests.yml
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
name: PSAT E2E Tests
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- develop
pull_request:
branches:
- develop
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
e2e-test:
# The type of runner that the job will run on
name: CLI E2E Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Set Chrome executable path
run: |
CHROME_PATH=$(which google-chrome-stable || which google-chrome || which chrome || which chromium)
echo "CHROME_PATH=$CHROME_PATH" >> $GITHUB_ENV
- name: Install dependancy
run: |
ls
pwd
npm install || true
npm run build:cli:dashboard
- name: Install Xvfb
run: sudo apt-get install -y xvfb
- name: Start Xvfb
run: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- name: Delay for Xvfb to Start
run: sleep 6 # Adjust the sleep duration as needed
- name: Export DISPLAY
run: export DISPLAY=:99
- name: Run the tests
run: |
npm run test:cli:e2e