Test UI #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test UI | |
on: | |
workflow_dispatch: | |
env: | |
JAPREADER_ENV: playwright | |
NODE_ENV: development | |
CLEAR_TOKENS: true | |
JAPREADER_LOGS: silly | |
PLAYWRIGHT: true | |
DEBUG: pw:browser*,pw:api | |
DEBUG_FILE: playwright.log | |
jobs: | |
test-ubuntu: | |
name: Run Playwright e2e tests on ubuntu-latest | |
runs-on: ubuntu-latest | |
steps: | |
# Make sure build is clean and no files from a previous run are re-used. | |
- name: Cleanup files before run | |
run: | | |
rm -rf * | |
if: ${{ always() }} | |
- name: Checkout | |
uses: actions/checkout@v3.2.0 | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v3.5.1 | |
with: | |
node-version: 20.x | |
cache: 'yarn' | |
- name: Install node packages | |
run: yarn install | |
- name: Install Test dependencies | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y dpkg fakeroot rpm libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libgtk-3-0 libpango-1.0-0 libcairo2 libgdk-pixbuf2.0-0 libgbm1 libasound2 libatspi2.0-0 ffmpeg | |
- name: Install playwright | |
run: npx playwright install | |
- name: Provide 777 execution rights to clipboard handler script | |
run: | | |
sudo chmod 777 node_modules/clipboard-event/platform/clipboard-event-handler-linux | |
- name: Package | |
run: yarn package | |
- name: Run headless test | |
uses: coactions/setup-xvfb@v1 | |
with: | |
options: -screen 0 800x600x24 | |
run: yarn test:ui | |
- name: Tree list the runner | |
if: always() | |
run: | | |
tree . -I 'node_modules|src|images' | |
ls -la | |
ls -la .cache | |
- name: Read test log file | |
if: always() | |
run: | | |
[ -f playwright.log ] && cat playwright.log || true | |
- name: Copy test artifacts into the common folder | |
if: always() | |
run: | | |
[ -f playwright.log ] && mv playwright.log test-results/ || true | |
[ -d webm ] && mv webm/ test-results/ || true | |
- name: Upload a Test Artifact | |
if: always() | |
uses: actions/upload-artifact@v3.1.1 | |
with: | |
name: japReader-test-ui_${{ github.ref_name }}@${{ github.sha }} | |
path: test-results | |
retention-days: 28 |