2
0

ci(deployment): 👷 Add e2e tests on Vercel deployment

This commit is contained in:
Baptiste Arnaud
2022-01-28 09:54:13 +01:00
parent 73f277fce7
commit 65209c2638
7 changed files with 96 additions and 93 deletions

View File

@@ -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/

View File

@@ -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',

View File

@@ -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')