@@ -227,12 +227,95 @@ jobs:
227
227
env :
228
228
CI : true
229
229
230
+ matrix :
231
+ runs-on : ubuntu-latest-low
232
+ outputs :
233
+ matrix : ${{ steps.versions.outputs.sparse-matrix }}
234
+ steps :
235
+ - name : Checkout app
236
+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
237
+ - name : Get version matrix
238
+ id : versions
239
+ uses : icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
240
+ with :
241
+ matrix : ' {"node-versions": ["20"]}'
242
+
243
+ frontend-e2e-tests :
244
+ runs-on : ubuntu-latest
245
+ name : Front-end E2E tests
246
+ needs : matrix
247
+ strategy :
248
+ matrix : ${{ fromJson(needs.matrix.outputs.matrix) }}
249
+ steps :
250
+ - name : Set up Nextcloud env
251
+ uses : ChristophWurst/setup-nextcloud@fc0790385c175d97e88a7cb0933490de6e990374 # v0.3.2
252
+ with :
253
+ nextcloud-version : ${{ matrix.server-versions }}
254
+ php-version : ${{ matrix.php-versions }}
255
+ node-version : ${{ matrix.node-versions }}
256
+ install : true
257
+ - name : Configure Nextcloud for testing
258
+ run : |
259
+ php -f nextcloud/occ config:system:set debug --type=bool --value=true
260
+ php -f nextcloud/occ config:system:set overwriteprotocol --value=https
261
+ php -f nextcloud/occ config:system:set overwritehost --value=localhost
262
+ php -f nextcloud/occ config:system:set overwrite.cli.url --value=https://localhost
263
+ php -f nextcloud/occ config:system:set app.mail.debug --type=bool --value=true
264
+ php -f nextcloud/occ config:system:set app.mail.verify-tls-peer --type=bool --value=false
265
+ - name : Check out the app
266
+ uses : actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
267
+ with :
268
+ path : nextcloud/apps/mail
269
+ - name : Install php dependencies
270
+ working-directory : nextcloud/apps/mail
271
+ run : composer install
272
+ - name : Install the app
273
+ run : php -f nextcloud/occ app:enable mail
274
+ - name : Set up node ${{ matrix.node-version }}
275
+ uses : actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
276
+ with :
277
+ node-version : ${{ matrix.node-versions }}
278
+ - name : Install npm dependencies
279
+ working-directory : nextcloud/apps/mail
280
+ run : npm ci
281
+ - name : Build frontend
282
+ working-directory : nextcloud/apps/mail
283
+ run : npm run build
284
+ - name : Install stunnel (tiny https proxy)
285
+ run : sudo apt-get install -y stunnel
286
+ - name : Start php server and https proxy
287
+ working-directory : nextcloud
288
+ run : |
289
+ openssl req -new -x509 -days 365 -nodes -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=localhost" -out stunnel.pem -keyout stunnel.pem
290
+ php -S 127.0.0.1:8080 &
291
+ sudo stunnel3 -p stunnel.pem -d 443 -r 8080
292
+ - name : Test https access
293
+ run : curl --insecure -Li https://localhost
294
+ - name : Install Playwright browsers
295
+ working-directory : nextcloud/apps/mail
296
+ run : npx playwright install --with-deps chromium
297
+ - name : Run Playwright tests
298
+ working-directory : nextcloud/apps/mail
299
+ run : DEBUG=pw:api npx playwright test
300
+ - uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
301
+ if : always()
302
+ with :
303
+ name : playwright-report-${{ github.event.number }}-nc${{ matrix.server-versions }}-php${{ matrix.php-versions }}-node${{ matrix.node-versions }}
304
+ path : nextcloud/apps/mail/playwright-report/
305
+ retention-days : 14
306
+ - name : Print server logs
307
+ if : always()
308
+ run : cat nextcloud/data/nextcloud.log*
309
+ env :
310
+ CI : true
311
+
230
312
summary :
231
313
runs-on : ubuntu-latest-low
232
314
needs :
233
315
- unit-tests
234
316
- integration-tests
235
317
- frontend-unit-test
318
+ - frontend-e2e-tests
236
319
237
320
if : always()
238
321
@@ -245,3 +328,5 @@ jobs:
245
328
run : if ${{ needs.integration-tests.result != 'success' && needs.integration-tests.result != 'skipped' }}; then exit 1; fi
246
329
- name : Frontend unit test status
247
330
run : if ${{ needs.frontend-unit-test.result != 'success' && needs.frontend-unit-test.result != 'skipped' }}; then exit 1; fi
331
+ - name : Frontend E2E test status
332
+ run : if ${{ needs.frontend-e2e-tests.result != 'success' && needs.frontend-e2e-tests.result != 'skipped' }}; then exit 1; fi
0 commit comments