ci: 🔨 Run Playwright tests on pull request
This commit is contained in:
22
.github/workflows/playwright.yml
vendored
22
.github/workflows/playwright.yml
vendored
@@ -14,27 +14,27 @@ jobs:
|
|||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn
|
run: yarn
|
||||||
|
- name: Build dependencies
|
||||||
|
run: yarn turbo run build --scope=builder --include-dependencies
|
||||||
- name: Install Playwright
|
- name: Install Playwright
|
||||||
run: npx playwright install --with-deps
|
run: npx playwright install --with-deps
|
||||||
- name: Build db package
|
|
||||||
working-directory: ./packages/db
|
|
||||||
run: yarn build
|
|
||||||
env:
|
|
||||||
DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }}
|
|
||||||
- name: Build models package
|
|
||||||
working-directory: ./packages/models
|
|
||||||
run: yarn build
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
working-directory: ./apps/builder
|
working-directory: ./apps/builder
|
||||||
run: yarn test
|
run: yarn test
|
||||||
env:
|
env:
|
||||||
PLAYWRIGHT_BUILDER_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }}
|
PLAYWRIGHT_BUILDER_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }}
|
||||||
GITHUB_EMAIL: ${{ secrets.PLAYWRIGHT_GITHUB_EMAIL }}
|
|
||||||
GITHUB_PASSWORD: ${{ secrets.PLAYWRIGHT_GITHUB_PASSWORD }}
|
|
||||||
DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }}
|
DATABASE_URL: ${{ secrets.TEST_DATABASE_URL }}
|
||||||
|
SMTP_HOST: smtp.ethereal.email
|
||||||
|
SMTP_PORT: 587
|
||||||
|
SMTP_SECURE: false
|
||||||
|
SMTP_USERNAME: tobin.tillman65@ethereal.email
|
||||||
|
SMTP_PASSWORD: Ty9BcwCBrK6w8AG2hx
|
||||||
|
STRIPE_TEST_PUBLIC_KEY: pk_test_fYwf5fyL66hiRIkFVcpStukl00K1MTPPmG
|
||||||
|
STRIPE_TEST_SECRET_KEY: ${{ secrets.STRIPE_TEST_SECRET_KEY }}
|
||||||
|
ENCRYPTION_SECRET: ${{ secrets.ENCRYPTION_SECRET }}
|
||||||
- name: Upload test results
|
- name: Upload test results
|
||||||
if: always()
|
if: always()
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: playwright-results
|
name: playwright-results
|
||||||
path: test-results
|
path: ./apps/builder/playwright-report
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { rest, setupWorker } from 'msw'
|
|||||||
import { setupServer } from 'msw/node'
|
import { setupServer } from 'msw/node'
|
||||||
|
|
||||||
const handlers = () => [
|
const handlers = () => [
|
||||||
rest.get('http://localhost:3000/api/auth/session', (req, res, ctx) => {
|
rest.get('/api/auth/session', (req, res, ctx) => {
|
||||||
const authenticatedUser = JSON.parse(
|
const authenticatedUser = JSON.parse(
|
||||||
typeof localStorage !== 'undefined'
|
typeof localStorage !== 'undefined'
|
||||||
? (localStorage.getItem('authenticatedUser') as string)
|
? (localStorage.getItem('authenticatedUser') as string)
|
||||||
|
|||||||
Reference in New Issue
Block a user