-
Notifications
You must be signed in to change notification settings - Fork 0
CC-64: Add First Playwright Tests #333
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
ianpaschal
merged 16 commits into
ian/cc-2-improve-pairing-workflow
from
ian/cc-64-add-first-playwright-tests
May 22, 2026
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
22242a2
WIP
ianpaschal 393156d
WIP
ianpaschal 7671143
WIP
ianpaschal 2a2205f
WIP
ianpaschal 2c1c60e
WIP
ianpaschal 68d6f59
WIP
ianpaschal ad2d07a
WIP
ianpaschal 5a5e84e
Finish adding tests
ianpaschal 6ce976e
Update ci.yml
ianpaschal ddfa831
Update ci.yml
ianpaschal 6925700
Update assignTables.test.ts
ianpaschal 4014614
Change Convex preview
ianpaschal 1b83e05
Update ci.yml
ianpaschal 17d9d08
Update ci.yml
ianpaschal 516f5f2
PR Feedback
ianpaschal 3d87af0
PR Feedback
ianpaschal 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,69 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | ||
| with: | ||
| node-version: '24' | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
| env: | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
|
||
| - name: Unit tests | ||
| run: npm test | ||
|
|
||
| - name: Deploy Convex preview | ||
| run: | | ||
| npx convex deploy \ | ||
| --preview-create "pr-${{ github.event.pull_request.number }}-${{ github.run_attempt }}" \ | ||
| --cmd-url-env-var-name VITE_CONVEX_URL \ | ||
| --cmd 'echo "VITE_CONVEX_URL=$VITE_CONVEX_URL" >> "$GITHUB_ENV"' | ||
| env: | ||
| CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY }} | ||
|
|
||
| - name: Configure preview deployment environment | ||
| run: | | ||
| PREVIEW="pr-${{ github.event.pull_request.number }}-${{ github.run_attempt }}" | ||
| npx convex env set --preview-name "$PREVIEW" -- JWT_PRIVATE_KEY "$JWT_PRIVATE_KEY" | ||
| npx convex env set --preview-name "$PREVIEW" -- JWKS "$JWKS" | ||
| npx convex env set --preview-name "$PREVIEW" -- AUTH_RESEND_KEY "$AUTH_RESEND_KEY" | ||
| npx convex env set --preview-name "$PREVIEW" -- SITE_URL "http://localhost:5173" | ||
| env: | ||
| CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY }} | ||
| JWT_PRIVATE_KEY: ${{ secrets.CONVEX_JWT_PRIVATE_KEY }} | ||
| JWKS: ${{ secrets.CONVEX_JWKS }} | ||
| AUTH_RESEND_KEY: ${{ secrets.CONVEX_AUTH_RESEND_KEY }} | ||
|
|
||
| - name: Install Playwright browsers | ||
| run: npx playwright install firefox --with-deps | ||
|
|
||
| - name: E2E tests | ||
| run: npm run test:e2e | ||
| env: | ||
| CONVEX_DEPLOY_KEY: ${{ secrets.CONVEX_DEPLOY_KEY }} | ||
| CONVEX_PREVIEW_NAME: pr-${{ github.event.pull_request.number }}-${{ github.run_attempt }} | ||
|
|
||
| - name: Upload Playwright report | ||
| if: failure() | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | ||
| with: | ||
| name: playwright-report | ||
| path: 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
File renamed without changes.
File renamed without changes.
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,2 @@ | ||
| export * from './actions/populateUsers'; | ||
| export * from './mutations/cleanUp'; |
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,24 @@ | ||
| import type { TableNamesInDataModel } from 'convex/server'; | ||
| import { Infer, v } from 'convex/values'; | ||
|
|
||
| import type { DataModel } from '../../../_generated/dataModel'; | ||
| import type { MutationCtx } from '../../../_generated/server'; | ||
| import schema from '../../../schema'; | ||
|
|
||
| type TableName = TableNamesInDataModel<DataModel>; | ||
|
|
||
| export const cleanUpArgs = v.object({ | ||
| preservedTables: v.array(v.string()), | ||
| }); | ||
|
|
||
| export const cleanUp = async ( | ||
| ctx: MutationCtx, | ||
| args: Infer<typeof cleanUpArgs>, | ||
| ): Promise<void> => { | ||
| const preserved = new Set(args.preservedTables); | ||
| const tables = (Object.keys(schema.tables) as TableName[]).filter((t) => !preserved.has(t)); | ||
| for (const table of tables) { | ||
| const docs = await ctx.db.query(table).collect(); | ||
| await Promise.all(docs.map((doc) => ctx.db.delete(doc._id))); | ||
| } | ||
| }; |
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
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
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,15 @@ | ||
| import { Infer, v } from 'convex/values'; | ||
|
|
||
| import { Doc } from '../../../../_generated/dataModel'; | ||
| import { QueryCtx } from '../../../../_generated/server'; | ||
|
|
||
| export const getUserByUsernameArgs = v.object({ | ||
| username: v.string(), | ||
| }); | ||
|
|
||
| export const getUserByUsername = async ( | ||
| ctx: QueryCtx, | ||
| args: Infer<typeof getUserByUsernameArgs>, | ||
| ): Promise<Doc<'users'> | null> => await ctx.db.query('users') | ||
| .withIndex('by_username', (q) => q.eq('username', args.username)) | ||
| .first(); |
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
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.