Skip to content

Commit

Permalink
Add Playwright (#1110)
Browse files Browse the repository at this point in the history
* remix-run/indie-stack#230

* Use Doppler to start dev server

* Enable v2_headers

* Explicitly set serverModuleFormat to cjs

* Remove extra auth logging

* Clean up workflow files

* Remove custom CodeQL setup

* Add Playwright

* Add Playwright workflow

* Remove example tests

* Add component testing

* Update Playwright workflow to add component tests
  • Loading branch information
stephenwade authored Aug 28, 2023
1 parent 1941632 commit 9fc8a7f
Show file tree
Hide file tree
Showing 19 changed files with 358 additions and 118 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
npm-debug.log
.git
25 changes: 0 additions & 25 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

9 changes: 5 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
name: Lint

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

jobs:
lint:
name: Lint

runs-on: ubuntu-latest

steps:
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: Playwright

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm

- run: npm ci

- name: Install Playwright browsers
run: npx playwright install --with-deps

- run: npm run test

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/

ct:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm

- run: npm ci

- name: Install Playwright browsers
run: npx playwright install --with-deps

- run: npm run test-ct

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
44 changes: 0 additions & 44 deletions .github/workflows/test.yml

This file was deleted.

15 changes: 8 additions & 7 deletions .github/workflows/type-check.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
name: Type check

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

jobs:
lint:
name: Type check

tsc:
runs-on: ubuntu-latest

steps:
Expand All @@ -20,6 +21,6 @@ jobs:
node-version: 18
cache: npm

- run: npm install
- run: npm ci

- run: npm run type-check
- run: npx tsc
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ build/

# runtime
upload
/test-results/
/playwright-report/
/playwright/.cache/
2 changes: 0 additions & 2 deletions app/auth/redirect-to-login.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export async function redirectToLogin(
args: LoaderArgs,
{ onHoldPage }: RedirectToLoginArgs = {},
) {
const auth = await getAuth(args);
const { userId } = await getAuth(args);

if (!userId) {
Expand All @@ -22,7 +21,6 @@ export async function redirectToLogin(
const user = await createClerkClient({
apiKey: process.env.CLERK_SECRET_KEY,
}).users.getUser(userId);
console.dir({ auth, user }, { depth: null });

const allowed = await userIsAllowed(user);
if (!allowed && !onHoldPage) {
Expand Down
1 change: 1 addition & 0 deletions doppler.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
setup:
project: festival
Loading

0 comments on commit 9fc8a7f

Please sign in to comment.