Skip to content

Commit

Permalink
mock consents
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomartins8 committed Mar 26, 2024
1 parent 5364480 commit beb56dc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,3 @@ jobs:
run: npx playwright install --with-deps chromium
- name: Run Playwright tests
run: npm run e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: test-results/
retention-days: 30
7 changes: 7 additions & 0 deletions e2e/classic_integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ const getPage = async ({ withCameraPermissions = true }) => {

await page.context().grantPermissions(permissions)

// Mocking consents being given
await page.route('**/applicants/*/consents', async (route) => {
return route.fulfill({
body: JSON.stringify([]),
})
})

return page
}

Expand Down
5 changes: 3 additions & 2 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig, devices } from '@playwright/test'

import { config } from 'dotenv'
import * as process from 'process'

/**
* Read environment variables from file.
Expand All @@ -18,7 +19,7 @@ export default defineConfig({
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: 1,
retries: process.env.CI ? 1 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
Expand All @@ -32,7 +33,7 @@ export default defineConfig({
trace: 'on-first-retry',

/* https://playwright.dev/docs/videos#record-video */
video: 'on-first-retry',
// video: 'on-first-retry',
},

/* Configure projects for major browsers */
Expand Down

0 comments on commit beb56dc

Please sign in to comment.