Skip to content

Commit

Permalink
fix test workflow, split tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zeeket committed Jul 19, 2024
1 parent 4d92685 commit b65bd4c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 7 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,49 @@
name: Playwright Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:

test:
timeout-minutes: 60
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 && pnpm install

- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps

- name: Create .env file
run: |
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> .env
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env
echo "NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }}" >> .env
echo "NEXT_PUBLIC_TG_BOT_NAME=${{ secrets.NEXT_PUBLIC_TG_BOT_NAME }}" >> .env
echo "TG_BOT_TOKEN=${{ secrets.TG_BOT_TOKEN }}" >> .env
echo "FORUM_ROOT_NAME=${{ secrets.FORUM_ROOT_NAME }}" >> .env
- name: Create .hytkybot.env file
run: |
echo "TG_BOT_TOKEN=${{ secrets.TG_BOT_TOKEN }}" >> .hytkybot.env
echo "TG_ACTIVE_GROUP_IDS=${{ secrets.TG_ACTIVE_GROUP_IDS }}" >> .hytkybot.env
echo "TG_ADMIN_GROUP_IDS=${{ secrets.TG_ADMIN_GROUP_IDS }}" >> .hytkybot.env
echo "PORT=3000" >> .hytkybot.env
- name: Run Playwright tests
run: pnpm exec playwright test

- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
8 changes: 8 additions & 0 deletions tests/index.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { test, expect } from "@playwright/test";

test("has title", async ({ page }) => {
await page.goto("/");

// Expect a title "to contain" a substring.
await expect(page).toHaveTitle(/HYTKY/);
});
7 changes: 0 additions & 7 deletions tests/static.finnish.spec.ts → tests/rental.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
import { test, expect } from "@playwright/test";

test("has title", async ({ page }) => {
await page.goto("/");

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

test("navigate to rental page and back", async ({ page }) => {
await page.goto("/");

Expand Down

0 comments on commit b65bd4c

Please sign in to comment.