mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
* added ui studio command * added SKIP ASSET UPLOAD option * updated failing tests * updated e2e scripts to include CI instructions * removed unused envs and slack messages * updated timeouts and max retries on CI * updated generated local env * updated env * updated env generation for e2e tests * remove vercel preview * updated tests and trying junit report on PR * update test comment * updated commit hash for reporter * updated file path * updated runner to blacksmith * update test file for reporting * Update .github/workflows/studio-e2e-test.yml Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update package.json Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * Update e2e/studio/playwright.config.ts Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> * updated to skip comment on forks --------- Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
Supabase Studio E2E Tests
Set up
cp .env.local.example .env.local
Install the playwright browser
⚠️ This should be done in the e2e/studio directory
cd e2e/studio
pnpm exec playwright install
Running the tests
Check the package.json for the available commands and environments.
pnpm run e2e
With Playwright UI:
pnpm run e2e -- --ui
Tips for development
- Read Playwright Best Practices
- Use
pnpm run e2e -- --uito get the playwright UI. - Add the tests in
examples/examples.tsto Cursor as context. - Add messages to expect statements to make them easier to debug.
Example:
await expect(page.getByRole('heading', { name: 'Logs & Analytics' }), {
message: 'Logs heading should be visible',
}).toBeVisible()
- Use the test utility instead of playwrights test.
import { test } from '../utils/test'
- Use the PWDEBUG environment variable to debug the tests.
PWDEBUG=1 pnpm run e2e -- --ui
What should I test?
- Can the feature be navigated to?
- Does the feature load correctly?
- Can you do the actions (filtering, sorting, opening dialogs, etc)?
API Mocks
Read here: https://playwright.dev/docs/mock#mock-api-requests
Example:
await page.route(`*/**/logs.all*`, async (route) => {
await route.fulfill({ body: JSON.stringify(mockAPILogs) })
})