Skip to content

Commit

Permalink
Init test action
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesPeck committed Dec 18, 2023
1 parent 25c1c14 commit 608d83b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
File renamed without changes.
26 changes: 26 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Tests
on:
push:
branches: [main, dev]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
2 changes: 1 addition & 1 deletion tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { expect, test } from '@playwright/test';

test('index page has expected h1', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('heading', { name: 'Welcome to SvelteKit' })).toBeVisible();
await expect(page.getByRole('heading', { name: "Let's get cracking bones!" })).toBeVisible();
});

0 comments on commit 608d83b

Please sign in to comment.