Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #23 from Dino-Kupinic/21-create-github-actions-for…
Browse files Browse the repository at this point in the history
…-vitest-and-playwright

feat: setup vitest and playwright workflow
  • Loading branch information
Dino-Kupinic authored Mar 11, 2024
2 parents 491d917 + c11c9b8 commit d12ecc0
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 30 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
jobs:
test:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && cd frontend && pnpm install
- name: Install Playwright Browsers
run: cd frontend && pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: cd frontend && pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
22 changes: 22 additions & 0 deletions .github/workflows/vitest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Vitest Tests
on:
push:
branches: [ main, master, develop ]
pull_request:
branches: [ main, master, develop ]
jobs:
test:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install PNPM
run: npm install -g pnpm
- name: Install dependencies
run: cd frontend && pnpm install
- name: Run Vitest tests
run: cd frontend && pnpm run test

27 changes: 0 additions & 27 deletions frontend/.github/workflows/playwright.yml

This file was deleted.

4 changes: 3 additions & 1 deletion frontend/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,7 @@ export default defineConfig({
command: 'pnpm run dev',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
},
stdout: 'ignore',
stderr: 'pipe',
}
});
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {test, expect} from "@playwright/test"

test("has title", async ({page}) => {
await page.goto("http://localhost:3000/")
await page.goto("/")

// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/Schulbuchaktion/)
})

0 comments on commit d12ecc0

Please sign in to comment.