-
Notifications
You must be signed in to change notification settings - Fork 13
143 lines (113 loc) · 4.86 KB
/
run-ui-tests.yml
File metadata and controls
143 lines (113 loc) · 4.86 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Frontend Playwright Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ "*" ]
workflow_dispatch:
inputs:
branch:
description: 'Branch to run the tests on'
required: false
default: 'master'
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch || github.ref }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set Branch Name
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "branch_name=${{ github.event.inputs.branch }}" >> $GITHUB_ENV
else
echo "branch_name=${{ github.ref_name }}" >> $GITHUB_ENV
fi
- name: Sanitize Branch Name and Git Hash
run: |
sanitized_branch_name=$(echo "${{ env.branch_name }}" | sed 's/[^a-zA-Z0-9_-]/_/g')
sanitized_git_hash=$(git rev-parse --short "${{ github.sha }}" | sed 's/[^a-zA-Z0-9_-]/_/g')
echo "sanitized_branch_name=${sanitized_branch_name}" >> $GITHUB_ENV
echo "sanitized_git_hash=${sanitized_git_hash}" >> $GITHUB_ENV
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Yarn
run: npm install --global yarn
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Build Extension in Dev Mode
run: pip install -e .
- name: Build Wheel
run: |
python -m pip install --upgrade build
python -m build
- name: Install Xircuits from wheel
run: |
whl_name=$(ls dist/*.whl)
pip install $whl_name
- name: Init Xircuits
run: xircuits init
- name: Install Xircuits Test Component Library
run: xircuits install tests
- name: Install xvfb
run: sudo apt-get install -y xvfb
- name: Run Python UI Tests
run: |
pip install playwright
playwright install
nohup jupyter lab --ServerApp.token='' --ServerApp.password='' --LabApp.default_url='/lab?reset' > jupyter.log 2>&1 &
sleep 10
cd ui-tests/tests
echo "===== 🚀 Starting test_toggle_light_dark.py ====="
xvfb-run -a python3 test_clipboard_copy_paste.py
echo "===== ✅ Finished test_toggle_light_dark.py ====="
echo "===== 🚀 Starting test_clipboard_single_print.py ====="
xvfb-run -a python3 test_toggle_light_dark.py
echo "===== ✅ Finished test_clipboard_single_print.py ====="
echo "===== 🚀 Starting reload_performance_test.py ====="
xvfb-run -a python3 reload_performance_test.py
echo "===== ✅ Finished reload_performance_test.py ====="
echo "===== 🚀 Starting zoom-buttons-test.py ====="
xvfb-run -a python3 zoom-buttons-test.py
echo "===== ✅ Finished zoom-buttons-test.py ====="
echo "===== 🚀 Starting connecting-args-test.py ====="
xvfb-run -a python3 connecting-args-test.py
echo "===== ✅ Finished connecting-args-test.py ====="
echo "===== 🚀 Starting parameter-names-autoshift.py ====="
xvfb-run -a python3 parameter-names-autoshift.py
echo "===== ✅ Finished parameter-names-autoshift.py ====="
echo "===== 🚀 Starting parameter-names-despawn.py ====="
xvfb-run -a python3 parameter-names-despawn.py
echo "===== ✅ Finished parameter-names-despawn.py ====="
echo "===== 🚀 Starting parameter-names-spawn.py ====="
xvfb-run -a python3 parameter-names-spawn.py
echo "===== ✅ Finished parameter-names-spawn.py ====="
echo "===== 🚀 Starting protected-nodes-and-lock-test.py ====="
xvfb-run -a python3 protected-nodes-and-lock-test.py
echo "===== ✅ Finished protected-nodes-and-lock-test.py ====="
echo "===== 🚀 Starting remote_run_arguments_test.py ====="
xvfb-run -a python3 remote_run_arguments_test.py
echo "===== ✅ Finished remote_run_arguments_test.py ====="
echo "===== 🚀 Starting connecting-nodes-test.py ====="
xvfb-run -a python3 connecting-nodes-test.py
echo "===== ✅ Finished connecting-nodes-test.py ====="
echo "===== 🚀 Starting editing-literal-nodes-test.py ====="
xvfb-run -a python3 editing-literal-nodes-test.py
echo "===== ✅ Finished editing-literal-nodes-test.py ====="
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report-${{ matrix.python-version }}-${{ env.sanitized_branch_name }}-${{ env.sanitized_git_hash }}
path: ui-tests/playwright-report/
retention-days: 1