-
Notifications
You must be signed in to change notification settings - Fork 0
test: set up playwright #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
07d6e48
test: set up BDD/E2E test support
kantord 079aa97
Merge branch 'main' into set-up-playwright
kantord ce5a53d
add inspector mode
kantord 8a2da1f
add tracing mode
kantord a3c2cd7
automate all aria roles for cucumber tests
kantord f70d24a
simplify some stuff
kantord 9da119c
.
kantord a188a5e
.
kantord 2f96c6f
.
kantord 90d40bb
Merge branch 'main' into set-up-playwright
kantord 6cc0279
fixes
kantord 4fd4ff0
login "fixture"
kantord f44313f
do not hang after successful run
kantord d5264ac
cookie injection to keep authentication fast
kantord d10417b
fix ci failure
kantord cc0d781
.
kantord 4e43d58
.
kantord 30fb891
Merge branch 'main' into set-up-playwright
kantord 5430b64
.
kantord acdc496
implement review suggestions
kantord fe563b7
cleanup
kantord 123250d
cleanup
kantord 2cd7547
remove unused rule definition
kantord d3ddb4c
stricted path for healthcheck url
kantord d6dea31
Merge branch 'main' into set-up-playwright
kantord 61b26fa
remove cucumber
kantord 80eb323
auto run dev server if it's not already runnging
kantord d32f206
fix vitest config
kantord df8c2d1
rename gh workload file
kantord 0085ce5
.
kantord 11926e6
much cleaner ci
kantord 0b6e69c
remove duplicated documentation
kantord 8a8ddc4
use obviously fake env vars
kantord 8eb9147
remove leftofver
kantord 50ac1d1
test that mcp servers are rendered
kantord 5c78df4
Merge branch 'main' into set-up-playwright
kantord 56c13ed
Merge branch 'main' into set-up-playwright
kantord File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: E2E Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["**"] | ||
| pull_request: | ||
| branches: ["**"] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| e2e: | ||
| name: Playwright E2E | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| env: | ||
| API_BASE_URL: http://localhost:9090 | ||
| OIDC_ISSUER_URL: http://localhost:4000 | ||
| OIDC_CLIENT_ID: test-only-not-a-real-id | ||
| OIDC_CLIENT_SECRET: test-only-not-a-real-secret | ||
| NEXT_PUBLIC_OIDC_PROVIDER_ID: oidc | ||
| BETTER_AUTH_URL: http://localhost:3000 | ||
| BETTER_AUTH_SECRET: test-only-not-a-real-better-auth-secret | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup | ||
| uses: ./.github/actions/setup | ||
|
|
||
| - name: Install Playwright browsers | ||
| run: pnpm exec playwright install --with-deps chromium | ||
|
|
||
| - name: Run Playwright tests | ||
| run: pnpm test:e2e | ||
|
|
||
| - name: Upload test artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| if: failure() | ||
| with: | ||
| name: playwright-report | ||
| path: | | ||
| test-results/ | ||
| playwright-report/ | ||
| retention-days: 7 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import { defineConfig, devices } from "@playwright/test"; | ||
|
|
||
| const BASE_URL = process.env.BASE_URL || "http://localhost:3000"; | ||
|
|
||
| async function isServerRunning(): Promise<boolean> { | ||
| try { | ||
| await fetch(BASE_URL, { signal: AbortSignal.timeout(2000) }); | ||
| return true; | ||
| } catch { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| const serverAlreadyRunning = await isServerRunning(); | ||
|
|
||
| export default defineConfig({ | ||
| testDir: "./tests/e2e", | ||
| fullyParallel: true, | ||
| forbidOnly: !!process.env.CI, | ||
| retries: process.env.CI ? 2 : 0, | ||
| workers: process.env.CI ? 1 : undefined, | ||
| reporter: process.env.CI ? "github" : "list", | ||
| timeout: 30_000, | ||
| use: { | ||
| baseURL: BASE_URL, | ||
| trace: "on-first-retry", | ||
| screenshot: "only-on-failure", | ||
| }, | ||
| projects: [ | ||
| { | ||
| name: "chromium", | ||
| use: { ...devices["Desktop Chrome"] }, | ||
| }, | ||
| ], | ||
| webServer: serverAlreadyRunning | ||
| ? undefined | ||
| : { | ||
| command: "pnpm dev", | ||
| url: BASE_URL, | ||
| timeout: 120_000, | ||
| stdout: "pipe", | ||
| stderr: "pipe", | ||
| env: { | ||
| API_BASE_URL: "http://localhost:9090", | ||
| OIDC_ISSUER_URL: "http://localhost:4000", | ||
| OIDC_CLIENT_ID: "better-auth-dev", | ||
| OIDC_CLIENT_SECRET: "dev-secret-change-in-production", | ||
| NEXT_PUBLIC_OIDC_PROVIDER_ID: "okta", | ||
| BETTER_AUTH_URL: "http://localhost:3000", | ||
| BETTER_AUTH_SECRET: "e2e-test-secret-at-least-32-chars-long", | ||
| }, | ||
| }, | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.