Files
Compass/playwright.config.ts
Okechi Jones-Williams cfeab0278c [Housekeeping] Organizing the test structure and files, adding fix for issue #36 (None descriptive error) (#38)
* Added Database checks to the onboarding flow

* Added compatibility page setup
Added more compatibility questions

* Finished up the onboarding flow suite
Added compatibility question tests and verifications
Updated tests to cover Keywords and Headline changes recently made
Updated tests to cover all of the big5 personality traits

* Fix: Added 'tsconfig-paths/register' to playwright config so it applies tsconfig/ts-node to test files and imported modules....there was a syntax error:

SyntaxError: tests/e2e/web/pages/homePage.ts: Unexpected token (2:0)

* .

* Updated ProfilePage: In some cases removed the use of "one shot grabs" using .textContent() to prevent flaky tests
Added test for entering profile information post signup flow

* Linting and Prettier

* Fix: Merge conflict

* Fix: Modified sortedAndFilteredAnswers to use "UseMemo" so that it doesnt run every time something changes

* .

* .

* Merged "verifyInterestedInConnectingWith" and "verifyRelationShipTypeAndInterest" into "verifySeeking" to match ui changes

* Added error message outlining the minimum character requirement for display names and usernames

* Updated displayName error message to show when editing the user profile post signup

* Fix: Added fix for None discriptive error issue #36
Updated signUp.spec.ts to use new fixture
Updated Account information variable names
Deleted "deleteUserFixture.ts" as it was incorporated into the "base.ts" file

* Linting and Prettier

* Minor cleaning

* Organizing helper func

* Linting and Prettier

---------

Co-authored-by: MartinBraquet <martin.braquet@gmail.com>
2026-03-16 16:02:48 +01:00

68 lines
2.0 KiB
TypeScript

import {defineConfig, devices} from '@playwright/test'
import 'tsconfig-paths/register'
import {execSync} from 'child_process'
import {config} from 'dotenv'
// Load static env vars from .env.test
config({path: '.env.test', quiet: true})
// Dynamically pull Supabase vars
function getSupabaseEnv() {
try {
const raw = execSync('npx supabase status --output json 2>/dev/null', {encoding: 'utf-8'})
const status = JSON.parse(raw)
if (!status.API_URL) throw new Error('No supabase API URL')
if (!status.ANON_KEY) throw new Error('No supabase ANON_KEY')
if (!status.DB_URL) throw new Error('No supabase DB_URL')
return {
NEXT_PUBLIC_SUPABASE_URL: status.API_URL,
NEXT_PUBLIC_SUPABASE_ANON_KEY: status.ANON_KEY,
DATABASE_URL: status.DB_URL,
}
} catch (e) {
console.error(e)
throw new Error('Failed to get Supabase status. Is it running?')
}
}
const supabaseEnv = getSupabaseEnv()
// Inject into process.env so Playwright and your app code can read them
Object.assign(process.env, supabaseEnv)
export default defineConfig({
testDir: './tests/e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
// No retries by default (even in CI) because it slows the CI pipeline and masks real bugs
// If there is a known intermittent browser timing issue for some tests, it's fine to give 1 retry to those flaky tests
retries: process.env.CI ? 0 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: [['html', {outputFolder: `tests/reports/playwright-report`, open: 'on-failure'}]],
use: {
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',
// headless: false,
},
projects: [
{
name: 'main',
use: {
...devices['Desktop Chrome'],
},
},
// {
// name: 'firefox',
// use: { ...devices['Desktop Firefox'] },
// },
// {
// name: 'webkit',
// use: { ...devices['Desktop Safari'] },
// },
],
timeout: 120000,
expect: {
timeout: 120000,
},
})