Skip to content

Commit 2f08344

Browse files
authored
Merge pull request #22 from Ryjen1/add-e2e-chat-tests
Add e2e chat tests
2 parents f86b712 + 61e4349 commit 2f08344

19 files changed

Lines changed: 4079 additions & 784 deletions

contracts/lib/self

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 03e471c5bfa5a6dfe5e69324cbf060f1545cf679
Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
e2e-tests:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x]
16+
browser: [chromium, firefox, webkit]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Install Playwright browsers
32+
run: npx playwright install --with-deps ${{ matrix.browser }}
33+
34+
- name: Build application
35+
run: npm run build
36+
env:
37+
NEXT_PUBLIC_TEST_MODE: true
38+
NEXT_PUBLIC_MOCK_CONTRACTS: true
39+
40+
- name: Run Playwright tests
41+
run: npx playwright test --project=${{ matrix.browser }}
42+
env:
43+
CI: true
44+
NEXT_PUBLIC_TEST_MODE: true
45+
NEXT_PUBLIC_E2E_TESTING: true
46+
47+
- name: Upload test results
48+
uses: actions/upload-artifact@v4
49+
if: always()
50+
with:
51+
name: playwright-results-${{ matrix.browser }}-node-${{ matrix.node-version }}
52+
path: |
53+
test-results/
54+
playwright-report/
55+
playbackwright-report/
56+
retention-days: 30
57+
58+
security-tests:
59+
runs-on: ubuntu-latest
60+
needs: e2e-tests
61+
62+
steps:
63+
- name: Checkout code
64+
uses: actions/checkout@v4
65+
66+
- name: Setup Node.js
67+
uses: actions/setup-node@v4
68+
with:
69+
node-version: 20.x
70+
cache: 'npm'
71+
72+
- name: Install dependencies
73+
run: npm ci
74+
75+
- name: Run security-focused E2E tests
76+
run: npx playwright test tests/security/
77+
env:
78+
CI: true
79+
NEXT_PUBLIC_TEST_MODE: true
80+
81+
performance-tests:
82+
runs-on: ubuntu-latest
83+
needs: e2e-tests
84+
85+
steps:
86+
- name: Checkout code
87+
uses: actions/checkout@v4
88+
89+
- name: Setup Node.js
90+
uses: actions/setup-node@v4
91+
with:
92+
node-version: 20.x
93+
cache: 'npm'
94+
95+
- name: Install dependencies
96+
run: npm ci
97+
98+
- name: Install Playwright browsers
99+
run: npx playwright install --with-deps
100+
101+
- name: Run performance E2E tests
102+
run: npx playwright test --project=chromium --grep="performance|load"
103+
env:
104+
CI: true
105+
NEXT_PUBLIC_TEST_MODE: true
106+
107+
- name: Upload performance results
108+
uses: actions/upload-artifact@v4
109+
if: always()
110+
with:
111+
name: performance-results
112+
path: |
113+
test-results/
114+
playwright-report/
115+
retention-days: 7
116+
117+
mobile-tests:
118+
runs-on: ubuntu-latest
119+
needs: e2e-tests
120+
121+
steps:
122+
- name: Checkout code
123+
uses: actions/checkout@v4
124+
125+
- name: Setup Node.js
126+
uses: actions/setup-node@v4
127+
with:
128+
node-version: 20.x
129+
cache: 'npm'
130+
131+
- name: Install dependencies
132+
run: npm ci
133+
134+
- name: Install Playwright browsers
135+
run: npx playwright install --with-deps
136+
137+
- name: Run mobile E2E tests
138+
run: npx playwright test --project="Mobile Chrome" --project="Mobile Safari"
139+
env:
140+
CI: true
141+
NEXT_PUBLIC_TEST_MODE: true
142+
143+
cross-browser-tests:
144+
runs-on: ubuntu-latest
145+
needs: e2e-tests
146+
147+
strategy:
148+
matrix:
149+
browser: [chromium, firefox, webkit]
150+
151+
steps:
152+
- name: Checkout code
153+
uses: actions/checkout@v4
154+
155+
- name: Setup Node.js
156+
uses: actions/setup-node@v4
157+
with:
158+
node-version: 20.x
159+
cache: 'npm'
160+
161+
- name: Install dependencies
162+
run: npm ci
163+
164+
- name: Install Playwright browsers
165+
run: npx playwright install --with-deps ${{ matrix.browser }}
166+
167+
- name: Run cross-browser compatibility tests
168+
run: npx playwright test --project=${{ matrix.browser }} --grep="cross-browser|compatibility"
169+
env:
170+
CI: true
171+
NEXT_PUBLIC_TEST_MODE: true
172+
173+
test-summary:
174+
runs-on: ubuntu-latest
175+
needs: [e2e-tests, security-tests, performance-tests, mobile-tests, cross-browser-tests]
176+
if: always()
177+
178+
steps:
179+
- name: Download all test results
180+
uses: actions/download-artifact@v4
181+
with:
182+
path: all-results/
183+
184+
- name: Generate test summary
185+
run: |
186+
echo "# E2E Test Results Summary" >> $GITHUB_STEP_SUMMARY
187+
echo "" >> $GITHUB_STEP_SUMMARY
188+
189+
# Check if tests passed
190+
if [ -f "all-results/playwright-report/index.html" ]; then
191+
echo "✅ E2E tests completed successfully" >> $GITHUB_STEP_SUMMARY
192+
echo "- Cross-browser testing passed" >> $GITHUB_STEP_SUMMARY
193+
echo "- Security tests completed" >> $GITHUB_STEP_SUMMARY
194+
echo "- Performance tests executed" >> $GITHUB_STEP_SUMMARY
195+
echo "- Mobile compatibility verified" >> $GITHUB_STEP_SUMMARY
196+
else
197+
echo "❌ E2E tests failed" >> $GITHUB_STEP_SUMMARY
198+
echo "Please check the test artifacts for detailed failure information." >> $GITHUB_STEP_SUMMARY
199+
fi
200+
201+
echo "" >> $GITHUB_STEP_SUMMARY
202+
echo "## Test Artifacts" >> $GITHUB_STEP_SUMMARY
203+
echo "- [Playwright Report](./artifacts)" >> $GITHUB_STEP_SUMMARY
204+
echo "- [Test Results](./test-results/)" >> $GITHUB_STEP_SUMMARY
205+
206+
- name: Upload all artifacts
207+
uses: actions/upload-artifact@v4
208+
with:
209+
name: all-test-results
210+
path: all-results/
211+
retention-days: 30

0 commit comments

Comments
 (0)