Merge branch 'main' of https://github.com/astrxldev/buzzy
This commit is contained in:
@@ -6,25 +6,43 @@ on:
|
||||
branches: [ main, master ]
|
||||
jobs:
|
||||
test:
|
||||
environment: Build
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- name: Get installed Playwright version
|
||||
id: playwright-version
|
||||
run: |
|
||||
export VER=$(bun --print "require('./bun.lock').workspaces[''].devDependencies['@playwright/test'].slice(1)")
|
||||
echo "PLAYWRIGHT_VERSION=$VER" >> $GITHUB_ENV
|
||||
- name: Cache playwright binaries
|
||||
uses: actions/cache@v3
|
||||
id: playwright-cache
|
||||
with:
|
||||
node-version: lts/*
|
||||
path: |
|
||||
~/.cache/ms-playwright
|
||||
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
|
||||
- name: Install dependencies
|
||||
run: bun i --frozen-lockfile
|
||||
- name: Install Playwright Browsers
|
||||
run: bun x playwright install --with-deps
|
||||
- name: Tailscale
|
||||
uses: tailscale/github-action@v4
|
||||
with:
|
||||
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
|
||||
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
|
||||
tags: tag:ci
|
||||
- name: Run Playwright tests
|
||||
run: bun x playwright test
|
||||
env: # Or as an environment variable
|
||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
||||
BETTER_AUTH_SECRET: ${{ secrets.DATABASE_URL }}
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ !cancelled() }}
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
BASE_URL: ${{ vars.BASE_URL }}
|
||||
# - uses: actions/upload-artifact@v4
|
||||
# if: ${{ !cancelled() }}
|
||||
# with:
|
||||
# name: playwright-report
|
||||
# path: playwright-report/
|
||||
# retention-days: 30
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
const { BASE_URL = "http://localhost:3000" } = process.env;
|
||||
const BASE_URL = "http://localhost:3000";
|
||||
|
||||
test("has title", async ({ page }) => {
|
||||
await page.goto(BASE_URL);
|
||||
@@ -11,7 +11,7 @@ test("has title", async ({ page }) => {
|
||||
|
||||
test("artifact link", async ({ page }) => {
|
||||
await page.goto(BASE_URL);
|
||||
|
||||
|
||||
const viewportSize = page.viewportSize();
|
||||
const isMobile = viewportSize && viewportSize.width < 768;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user