Skip to content

Commit

Permalink
Run tests in Electron
Browse files Browse the repository at this point in the history
  • Loading branch information
markspolakovs committed Dec 29, 2024
1 parent f7ec14f commit d756923
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
working-directory: ./desktop
env:
TEST_APPLICATION_PATH: ${{ runner.temp }}\badger\Badger Desktop.exe
ELECTRON: "true"

linear:
needs: [test-e2e-server, test-desktop]
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ jobs:
PLAYWRIGHT_HTML_REPORT: ${{ github.workspace }}/server/playwright-report

- uses: actions/upload-artifact@v3
if: always()
if: failure()
with:
name: playwright-report-server
path: ./server/playwright-report/
Expand All @@ -187,10 +187,13 @@ jobs:
test-e2e-desktop-standalone:
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
ELECTRON: [true, false]
env:
NODE_ENV: test
E2E_TEST: "true"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: ${{ matrix.ELECTRON == 'true' && 1 || 0 }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
Expand All @@ -210,15 +213,21 @@ jobs:
- name: Make logs folder
run: mkdir -p ${{ runner.temp }}/logs

- uses: ./.github/steps/setup-playwright
with:
working-directory: ./server
if: matrix.ELECTRON == 'false'

- name: Run Playwright tests
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn ${{ runner.debug && 'test:e2e:debug' || 'test:e2e' }} --project standalone
working-directory: ./desktop
env:
PLAYWRIGHT_HTML_REPORT: ${{ github.workspace }}/desktop/playwright-report
BADGER_LOGS_PATH: ${{ runner.temp }}/logs
ELECTRON: ${{ matrix.ELECTRON }}

- uses: actions/upload-artifact@v3
if: always()
if: failure()
with:
name: playwright-report-desktop
path: |
Expand Down Expand Up @@ -297,9 +306,10 @@ jobs:
env:
PLAYWRIGHT_HTML_REPORT: ${{ github.workspace }}/desktop/playwright-report
BADGER_LOGS_PATH: ${{ runner.temp }}/logs
ELECTRON: "true"

- uses: actions/upload-artifact@v3
if: always()
if: failure()
with:
name: playwright-report-desktop
path: |
Expand Down

0 comments on commit d756923

Please sign in to comment.