Skip to content

Commit

Permalink
Add spinner while beginning of stream is pending
Browse files Browse the repository at this point in the history
  • Loading branch information
s-h-a-d-o-w committed Nov 27, 2024
1 parent f3a0130 commit 38a50f8
Show file tree
Hide file tree
Showing 12 changed files with 352 additions and 156 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
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: Build
run: pnpm build
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@ next-env.d.ts

## Panda
styled-system
styled-system-studio
styled-system-studio
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"start": "next start",
"start:local": "concurrently \"next start -p 3001\" \"npx local-ssl-proxy --key ./certificates/localhost-key.pem --cert ./certificates/localhost.pem --source 3000 --target 3001\"",
"test": "vitest",
"test:e2e": "playwright test --ui",
"typecheck": "tsc"
},
"dependencies": {
Expand All @@ -40,6 +41,7 @@
"devDependencies": {
"@next/bundle-analyzer": "^14.2.18",
"@pandacss/dev": "^0.46.1",
"@playwright/test": "^1.49.0",
"@types/lodash": "^4.17.13",
"@types/node": "^20.17.7",
"@types/react": "^18.3.12",
Expand All @@ -53,6 +55,7 @@
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"husky": "^9.1.7",
"playwright": "^1.49.0",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"tsx": "^4.19.2",
Expand Down
45 changes: 45 additions & 0 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { defineConfig, devices } from "@playwright/test";

const baseURL = "http://localhost:3000";

/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./tests",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env["CI"],
retries: 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL,

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
},

/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],

/* Run your local dev server before starting the tests */
webServer: {
command: "cross-env CI=true pnpm start",
url: baseURL,
stdout: "pipe",
stderr: "pipe",
env: {
...process.env,
CI: "true",
},
},
});
Loading

0 comments on commit 38a50f8

Please sign in to comment.