ci(deployment): 👷 Add e2e tests on Vercel deployment
This commit is contained in:
26
apps/builder/.github/workflows/playwright.yml
vendored
26
apps/builder/.github/workflows/playwright.yml
vendored
@@ -1,26 +0,0 @@
|
||||
name: Playwright Tests
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master ]
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
jobs:
|
||||
test:
|
||||
timeout-minutes: 60
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14.x'
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Install Playwright
|
||||
run: npx playwright install --with-deps
|
||||
- name: Run Playwright tests
|
||||
run: npx playwright test
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-test-results
|
||||
path: test-results/
|
||||
@@ -11,9 +11,10 @@ const config: PlaywrightTestConfig = {
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
workers: process.env.CI ? 1 : undefined,
|
||||
reporter: 'html',
|
||||
maxFailures: process.env.CI ? 10 : undefined,
|
||||
use: {
|
||||
actionTimeout: 0,
|
||||
baseURL: process.env.NEXTAUTH_URL,
|
||||
baseURL: process.env.PLAYWRIGHT_BUILDER_TEST_BASE_URL,
|
||||
trace: 'on-first-retry',
|
||||
storageState: path.join(__dirname, 'playwright/authenticatedState.json'),
|
||||
video: 'retain-on-failure',
|
||||
|
||||
@@ -19,7 +19,7 @@ test.describe('Webhook step', () => {
|
||||
await page.click('text=POST')
|
||||
await page.fill(
|
||||
'input[placeholder="Your Webhook URL..."]',
|
||||
`${process.env.NEXTAUTH_URL}/api/mock/webhook`
|
||||
`${process.env.PLAYWRIGHT_BUILDER_TEST_BASE_URL}/api/mock/webhook`
|
||||
)
|
||||
|
||||
await page.click('text=Query params')
|
||||
|
||||
Reference in New Issue
Block a user