Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(playwright): triage skipped tests, document coverage policy, and scaffold fixes (#60531)

Georges-Antoine Assi5b256ff410e5
diff --git a/.github/scripts/verify-playwright-new-tests-and-snapshots.sh b/.github/scripts/verify-playwright-new-tests-and-snapshots.sh
index 1a5a5edf8921..4a6af959dcdd 100755
--- a/.github/scripts/verify-playwright-new-tests-and-snapshots.sh
+++ b/.github/scripts/verify-playwright-new-tests-and-snapshots.sh
@@ -77,7 +77,7 @@ set +e
# Fail fast once instability is detected so the job doesn't burn the full timeout
# on the remaining repeated runs.
pnpm --filter=@posthog/playwright exec playwright test "${tests_to_run[@]}" \
- --workers=1 --repeat-each="$REPEAT_COUNT" --retries=0 --max-failures=1
+ --workers=4 --repeat-each="$REPEAT_COUNT" --retries=0 --max-failures=1
test_exit=$?
set -e
diff --git a/.github/workflows/ci-e2e-playwright-audit.yml b/.github/workflows/ci-e2e-playwright-audit.yml
new file mode 100644
index 000000000000..3292349e2815
--- /dev/null
+++ b/.github/workflows/ci-e2e-playwright-audit.yml
@@ -0,0 +1,35 @@
+# Nightly flake-rate audit for the Playwright suite.
+#
+# The main E2E Playwright workflow retries each test 3 times, which masks per-test
+# flake rate (a test failing 50% of the time still shows green 93.75% of the time
+# across 4 attempts). This workflow re-runs the same suite with PLAYWRIGHT_RETRIES=0
+# on a nightly cron, so we can rank tests by raw failure rate and feed that signal
+# back into prioritization.
+#
+# Failures here do NOT gate any PR. The point is the data, not the verdict.
+
+name: E2E Playwright Flake Audit
+
+on:
+ schedule:
+ # 07:00 UTC daily — off-peak for both US and EU.
+ - cron: '0 7 * * *'
+ workflow_dispatch:
+
+permissions:
+ contents: read
+ actions: write
+
+jobs:
+ trigger_audit:
+ name: Trigger Playwright run with retries=0
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ steps:
+ - name: Dispatch main E2E workflow with PLAYWRIGHT_RETRIES=0
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ gh workflow run ci-e2e-playwright.yml \
+ --ref master \
+ --field playwright_retries=0
diff --git a/.github/workflows/ci-e2e-playwright.yml b/.github/workflows/ci-e2e-playwright.yml
index 1702e652c2bf..644c93c5f3f0 100644
--- a/.github/workflows/ci-e2e-playwright.yml
+++ b/.github/workflows/ci-e2e-playwright.yml
@@ -7,6 +7,12 @@ name: E2E CI Playwright
on:
pull_request:
workflow_dispatch:
+ inputs:
+ playwright_retries:
+ description: 'Override Playwright retries (leave empty for default of 3 on CI). Set to "0" to surface true per-test failure rate.'
+ required: false
+ type: string
+ default: ''
push:
branches:
- master
@@ -178,7 +184,7 @@ jobs:
# the workload "is not resource constrained" even after sharding was removed).
# Talk to #team-devex before changing.
runs-on: depot-ubuntu-latest-8
- timeout-minutes: 45
+ timeout-minutes: 75
permissions:
contents: read
pull-requests: write
@@ -279,10 +285,8 @@ jobs:
pnpm-lock.yaml
.github/workflows/ci-e2e-playwright.yml
- # tests would intermittently fail in GH actions
- # with exit code 134 _after passing_ all tests
- # this appears to fix it
- # absolute wild tbh https://stackoverflow.com/a/75503402
+ # Workaround for SIGABRT (exit 134) raised after all tests pass.
+ # See https://pytest-qt.readthedocs.io/en/latest/troubleshooting.html#tlambert03-setup-qt-libs
- uses: tlambert03/setup-qt-libs@19e4ef2d781d81f5f067182e228b54ec90d23b76 # v1.8
- name: Install plugin_transpiler
@@ -515,6 +519,11 @@ jobs:
- name: Run Playwright tests
id: playwright-tests
shell: bash
+ env:
+ # The flake-audit workflow (.github/workflows/ci-e2e-playwright-audit.yml)
+ # passes PLAYWRIGHT_RETRIES=0 to surface real per-test failure rates.
+ # PR/master runs leave this unset and inherit the default (3 retries).
+ PLAYWRIGHT_RETRIES: ${{ inputs.playwright_retries }}
# WARNING: Worker count is tuned to avoid CPU scheduling contention. Talk to #team-devex before changing.
# Reduced from 6+4 to 4+2 to minimize CPU scheduling contention (see PR #46853)
# Capture-only: VR is the gate for visual changes, Playwright just captures screenshots
diff --git a/bin/mprocs-e2e.yaml b/bin/mprocs-e2e.yaml
index aaefb6f72946..328b0672cf69 100644
--- a/bin/mprocs-e2e.yaml
+++ b/bin/mprocs-e2e.yaml
@@ -4,6 +4,7 @@ procs:
shell: 'pnpm --filter=@posthog/frontend build:products && pnpm --filter=@posthog/playwright exec playwright test --ui'
env:
BASE_URL: 'http://localhost:8010'
+ EMAIL_HOST: 'email.test.posthog.net'
backend:
shell: 'uv sync --active && bin/wait-for-docker && ./bin/start-backend'
@@ -18,6 +19,8 @@ procs:
DEBUG: '1'
E2E_TESTING: '1'
PERSON_ON_EVENTS_OVERRIDE: '1'
+ PERSONHOG_ENABLED: '0'
+ PERSONHOG_ADDR: ''
celery-worker:
shell: 'uv sync --active && bin/wait-for-docker && ./bin/start-celery worker'
@@ -31,6 +34,8 @@ procs:
SKIP_SERVICE_VERSION_REQUIREMENTS: '1'
DEBUG: '1'
E2E_TESTING: '1'
+ PERSONHOG_ENABLED: '0'
+ PERSONHOG_ADDR: ''
frontend:
shell: './bin/start-frontend'
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 020dc5bbad76..6877ca7f1e96 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -4081,7 +4081,7 @@ snapshots:
replay-tabs-home-success--second-recording-in-list--dark:
hash: v1.k794b7964.e55e3f17536c13f7561cd6275dc2c63e9950e7f83394de972364ba0b51211c58.S9fUa5v1eSxXT-D7D7lmS3os0kSj8a1gIhb7EPsivNc
replay-tabs-home-success--second-recording-in-list--light:
- hash: v1.k794b7964.fbde98c938fc6f7b723a039b4f2a4543abfd6e2b550d89bacdbfc63db8bea0db.zju5OmTahN7mHk7YiUhK4HTO3zD0oNhLaCsELsojZ-Y
+ hash: v1.k794b7964.db9df524befb2d2b1f9115318d2a4ddc5cd5009ef1e38100a7511011634114b8.wlpOrqbKlF47Bul9gFvQ2fuD9OXN-TopZSNFM3Z7K2I
scenes-app-ai-observability-clustercard--default--dark:
hash: v1.k794b7964.5b397853828a87a4a671588d90d24bde61467753bf47606778b62c53b0ff3cca.1F0WlI-KNht4OquFGMjY8sMz8biKoVlVYdl_Z6ofxH0
scenes-app-ai-observability-clustercard--default--light:
diff --git a/frontend/src/scenes/insights/insightVizDataLogic.ts b/frontend/src/scenes/insights/insightVizDataLogic.ts
index 0b74ba122a70..d74f6e66959f 100644
--- a/frontend/src/scenes/insights/insightVizDataLogic.ts
+++ b/frontend/src/scenes/insights/insightVizDataLogic.ts
@@ -121,7 +121,10 @@ export const insightVizDataLogic = kea<insightVizDataLogicType>([
dataThemeLogic,
['getTheme'],
],
- actions: [insightDataLogic, ['setQuery', 'setInsightData', 'loadData', 'loadDataSuccess', 'loadDataFailure']],
+ actions: [
+ insightDataLogic,
+ ['setQuery', 'setInsightData', 'loadData', 'loadDataSuccess', 'loadDataFailure', 'cancelChanges'],
+ ],
})),
actions({
@@ -570,7 +573,7 @@ export const insightVizDataLogic = kea<insightVizDataLogicType>([
],
}),
- listeners(({ actions, values, props }) => ({
+ listeners(({ actions, values, props, cache }) => ({
// query
setQuery: ({ query }) => {
if (isInsightVizNode(query)) {
@@ -580,6 +583,14 @@ export const insightVizDataLogic = kea<insightVizDataLogicType>([
}
},
+ // Discarding edits reverts the query to the saved version. A debounced filter
+ // update (e.g. updateDateRange) that was dispatched just before the discard would
+ // otherwise resolve afterwards and re-apply the discarded value on top of the
+ // reverted query. Flag it so the in-flight debounce bails out instead.
+ cancelChanges: () => {
+ cache.pendingFilterUpdateCancelled = true
+ },
+
// query source
updateQuerySource: ({ querySource }) => {
actions.setQuery({
@@ -597,9 +608,16 @@ export const insightVizDataLogic = kea<insightVizDataLogicType>([
// query source properties
updateDateRange: async ({ dateRange, ignoreDebounce }, breakpoint) => {
+ cache.pendingFilterUpdateCancelled = false
if (!ignoreDebounce) {
await breakpoint(300)
}
+ // Changes were discarded while this debounce was pending — don't re-apply the
+ // edited date range over the query that cancelChanges just reverted.
+ if (cache.pendingFilterUpdateCancelled) {
+ cache.pendingFilterUpdateCancelled = false
+ return
+ }
eventUsageLogic.actions.reportInsightDateRangeChanged(values.querySource?.kind)
const updates = {
dateRange: {
diff --git a/playwright/README.md b/playwright/README.md
index 81b640101284..4f9da9d9caf5 100644
--- a/playwright/README.md
+++ b/playwright/README.md
@@ -8,7 +8,7 @@ Spin up a full local E2E environment (backend, frontend, docker services, Playwr
hogli test:e2e
```
-This uses `bin/phrocs-e2e.yaml` under the hood. If you need to reset the E2E database, trigger the `reset-db` process in the phrocs UI.
+This uses `bin/mprocs-e2e.yaml` under the hood. If you need to reset the E2E database, trigger the `reset-db` process in the phrocs UI.
To run tests against an already-running PostHog instance:
@@ -25,6 +25,25 @@ It will explore the UI with Playwright MCP tools, plan the tests, implement them
## Writing tests
+### What belongs in this suite
+
+This suite is expensive as it runs the full stack and a real browser, and every spec costs PR runtime, runner credits, and a slice of the team's flake budget. Use these principles to decide whether a test is worth that cost.
+
+### Test what only a browser can prove
+
+E2E is uniquely suited to multi-step journeys where the frontend, network, backend, and datastores all have to agree at once. If a regression would surface in a Jest + kea test, a Storybook story, an API integration test, or a ClickHouse unit test, write it there instead — cheaper to run, easier to debug, no 8-vCPU runner tied up.
+
+### Prefer the cheapest layer that can catch the bug
+
+- "Page renders", "button is present", "heading reads X", "tab is active"
+ - Those are smoke checks, not e2e, and they belong in Jest or Storybook.
+- Visual regressions belong in Storybook visual review.
+- If a failure can be diagnosed without reading a backend log, the test probably didn't need the backend.
+
+### Each test should earn its slot
+
+The suite stays small on purpose; the bigger it gets, the noisier the flake signal becomes, and we drift back into "ignore the red, it's probably flake". You should treat adding a spec like adding a CI job. Justify it in the PR description (which cross-stack flow, why won't a lower layer catch it, how it sits next to the existing specs, etc.). Reviewers should push back when that justification is thin. "Nice to have coverage" isn't enough, but "this flow has broken in prod and nothing below this layer would have caught it" is.
+
### Best practices
- Don't use CSS selectors — prefer accessibility roles (`getByRole`) or `getByTestId()` which maps to `data-attr` in our config. Add `data-attr` to components if needed.
diff --git a/playwright/e2e/actions.cy.ts b/playwright/e2e/actions.cy.ts
deleted file mode 100644
index 241ae8d2d998..000000000000
--- a/playwright/e2e/actions.cy.ts
+++ /dev/null
@@ -1,63 +0,0 @@
-import { Page } from '@playwright/test'
-
-import { expect, test } from '../utils/playwright-test-base'
-
-const createAction = async (page: Page, actionName: string): Promise<void> => {
- await page.locator('[data-attr=create-action]').first().click()
- await expect(page.locator('.LemonButton')).toContainText('From event or pageview')
- await page.locator('[data-attr=new-action-pageview]').click({ force: true })
- await expect(page.locator('input[name="item-name-large"]')).toBeVisible()
-
- await page.fill('input[name="item-name-large"]', actionName)
- await page.locator('[data-attr=action-type-pageview]').click() // Click "Pageview"
- await page.locator('[data-attr=edit-action-url-input]').click()
- await page.fill('[data-attr=edit-action-url-input]', process.env.BASE_URL || '')
-
- await page.locator('[data-attr=save-action-button]').first().click()
-
- await expect(page.locator('text=Action saved')).toBeVisible()
-}
-
-test.describe('Action Events', () => {
- let actionName: string
-
- test.beforeEach(async ({ page }) => {
- await page.goToMenuItem('action')
- actionName = Math.floor(Math.random() * 1e6).toString()
- })
-
- test('Create action event', async ({ page }) => {
- await createAction(page, actionName)
-
- // Test the action is immediately available
- await page.goto('/insights/new')
-
- await page.click('text=Add graph series')
- await page.click('[data-attr=trend-element-subject-1]')
- await page.fill('[data-attr=taxonomic-filter-searchfield]', actionName)
- await page.click('[data-attr=taxonomic-tab-actions]')
- await page.click('[data-attr=prop-filter-actions-0]')
- await expect(page.locator('[data-attr=trend-element-subject-1] span')).toContainText(actionName)
- })
-
- test('Notifies when an action event with this name already exists', async ({ page }) => {
- await createAction(page, actionName)
- await page.goToMenuItem('action')
- await createAction(page, actionName)
-
- // Oh noes, there already is an action with this name
- await expect(page.locator('text=Action with this name already exists')).toBeVisible()
-
- // Let's see it
- await page.click('text=Edit it here')
-
- // We should now be seeing the action from "Create action"
- await expect(page.locator('[data-attr=edit-action-url-input]')).toHaveValue(process.env.BASE_URL || '')
- })
-
- test('Click on an action', async ({ page }) => {
- await expect(page.locator('[data-attr=actions-table]')).toBeVisible()
- await page.click('[data-attr=action-link-0]')
- await expect(page.locator('[data-attr=edit-prop-item-name-large]')).toBeVisible()
- })
-})
diff --git a/playwright/e2e/annotations.spec.ts b/playwright/e2e/annotations.spec.ts
index 69529fd5c24a..eacd914f4231 100644
--- a/playwright/e2e/annotations.spec.ts
+++ b/playwright/e2e/annotations.spec.ts
@@ -1,14 +1,23 @@
-import { expect, test } from '../utils/playwright-test-base'
+import { PlaywrightWorkspaceSetupResult, expect, test } from '../utils/workspace-test-base'
test.describe('Annotations', () => {
- test.beforeEach(async ({ page }) => {
+ let workspace: PlaywrightWorkspaceSetupResult | null = null
+
+ test.beforeAll(async ({ playwrightSetup }) => {
+ workspace = await playwrightSetup.createWorkspace({ use_current_time: true, skip_onboarding: true })
+ })
+
+ test.beforeEach(async ({ page, playwrightSetup }) => {
+ await playwrightSetup.login(page, workspace!)
await page.goToMenuItem('datamanagement')
await page.goToMenuItem('annotations')
})
- test.skip('Annotations loaded', async ({ page }) => {
- // Check that the annotations page loaded with key elements visible
- await expect(page.getByRole('heading', { name: 'Annotations' })).toBeVisible()
+ test('Annotations loaded', async ({ page }) => {
+ // Check that the annotations page loaded with key elements visible.
+ // Scope to the scene title — a bare 'Annotations' heading match also hits the
+ // empty-state "Welcome to Annotations!" h2 (substring match) and trips strict mode.
+ await expect(page.getByTestId('scene-name').getByRole('heading', { name: 'Annotations' })).toBeVisible()
await expect(page.getByRole('button', { name: 'New annotation' })).toBeVisible()
await expect(page.locator('[data-attr="annotations-content"]')).toBeVisible()
})
diff --git a/playwright/e2e/billing/billing-limits.spec.ts b/playwright/e2e/billing/billing-limits.spec.ts
index 401f2df96873..c4fa7d929335 100644
--- a/playwright/e2e/billing/billing-limits.spec.ts
+++ b/playwright/e2e/billing/billing-limits.spec.ts
@@ -46,7 +46,7 @@ async function setupBillingRoutes(page: Page, handlers: BillingRouteHandlers): P
}
test.describe('Billing Limits', () => {
- test.skip('Show no limits set and allow user to set one', async ({ page }) => {
+ test('Show no limits set and allow user to set one', async ({ page }) => {
await setupBillingRoutes(page, {
getResponse: (billingContent) => billingContent,
patchResponse: (billingContent) => {
@@ -127,13 +127,16 @@ test.describe('Billing Limits', () => {
)
})
- test.skip('Show existing limit and allow user to remove it', async ({ page }) => {
+ test('Show existing limit and allow user to remove it', async ({ page }) => {
await setupBillingRoutes(page, {
getResponse: (billingContent) => {
billingContent.custom_limits_usd = { product_analytics: 100 }
return billingContent
},
- patchResponse: (billingContent) => billingContent,
+ patchResponse: (billingContent) => {
+ billingContent.custom_limits_usd = {}
+ return billingContent
+ },
})
await page.goto('/organization/billing')
@@ -142,6 +145,7 @@ test.describe('Billing Limits', () => {
await expect(page.locator('[data-attr="billing-limit-set-product_analytics"]')).toBeVisible()
await page.locator('text=Edit limit').click()
await page.locator('[data-attr="remove-billing-limit-product_analytics"]').click()
+
await expect(page.locator('[data-attr="billing-limit-not-set-product_analytics"]')).toBeVisible()
})
})
diff --git a/playwright/e2e/early-access-management.spec.ts b/playwright/e2e/early-access-management.spec.ts
index 260077f7d1e3..4bac3757c52a 100644
--- a/playwright/e2e/early-access-management.spec.ts
+++ b/playwright/e2e/early-access-management.spec.ts
@@ -1,10 +1,17 @@
import { delay } from 'lib/utils'
import { randomString } from '../utils'
-import { expect, test } from '../utils/playwright-test-base'
+import { PlaywrightWorkspaceSetupResult, expect, test } from '../utils/workspace-test-base'
test.describe('Early Access Management', () => {
- test.beforeEach(async ({ page }) => {
+ let workspace: PlaywrightWorkspaceSetupResult | null = null
+
+ test.beforeAll(async ({ playwrightSetup }) => {
+ workspace = await playwrightSetup.createWorkspace({ use_current_time: true, skip_onboarding: true })
+ })
+
+ test.beforeEach(async ({ page, playwrightSetup }) => {
+ await playwrightSetup.login(page, workspace!)
await page.goto('/early_access_features')
})
@@ -37,8 +44,12 @@ test.describe('Early Access Management', () => {
await page.goto('/early_access_features')
await expect(page.locator('tbody')).toContainText(name)
- // edit feature
- await page.locator('a.Link', { hasText: name }).click()
+ // edit feature — use the row link by role and confirm we actually navigated to the
+ // feature detail before clicking Edit. The Edit button only renders once the feature
+ // has loaded in view mode, so a click that didn't navigate would hang for the full
+ // test timeout waiting for it.
+ await page.getByRole('link', { name }).click()
+ await expect(page).toHaveURL(/\/early_access_features\/[\w-]+$/)
await page.locator('[data-attr="edit-feature"]').click()
await expect(page.locator('[data-attr="scene-title-textarea"]')).toContainText(name)
await expect(page.locator('[data-attr="save-feature"]')).toContainText('Save')
diff --git a/playwright/e2e/events.spec.ts b/playwright/e2e/events.spec.ts
index 928677a72417..166823428ea7 100644
--- a/playwright/e2e/events.spec.ts
+++ b/playwright/e2e/events.spec.ts
@@ -57,18 +57,22 @@ test.describe('Events', () => {
await page.waitForURL('**/activity/explore')
})
- test.skip('Apply 1 overall filter', async ({ page }) => {
- await page.locator('[data-attr="new-prop-filter-EventPropertyFilters.0"]').click()
- await page.locator('[data-attr=taxonomic-filter-searchfield]').click()
+ test('Apply a single overall filter', async ({ page }) => {
+ await page.locator('[data-attr^="new-prop-filter-EventPropertyFilters."]').first().click()
+ await page.locator('[data-attr=taxonomic-filter-searchfield]').fill('$browser')
await page.locator('.taxonomic-list-row').getByText('Browser').first().click()
await page.locator('[data-attr=prop-val]').click({ force: true })
await page.waitForResponse('/api/event/values?key=%24browser')
- await page.locator('[data-attr=prop-val-0]').click()
+
+ const taxonomicValueInput = page.locator('[data-attr="taxonomic-value-select"] input')
+ await expect(taxonomicValueInput).toBeVisible()
+ await taxonomicValueInput.fill('Chrome 145')
+ await taxonomicValueInput.press('Enter')
await expect(page.locator('.DataTable')).toBeVisible()
})
- test.skip('Separates feature flag properties into their own tab', async ({ page }) => {
- await page.locator('[data-attr="new-prop-filter-EventPropertyFilters.0"]').click()
+ test('Separates feature flag properties into their own tab', async ({ page }) => {
+ await page.locator('[data-attr^="new-prop-filter-EventPropertyFilters."]').first().click()
await expect(page.locator('[data-attr="taxonomic-tab-event_feature_flags"]')).toContainText('Feature flags: 2')
await page.locator('[data-attr="taxonomic-tab-event_feature_flags"]').click()
await expect(page.locator('.taxonomic-list-row:visible')).toHaveCount(2)
diff --git a/playwright/e2e/playwright-setup-examples.spec.ts b/playwright/e2e/playwright-setup-examples.spec.ts
deleted file mode 100644
index 811b2bd6be0e..000000000000
--- a/playwright/e2e/playwright-setup-examples.spec.ts
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Examples showing how to use the PostHog playwright setup library
- *
- * This demonstrates different ways to create PostHog workspaces
- * (organizations, projects, teams) for your tests.
- */
-import { expect } from '@playwright/test'
-
-import { test, testWithWorkspace } from '../utils/workspace-test-base'
-
-test('create custom workspace', async ({ page, playwrightSetup }) => {
- // Create a workspace with custom names
- const workspace = await playwrightSetup.createWorkspace('Acme Corp')
-
- // Verify workspace was created
- expect(workspace.organization_name).toBe('Acme Corp')
- expect(workspace.personal_api_key).toBeTruthy()
-
- // Login and navigate to the team page
- await playwrightSetup.loginAndNavigateToTeam(page, workspace)
-
- // Now you're logged in and on the project page - test your feature!
-})
-
-testWithWorkspace('test with pre-created workspace', async ({ page, workspace, playwrightSetup }) => {
- // Workspace already exists with default names
-
- // Login and navigate automatically
- await playwrightSetup.loginAndNavigateToTeam(page, workspace)
-
- // Test your feature here
- await expect(page).toHaveTitle(/PostHog/)
-})
-
-test('test with API calls', async ({ page, playwrightSetup }) => {
- const workspace = await playwrightSetup.createWorkspace('API Integration Tests')
-
- await expect(workspace.personal_api_key).toMatch(/^phx_/)
- const apiKey = workspace.personal_api_key
-
- const response = await page.request.get(`/api/projects/${workspace.team_id}/`, {
- headers: {
- Authorization: `Bearer ${apiKey}`,
- },
- })
-
- expect(response.ok()).toBe(true)
-
- await playwrightSetup.loginAndNavigateToTeam(page, workspace)
-})
diff --git a/playwright/e2e/product-analytics/cohorts.spec.ts b/playwright/e2e/product-analytics/cohorts.spec.ts
index f1eb6a7eff10..401178d26254 100644
--- a/playwright/e2e/product-analytics/cohorts.spec.ts
+++ b/playwright/e2e/product-analytics/cohorts.spec.ts
@@ -1,9 +1,16 @@
import { CohortPage } from '../../page-models/cohortPage'
import { randomString } from '../../utils'
-import { expect, test } from '../../utils/playwright-test-base'
+import { PlaywrightWorkspaceSetupResult, expect, test } from '../../utils/workspace-test-base'
test.describe('Cohorts', () => {
- test.beforeEach(async ({ page }) => {
+ let workspace: PlaywrightWorkspaceSetupResult | null = null
+
+ test.beforeEach(async ({ page, playwrightSetup }) => {
+ // Dedicated empty workspace per test — no shared demo team, so the cohorts list
+ // only ever contains what this test creates (see playwright-test-base deprecation).
+ workspace = await playwrightSetup.createWorkspace({ skip_onboarding: true, no_demo_data: true })
+ await playwrightSetup.login(page, workspace)
+
await page.goToMenuItem('people')
await page.goToMenuItem('cohorts')
@@ -23,8 +30,10 @@ test.describe('Cohorts', () => {
await expect(page.locator('tbody')).toContainText(name)
})
- // works locally fails in CI
- test.skip('Duplicate a cohort', async ({ page }) => {
+ test('Duplicate a cohort', async ({ page }) => {
+ // Cohort calculation has to settle twice before the next duplicate item flips enabled.
+ test.setTimeout(120_000)
+
const name = randomString('Test-Cohort-')
await new CohortPage(page).createCohort(name)
@@ -32,20 +41,44 @@ test.describe('Cohorts', () => {
await page.goToMenuItem('people')
await page.goToMenuItem('cohorts')
- // navigate to the page
await page.click('tbody >> text=' + name)
- await expect(page.getByTestId('top-bar-name').getByText('Test-Cohort--')).toBeVisible()
- await page.click('.TopBar3000 [data-attr="more-button"]', { force: true })
- // click edit
- await page.click('.Popover__content >> text=Duplicate as dynamic cohort')
- await page.click('.Toastify__toast-body >> text=View cohort')
-
- await page.click('.TopBar3000 [data-attr="more-button"]')
- await page.click('.Popover__content >> text=Duplicate as static cohort')
- await page.click('.Toastify__toast-body >> text=View cohort')
-
- await page.click('[data-attr="more-button"]')
- await page.click('.Popover__content >> text=Delete cohort')
+ await expect(page.locator('[data-attr="scene-name"]')).toContainText(name)
+
+ // Open the panel once, then just wait for each item to flip enabled
+ await page.locator('[data-attr=open-context-panel-button]').first().click()
+
+ const dynamicItem = page.getByRole('button', { name: 'Duplicate as dynamic cohort' })
+ await expect(dynamicItem).toBeEnabled({ timeout: 30_000 })
+ await dynamicItem.click()
+ await page.locator('.Toastify__toast-body').getByRole('button', { name: 'View cohort' }).click()
+
+ // The panel's open state persists across the client-side nav. The open
+ // button is unmounted while the panel is open, so only click it if the
+ // panel actually closed.
+ const reopenPanelButton = page.locator('[data-attr=open-context-panel-button]').first()
+ if (await reopenPanelButton.isVisible().catch(() => false)) {
+ await reopenPanelButton.click()
+ }
+
+ const staticItem = page.getByRole('button', { name: 'Duplicate as static cohort' })
+ await expect(staticItem).toBeEnabled({ timeout: 30_000 })
+ await staticItem.click()
+ await page.locator('.Toastify__toast-body').getByRole('button', { name: 'View cohort' }).click()
+
+ // Wait until we've actually landed on the static-copy page before deleting —
+ // otherwise cohort-delete fires on the still-mounted dynamic-copy page and the
+ // static copy survives the deletion.
+ await expect(page.locator('[data-attr="scene-name"]')).toContainText(name + ' (dynamic copy) (static copy)')
+
+ await page.locator('[data-attr="cohort-delete"]').click()
+ const deleteDialog = page.locator('.LemonModal__layout').filter({ hasText: 'Delete cohort?' })
+ await expect(deleteDialog).toBeVisible()
+ await deleteDialog.getByRole('button', { name: 'Delete' }).click()
+
+ // The delete redirects back to the cohorts list (e.g. /cohorts?page=1#panel=max)
+ // once the request resolves, so waiting for it guarantees the deletion committed
+ // before we reload and assert. Match the list URL but not the /cohorts/<id> detail.
+ await expect(page).toHaveURL(/\/cohorts(\?|#|$)/)
await page.goToMenuItem('people')
await page.goToMenuItem('cohorts')
diff --git a/playwright/e2e/product-analytics/dashboards.spec.ts b/playwright/e2e/product-analytics/dashboards.spec.ts
index 03193df69bf5..bc6d15c60179 100644
--- a/playwright/e2e/product-analytics/dashboards.spec.ts
+++ b/playwright/e2e/product-analytics/dashboards.spec.ts
@@ -115,7 +115,7 @@ test.describe('Dashboards', () => {
})
})
- test.skip('Can duplicate, rename, and remove dashboard tiles', async ({ page }) => {
+ test('Can duplicate, rename, and remove dashboard tiles', async ({ page }) => {
const dashboard = new DashboardPage(page)
const newTileName = randomString('tile-name')
@@ -179,8 +179,12 @@ test.describe('Dashboards', () => {
await test.step('write query, run, and save as insight', async () => {
const editor = page.locator('.monaco-editor').first()
await editor.click()
- await page.keyboard.press('Meta+a')
- await page.keyboard.type('SELECT {variables.test_number}', { delay: 10 })
+ await page.keyboard.press('ControlOrMeta+a')
+ // insertText() inserts the whole string at once, so Monaco's bracket
+ // auto-close and autocomplete don't intercept the `{`/`}` mid-type and
+ // produce a malformed query that leaves "Save as insight" disabled.
+ await page.keyboard.insertText('SELECT {variables.test_number}')
+ await page.keyboard.press('Escape')
await page.getByRole('button', { name: 'Run' }).click()
await expect(page.locator('[data-attr=sql-editor-output-pane-empty-state]')).not.toBeVisible()
@@ -233,11 +237,20 @@ test.describe('Dashboards', () => {
await test.step('verify navigation to dashboards list (not "Not found")', async () => {
await expect(page).toHaveURL(/\/dashboard(#panel=[a-z]+)?$/)
await expect(page.getByText('Not found')).not.toBeVisible()
- await expect(page.getByText(dashboardName)).not.toBeVisible()
+ // Reload so the list is rebuilt from the server, which excludes deleted
+ // dashboards. The in-memory dashboardsModel can keep a stale row visible
+ // (the list selector doesn't filter `deleted`, and an in-flight load can
+ // re-merge it after delayedDeleteDashboard prunes it), so an unscoped or
+ // even table-scoped assertion against live state is racy. Scope to the
+ // table to exclude the "deleted" toast, which also contains the name.
+ await page.reload()
+ await expect(page.getByTestId('dashboards-table')).toBeVisible()
+ await expect(page.getByTestId('dashboards-table').getByText(dashboardName)).not.toBeVisible()
})
})
test('Deleting an insight from dashboard redirects back', async ({ page }) => {
+ test.setTimeout(120_000)
const dashboard = new DashboardPage(page)
const insight = new InsightPage(page)
const insightName = randomString('dash-trends')
diff --git a/playwright/e2e/product-analytics/insight-modals.spec.ts b/playwright/e2e/product-analytics/insight-modals.spec.ts
deleted file mode 100644
index cd8379756280..000000000000
--- a/playwright/e2e/product-analytics/insight-modals.spec.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { InsightType } from '~/types'
-
-import { InsightPage } from '../../page-models/insightPage'
-import { randomString } from '../../utils'
-import { expect, test } from '../../utils/playwright-test-base'
-
-test.describe('insight modals', () => {
- // does not consistently load events 😡
- test.skip('shows no matches message in persons modal', async ({ page }) => {
- const insightPage = new InsightPage(page)
- await insightPage.createNew(randomString('insight-'), InsightType.TRENDS)
- await insightPage.openPersonsModal()
- await expect(page.locator('[data-attr="persons-modal-no-matches"]')).toBeVisible()
- })
-})
diff --git a/playwright/e2e/product-analytics/insight-navigation.spec.ts b/playwright/e2e/product-analytics/insight-navigation.spec.ts
index 855d4d316f91..592ec8a9a116 100644
--- a/playwright/e2e/product-analytics/insight-navigation.spec.ts
+++ b/playwright/e2e/product-analytics/insight-navigation.spec.ts
@@ -2,64 +2,49 @@ import { InsightType } from '~/types'
import { InsightPage } from '../../page-models/insightPage'
import { Navigation } from '../../utils/navigation'
-import { expect, test } from '../../utils/playwright-test-base'
+import { PlaywrightWorkspaceSetupResult, expect, test } from '../../utils/workspace-test-base'
-const typeTestCases: { type: InsightType; selector: string }[] = [
- { type: InsightType.TRENDS, selector: '.TrendsInsight canvas' },
- { type: InsightType.FUNNELS, selector: '.funnels-empty-state__title' },
- { type: InsightType.RETENTION, selector: '.RetentionContainer canvas' },
- { type: InsightType.PATHS, selector: '.Paths' },
- { type: InsightType.STICKINESS, selector: '.TrendsInsight canvas' },
- { type: InsightType.LIFECYCLE, selector: '.TrendsInsight canvas' },
- { type: InsightType.SQL, selector: '[data-attr="hogql-query-editor"]' },
+let workspace: PlaywrightWorkspaceSetupResult | null = null
+
+test.beforeAll(async ({ playwrightSetup }) => {
+ workspace = await playwrightSetup.createWorkspace({ use_current_time: true, skip_onboarding: true })
+})
+
+test.beforeEach(async ({ page, playwrightSetup }) => {
+ await playwrightSetup.login(page, workspace!)
+})
+
+// `InsightType` values are uppercase enum keys (TRENDS, FUNNELS, …) but the
+// InsightsNav tab labels are sentence-cased ("Trends", "User Paths", …). The
+// `expectedTabText` lets each case opt out of the case-insensitive enum match
+// (e.g. PATHS → "User Paths") without bringing back per-type chart selectors —
+// the old `.TrendsInsight` / `.funnels-empty-state__title` ones are dead.
+const typeTestCases: { type: InsightType; expectedTabText: string }[] = [
+ { type: InsightType.TRENDS, expectedTabText: 'Trends' },
+ { type: InsightType.FUNNELS, expectedTabText: 'Funnels' },
+ { type: InsightType.RETENTION, expectedTabText: 'Retention' },
+ { type: InsightType.PATHS, expectedTabText: 'User Paths' },
+ { type: InsightType.STICKINESS, expectedTabText: 'Stickiness' },
+ { type: InsightType.LIFECYCLE, expectedTabText: 'Lifecycle' },
]
-typeTestCases.forEach(({ type, selector }) => {
- // skipping things because we want to get a single passing test in
- test.skip(`can navigate to ${type} insight from saved insights page`, async ({ page }) => {
+typeTestCases.forEach(({ type, expectedTabText }) => {
+ test(`can navigate to ${type} insight from saved insights page`, async ({ page }) => {
await new InsightPage(page).goToNew(type)
- // have to use contains to make paths match user paths
- await expect(page.locator('.LemonTabs__tab--active')).toContainText(type, { ignoreCase: true })
+ await expect(page.locator('.LemonTabs__tab--active')).toContainText(expectedTabText)
- // we don't need to wait for the insight to load, just that it or its loading state is visible
- const insightStillLoading = await page.locator('.insight-empty-state.warning').isVisible()
- const insightDidLoad = await page.locator(selector).isVisible()
- expect(insightStillLoading || insightDidLoad).toBe(true)
+ // Once data resolves the viz swaps in either the empty state
+ // (`insight-empty-state`, tagged on every variant in EmptyStates.tsx), a
+ // `<canvas>` (Trends/Funnels/Retention/Stickiness/Lifecycle), or the Paths
+ // SVG container (`paths-viz`, which never renders a `<canvas>`). Treating any
+ // as success keeps the smoke test stable across query backends and chart types.
+ const emptyState = page.locator('[data-attr="insight-empty-state"]')
+ const chartCanvas = page.locator('main canvas')
+ const pathsViz = page.locator('[data-attr="paths-viz"]')
+ await expect(emptyState.or(chartCanvas).or(pathsViz).first()).toBeVisible()
})
})
-// skipping things because we want to get a single passing test in
-// commented out because the query spec is incorrect
-// test.skip('can navigate to insight by query', async ({ page }) => {
-// const insight = new InsightPage(page)
-// const url = urls.insightNew({query: {
-// kind: NodeKind.InsightVizNode,
-// source: {
-// kind: 'TrendsQuery',
-// series: [
-// {
-// kind: 'EventsNode',
-// event: '$autocapture',
-// name: 'Autocapture',
-// math: 'total',
-// },
-// ],
-// interval: 'day',
-// trendsFilter: {
-// display: 'ActionsLineGraph',
-// },
-// },
-// full: true,
-// }})
-//
-// await page.goto(url)
-//
-// // test series labels
-// await insight.waitForDetailsTable()
-// const labels = await insight.detailsLabels.allInnerTexts()
-// expect(labels).toEqual(['Autocapture'])
-// })
-
test('can open event explorer as an insight', async ({ page }) => {
const navigation = new Navigation(page)
await navigation.openHome()
diff --git a/playwright/e2e/product-analytics/insight-variables.spec.ts b/playwright/e2e/product-analytics/insight-variables.spec.ts
deleted file mode 100644
index c1c3e7d07eeb..000000000000
--- a/playwright/e2e/product-analytics/insight-variables.spec.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { DashboardPage } from '../../page-models/dashboardPage'
-import { expect, test } from '../../utils/playwright-test-base'
-
-test.describe('insight variables', () => {
- test.skip('show correctly on dashboards', async ({ page }) => {
- const dashboard = new DashboardPage(page)
-
- // Go to "Insight variables" dashboard.
- await page.goToMenuItem('dashboards')
- await page.getByText('Insight variables').click()
-
- // Add a temporary override
- await page.goto(page.url() + '?query_variables=%7B"variable_4"%3A40%7D%20')
- await expect(page.locator('.InsightCard').first()).toBeVisible()
-
- const cardForDefaultVariable = await dashboard.findCardByTitle('Variable default')
- await expect(cardForDefaultVariable.locator('.BoldNumber')).toHaveText('10')
-
- const cardForDashboardOverride = await dashboard.findCardByTitle('Dashboard override')
- await expect(cardForDashboardOverride.locator('.BoldNumber')).toHaveText('20')
-
- const cardForInsightOverride = await dashboard.findCardByTitle('Insight override')
- await expect(cardForInsightOverride.locator('.BoldNumber')).toHaveText('30')
-
- const cardForURLOverride = await dashboard.findCardByTitle('Temporary override')
- await expect(cardForURLOverride.locator('.BoldNumber')).toHaveText('40')
- })
-})
diff --git a/playwright/e2e/project-home-page.spec.ts b/playwright/e2e/project-home-page.spec.ts
index e2d58ea1b3cf..5243f1ebd112 100644
--- a/playwright/e2e/project-home-page.spec.ts
+++ b/playwright/e2e/project-home-page.spec.ts
@@ -1,6 +1,16 @@
-import { expect, test } from '../utils/playwright-test-base'
+import { PlaywrightWorkspaceSetupResult, expect, test } from '../utils/workspace-test-base'
test.describe('Project Homepage', () => {
+ let workspace: PlaywrightWorkspaceSetupResult | null = null
+
+ test.beforeAll(async ({ playwrightSetup }) => {
+ workspace = await playwrightSetup.createWorkspace({ use_current_time: true, skip_onboarding: true })
+ })
+
+ test.beforeEach(async ({ page, playwrightSetup }) => {
+ await playwrightSetup.login(page, workspace!)
+ })
+
test('Shows AI-first homepage on load', async ({ page }) => {
await page.goToMenuItem('projecthomepage')
await expect(page.locator('[data-attr=homepage-input]')).toBeVisible()
diff --git a/playwright/e2e/signup.spec.ts b/playwright/e2e/signup.spec.ts
index db9e5be65952..b7f48a6d9e4f 100644
--- a/playwright/e2e/signup.spec.ts
+++ b/playwright/e2e/signup.spec.ts
@@ -51,9 +51,8 @@ test.describe('Signup', () => {
}
await route.fulfill({ json: response })
})
- await page.locator('[data-attr=new-account-menu-button]').click()
- await page.locator('[data-attr=new-account-menu-logout-button]').click()
- await expect(page).toHaveURL(/.*\/login/)
+ // Log out via cookies, not the account-menu UI, which flakes on slow/torn-down workers.
+ await page.context().clearCookies()
await page.goto('/signup')
})
@@ -87,7 +86,7 @@ test.describe('Signup', () => {
await expect(page.getByText('Must be at least 8 characters long')).not.toBeVisible()
})
- test.skip('Can create user account with first name, last name and organization name', async ({ page }) => {
+ test('Can create user account with first name, last name and organization name', async ({ page }) => {
let signupRequestBody: string | null = null
await page.route('/api/signup/', async (route) => {
@@ -214,9 +213,7 @@ test.describe('Signup', () => {
)
})
- // TODO un-skip.
- // Skipping test as it was failing on master, see https://posthog.slack.com/archives/C0113360FFV/p1749742204672659
- test.skip('Shows redirect notice if redirecting for maintenance', async ({ page }) => {
+ test('Shows redirect notice if redirecting for maintenance', async ({ page }) => {
// Equivalent to setupFeatureFlags in Playwright
await page.route('**/flags/*', async (route) => {
const response = {
diff --git a/playwright/e2e/surveys/crud.spec.ts b/playwright/e2e/surveys/crud.spec.ts
index 3ed3008271ac..f81b14550616 100644
--- a/playwright/e2e/surveys/crud.spec.ts
+++ b/playwright/e2e/surveys/crud.spec.ts
@@ -4,13 +4,24 @@ import { randomString } from '../../utils'
import { expect, test } from '../../utils/playwright-test-base'
async function deleteSurvey(page: Page, name: string): Promise<void> {
+ // Only archived surveys (or drafts) expose the "Delete permanently" action.
await page.locator('[data-attr=open-context-panel-button]').first().click()
+ await page.locator('[data-attr=survey-archive]').click()
+
+ const archiveDialog = page.locator('.LemonModal__layout').filter({ hasText: 'Archive this survey?' })
+ await expect(archiveDialog).toBeVisible()
+ // The confirm button reads "Archive" when stopped but "Stop and archive" if the
+ // dialog still sees the survey as running (end_date not yet propagated), so match both.
+ await archiveDialog.getByRole('button', { name: /^(Archive|Stop and archive)$/ }).click()
+ await expect(archiveDialog).not.toBeVisible()
+
+ // Context menu is open again after archiving, so we can click "Delete permanently" right away
await page.locator('[data-attr=survey-delete]').click()
- await expect(page.locator('.LemonModal__layout')).toBeVisible()
- await expect(page.getByText('Delete this survey?')).toBeVisible()
- await page.getByRole('button', { name: 'Delete' }).click()
- await expect(page.getByText('Active')).toBeVisible()
+ const deleteDialog = page.locator('.LemonModal__layout').filter({ hasText: 'Permanently delete this survey?' })
+ await expect(deleteDialog).toBeVisible()
+ await deleteDialog.getByRole('button', { name: 'Delete permanently' }).click()
+
await expect(page.locator(`[data-row-key="${name}"]`)).not.toBeVisible()
}
@@ -29,7 +40,9 @@ async function launchSurveyEvenIfDisabled(page: Page): Promise<void> {
await page.getByRole('button', { name: 'Done' }).click()
}
- await page.locator('[data-attr="launch-survey"]').click()
+ // The launch control is now a split button, so two elements carry data-attr="launch-survey"
+ // ("Launch" and "Launch survey"). Target the primary "Launch" button explicitly.
+ await page.getByRole('button', { name: 'Launch', exact: true }).click()
await expect(page.locator('.LemonModal__layout')).toBeVisible()
await expect(page.getByText('Launch this survey?')).toBeVisible()
const launchResponsePromise = page.waitForResponse(
@@ -50,20 +63,20 @@ test.describe('CRUD Survey', () => {
await page.goToMenuItem('surveys')
})
- // NOTE: Currently skipping this because we changed to the new layout
- // and this doesn't support the new layout yet.
- test.skip('creates, launches, edits and deletes new survey', async ({ page }) => {
+ test('creates, launches, edits and deletes new survey', async ({ page }) => {
await expect(page.locator('h1')).toContainText('Surveys')
await expect(page).toHaveTitle('Surveys • PostHog')
- await page.locator('[data-attr="new-survey"]').click()
- await page.locator('[data-attr="new-blank-survey"]').click()
+ await page.addInitScript(() => {
+ localStorage.setItem('scenes.surveys.surveysLogic.preferredEditor', JSON.stringify('full'))
+ })
+ await page.goto('/surveys/new')
await page.locator('[data-attr="scene-title-textarea"]').fill(name)
await page.locator('[data-attr="survey-question-type-0"]').click()
- await page.getByText('Rating').click()
+ await page.locator('[data-attr="survey-question-type-0-rating"]').click()
- await expect(page.locator('[id="scenes.surveys.surveyLogic.new.survey.questions.0.question"]')).toHaveValue(
+ await expect(page.locator('[data-attr="survey-question-label-0"]')).toHaveValue(
/How likely are you to recommend/
)
@@ -72,7 +85,9 @@ test.describe('CRUD Survey', () => {
)
await expect(
- page.locator('[id="scenes.surveys.surveyLogic.new.survey.questions.0.upperBoundLabel"]')
+ page
+ .locator('.Field', { has: page.locator('.LemonLabel', { hasText: 'Upper bound label' }) })
+ .locator('input')
).toHaveValue('Very likely')
await page.locator('[id="scenes.surveys.surveyLogic.new.survey.questions.0.scale"]').click()
@@ -90,27 +105,22 @@ test.describe('CRUD Survey', () => {
await expect(surveyForm.locator('.ratings-number')).toHaveCount(5)
await page.locator('.LemonCollapsePanel', { hasText: 'Display conditions' }).click()
- await page.getByText('All users').click()
- await expect(page.locator('.Popover__content')).toBeVisible()
- await page.locator('.Popover__content').getByText('Users who match').click()
+ await page.locator('[data-attr="survey-display-conditions-select-users"]').click()
await page.locator('body').evaluate((el) => el.scrollTo(0, el.scrollHeight))
await page.getByRole('button', { name: 'Add property targeting' }).click()
await page.getByRole('button', { name: 'Add condition', exact: true }).click()
- await page.getByRole('rowgroup').getByText('is_demo').click()
+ await page.locator('[data-attr=taxonomic-filter-searchfield]').fill('is_demo')
+ await page.locator('.taxonomic-list-row').getByText('is_demo').first().click()
await page.locator('span').filter({ hasText: 'Enter value...' }).click()
await page.getByPlaceholder('Enter value...').fill('t')
await page.getByPlaceholder('Enter value...').press('Enter')
- // This is causing a test to flake. The screenshot shows the element in question, but we can't find it here.
- // Try submitting the form regardless. If the "t" element is not present, it'll fail anyway.
-
- // await expect(page.getByTitle('t')).toBeVisible()
-
- await page.locator('div').filter({ hasText: /^%$/ }).getByRole('spinbutton').click()
- await page.locator('div').filter({ hasText: /^%$/ }).getByRole('spinbutton').fill('50')
+ const rolloutInput = page.locator('[data-attr="rollout-percentage"]')
+ await rolloutInput.click()
+ await rolloutInput.fill('50')
const saveButton = page.locator('[data-attr="save-survey"]').nth(0)
await expect(saveButton).toBeEnabled()
diff --git a/playwright/e2e/surveys/quickcreate.spec.ts b/playwright/e2e/surveys/quickcreate.spec.ts
index dd1f9752a3d4..704d85413599 100644
--- a/playwright/e2e/surveys/quickcreate.spec.ts
+++ b/playwright/e2e/surveys/quickcreate.spec.ts
@@ -3,7 +3,7 @@ import { Page } from '@playwright/test'
import { urls } from 'scenes/urls'
import { randomString } from '../../utils'
-import { expect, test } from '../../utils/playwright-test-base'
+import { PlaywrightWorkspaceSetupResult, expect, test } from '../../utils/workspace-test-base'
const saveFeatureFlag = async (page: Page): Promise<void> => {
const saveButton = page.locator('[data-attr="save-feature-flag"]').first()
@@ -13,7 +13,10 @@ const saveFeatureFlag = async (page: Page): Promise<void> => {
)
await saveButton.click()
await responsePromise
- await page.goto(urls.featureFlags())
+ // Saving redirects to the flag's own detail page (featureFlagLogic.saveFeatureFlagSuccess).
+ // Waiting for that confirms the flag was created and committed before clickCreateSurvey
+ // navigates to the list to find it.
+ await page.waitForURL(/\/feature_flags\/\d+/)
}
const expectFlagEnabled = async (page: Page, name: string): Promise<void> => {
@@ -50,8 +53,17 @@ const addTwoVariants = async (page: Page): Promise<void> => {
}
const clickCreateSurvey = async (page: Page, name: string): Promise<void> => {
+ // Create the survey from the feature-flag list row's "more" menu. The flag detail page's
+ // create-survey action lives in the global scene side panel, whose open/closed state and
+ // active tab persist across navigation and whose toggle button unmounts while it's open —
+ // too stateful to drive reliably. The list menu opens the same QuickSurveyModal with no
+ // side panel involved. The workspace is isolated (only this flag exists), so reload the
+ // list until the row shows up, then act on it.
const row = page.locator(`[data-row-key="${name}"]`)
- await expect(row).toBeVisible()
+ await expect(async () => {
+ await page.goto(urls.featureFlags())
+ await expect(row).toBeVisible({ timeout: 10_000 })
+ }).toPass({ timeout: 40_000 })
await row.locator('[data-attr="more-button"]').click()
await page.locator('[data-attr="create-survey"]').click()
}
@@ -73,13 +85,27 @@ const launchSurvey = async (page: Page, name: string): Promise<void> => {
await expect(page.locator('[data-attr="stop-survey"]')).toBeVisible()
}
-// CI is too slow, these all fail when run in parallel, will try to find a better solution soon
+// Run serially to keep per-test workspace setup off the critical path and avoid hammering
+// the setup endpoint with concurrent organization_with_team calls.
test.describe.configure({ mode: 'serial' })
test.describe('Quick create survey from feature flag', () => {
let name: string
+ let workspace: PlaywrightWorkspaceSetupResult | null = null
+
+ test.beforeEach(async ({ page, playwrightSetup }) => {
+ // Dedicated empty workspace per test — no shared demo team, so the feature-flag
+ // list only contains the flag this test creates (see playwright-test-base deprecation).
+ // Seed a *recent* $autocapture event: the survey event picker (Events taxonomic list)
+ // sends exclude_stale=true, which drops definitions whose last_seen_at is >30 days old —
+ // so a fixed past timestamp never surfaced "Autocapture". `now` keeps it non-stale.
+ workspace = await playwrightSetup.createWorkspace({
+ skip_onboarding: true,
+ no_demo_data: true,
+ events: [{ event: '$autocapture', distinct_id: 'survey-seed-user', timestamp: new Date().toISOString() }],
+ })
+ await playwrightSetup.login(page, workspace)
- test.beforeEach(async ({ page }) => {
name = randomString('ff')
await page.goto(urls.featureFlags())
await expect(page.locator('h1')).toContainText('Feature flags')
@@ -113,14 +139,8 @@ test.describe('Quick create survey from feature flag', () => {
await saveFeatureFlag(page)
await clickCreateSurvey(page, name)
- const createButton = page.getByTestId('quick-survey-create')
- await expect(createButton).toBeEnabled()
- const responsePromise = page.waitForResponse(
- (resp) => resp.url().includes('/surveys') && resp.request().method() === 'POST'
- )
- await createButton.click()
- await responsePromise
- await page.waitForURL(/project\/(\d+)\/surveys\/([\w-]+)/)
+
+ await launchSurvey(page, name)
await goToSurveyOverview(page)
await expectFlagEnabled(page, name)
@@ -149,7 +169,8 @@ test.describe('Quick create survey from feature flag', () => {
await saveFeatureFlag(page)
await clickCreateSurvey(page, name)
- // add event
+ // add event — the beforeEach seeds a recent $autocapture event, so its definition shows
+ // as "Autocapture" in the picker's Events list (no search needed).
await page.locator('.LemonButton').getByText('Add event').click()
const autocaptureOption = page.locator('span[aria-label="Autocapture"]').getByText('Autocapture')
await expect(autocaptureOption).toBeVisible()
@@ -162,7 +183,7 @@ test.describe('Quick create survey from feature flag', () => {
await expectEvents(page, ['$autocapture'])
})
- test.skip('survey responses visible in feature flag feedback tab', async ({ page }) => {
+ test('survey responses visible in feature flag feedback tab', async ({ page }) => {
await saveFeatureFlag(page)
await clickCreateSurvey(page, name)
await launchSurvey(page, name)
@@ -171,14 +192,15 @@ test.describe('Quick create survey from feature flag', () => {
const ffLink = page.getByText(`Feature flag enabled for: ${name}`).locator('a[href]')
await expect(ffLink).toBeVisible()
const ffUrl = await ffLink.getAttribute('href')
- await page.waitForLoadState('networkidle')
+ // Don't wait for networkidle — PostHog polls continuously, so it rarely settles. goto
+ // already waits for the navigation to load.
await page.goto(ffUrl!)
await page.locator('.LemonTabs__tab').getByText('User feedback').click()
await expect(page.getByText('Filter survey results')).toBeVisible()
})
- test.skip('list of surveys in ff feedback tab when multiple surveys exist', async ({ page }) => {
+ test('list of surveys in ff feedback tab when multiple surveys exist', async ({ page }) => {
await addTwoVariants(page)
await saveFeatureFlag(page)
@@ -186,8 +208,7 @@ test.describe('Quick create survey from feature flag', () => {
await page.getByText(`Only users in the test-1 variant`).locator('..').locator('input').click()
await launchSurvey(page, name)
- await page.goto(urls.featureFlags())
- await expect(page.locator('h1')).toContainText('Feature flags')
+ // Second survey (test-2 variant) — clickCreateSurvey navigates back to the flag list itself.
await clickCreateSurvey(page, name)
await page.getByText(`Only users in the test-2 variant`).locator('..').locator('input').click()
await launchSurvey(page, name)
@@ -197,7 +218,8 @@ test.describe('Quick create survey from feature flag', () => {
const ffLink = page.getByText(`Feature flag enabled for: ${name}`).locator('a[href]')
await expect(ffLink).toBeVisible()
const ffUrl = await ffLink.getAttribute('href')
- await page.waitForLoadState('networkidle')
+ // Don't wait for networkidle — PostHog polls continuously, so it rarely settles. goto
+ // already waits for the navigation to load.
await page.goto(ffUrl!)
await page.locator('.LemonTabs__tab').getByText('User feedback').click()
diff --git a/playwright/e2e/toolbar.spec.ts b/playwright/e2e/toolbar.spec.ts
index 5c9343ae8a70..2c7b4c2460bf 100644
--- a/playwright/e2e/toolbar.spec.ts
+++ b/playwright/e2e/toolbar.spec.ts
@@ -1,7 +1,17 @@
-import { expect, test } from '../utils/playwright-test-base'
+import { PlaywrightWorkspaceSetupResult, expect, test } from '../utils/workspace-test-base'
test.describe('Toolbar', () => {
- test.skip('Toolbar loads', async ({ page }) => {
+ let workspace: PlaywrightWorkspaceSetupResult | null = null
+
+ test.beforeAll(async ({ playwrightSetup }) => {
+ workspace = await playwrightSetup.createWorkspace({ use_current_time: true, skip_onboarding: true })
+ })
+
+ test.beforeEach(async ({ page, playwrightSetup }) => {
+ await playwrightSetup.login(page, workspace!)
+ })
+
+ test('Toolbar loads', async ({ page }) => {
await page.goToMenuItem('toolbar')
await page.getByText('Add authorized URL').click()
diff --git a/playwright/e2e/workflows.spec.ts b/playwright/e2e/workflows.spec.ts
deleted file mode 100644
index 7c953d402b26..000000000000
--- a/playwright/e2e/workflows.spec.ts
+++ /dev/null
@@ -1,228 +0,0 @@
-/**
- * Screenshot tests for workflows product
- */
-import { expect } from '@playwright/test'
-
-import { PlaywrightWorkspaceSetupResult, test } from '../utils/workspace-test-base'
-
-test.describe('Workflows', () => {
- let workspace: PlaywrightWorkspaceSetupResult | null = null
-
- test.beforeAll(async ({ playwrightSetup }) => {
- // Create a workspace with custom names (once for all tests)
- workspace = await playwrightSetup.createWorkspace('Workflow Users Inc.')
-
- // Verify workspace was created
- expect(workspace.organization_name).toBe('Workflow Users Inc.')
- expect(workspace.personal_api_key).toBeTruthy()
- })
-
- test.beforeEach(async ({ page, playwrightSetup }) => {
- if (!workspace) {
- throw new Error('Workspace was not initialized before tests')
- }
- // Login and navigate to the team page
- await playwrightSetup.loginAndNavigateToTeam(page, workspace)
-
- // Navigate to workflows page
- await page.goto('/workflows')
- })
-
- // ──────────────────────────────────────────
- // Top-level scene tabs
- // ──────────────────────────────────────────
-
- test.describe('workflows tab', () => {
- test.beforeEach(async ({ page }) => {
- await page.waitForSelector('[data-attr="new-workflow"]', { timeout: 10000 })
- await page.waitForSelector('[data-attr="workflows-table"][data-loading="false"]', { timeout: 10000 })
- })
-
- test.skip('shows workflows list page with table and controls', async ({ page }) => {
- await expect(page.getByText('Loading', { exact: true })).not.toBeVisible({ timeout: 5000 })
-
- await expect(page).toHaveScreenshot('workflows-list.png', { fullPage: true })
- })
-
- test.skip('new workflow button opens modal with template chooser', async ({ page }) => {
- await page.click('[data-attr="new-workflow"]')
- await page.waitForSelector('[data-attr="new-workflow-chooser"]', { timeout: 3000 })
-
- await expect(page.locator('[data-attr="new-workflow-chooser"]')).toBeVisible()
- await expect(page.locator('[data-attr="create-workflow-blank"]')).toBeVisible()
-
- await expect(page).toHaveScreenshot('new-workflow-modal.png', { fullPage: true })
- })
-
- test.skip('create blank workflow and see editor', async ({ page }) => {
- await page.click('[data-attr="new-workflow"]')
- await page.waitForSelector('[data-attr="new-workflow-chooser"]', { timeout: 3000 })
- await page.click('[data-attr="create-workflow-blank"]', { force: true })
-
- await page.waitForSelector('[data-attr="workflow-editor"]', { timeout: 10000 })
- await expect(page.getByText('Loading', { exact: true })).not.toBeVisible({ timeout: 5000 })
-
- await expect(page).toHaveScreenshot('new-workflow.png', { fullPage: true })
- })
- })
-
- test.describe('library tab', () => {
- test.skip('shows message templates table', async ({ page }) => {
- await page.goto('/workflows/library')
- await page.waitForSelector('[data-attr="message-templates-table"]', { timeout: 10000 })
- await expect(page.getByText('Loading', { exact: true })).not.toBeVisible({ timeout: 5000 })
-
- // The new template button should be visible
- await expect(page.locator('[data-attr="new-message-button"]')).toBeVisible()
-
- await expect(page).toHaveScreenshot('library-tab.png', { fullPage: true })
- })
- })
-
- test.describe('channels tab', () => {
- test.skip('shows message channels section', async ({ page }) => {
- await page.goto('/workflows/channels')
- await page.waitForSelector('[data-attr="message-channels"]', { timeout: 10000 })
- await expect(page.getByText('Loading', { exact: true })).not.toBeVisible({ timeout: 5000 })
-
- // Wait for loading skeletons to disappear
- await expect(page.locator('[data-attr="message-channels"] .LemonSkeleton').first()).not.toBeVisible()
-
- await expect(page).toHaveScreenshot('channels-tab.png', { fullPage: true })
- })
- })
-
- test.describe('opt-outs tab', () => {
- test.skip('shows opt-out scene with categories and opt-out list', async ({ page }) => {
- await page.goto('/workflows/opt-outs')
- await page.waitForSelector('[data-attr="opt-out-scene"]', { timeout: 10000 })
- await expect(page.getByText('Loading', { exact: true })).not.toBeVisible({ timeout: 5000 })
-
- // The new category button should be visible
- await expect(page.locator('[data-attr="new-optout-category"]')).toBeVisible()
- // Section headings should be present
- await expect(page.getByRole('heading', { name: 'Message categories' })).toBeVisible()
- await expect(page.getByText('Marketing opt-out list')).toBeVisible()
-
- // Wait for skeleton loaders to finish
- await expect(page.locator('[data-attr="opt-out-scene"] .LemonSkeleton')).not.toBeAttached({
- timeout: 10000,
- })
-
- await expect(page).toHaveScreenshot('opt-outs-tab.png', { fullPage: true })
- })
- })
-
- test.describe('tab navigation', () => {
- test.skip('can navigate between all top-level tabs', async ({ page }) => {
- await page.waitForSelector('[data-attr="workflows-scene"]', { timeout: 10000 })
- await page.waitForSelector('[data-attr="workflows-table"][data-loading="false"]', { timeout: 10000 })
-
- // Navigate to Library tab
- await page.click('[data-attr="workflows-scene-tabs"] >> text=Library')
- await page.waitForSelector('[data-attr="message-templates-table"]', { timeout: 10000 })
- await expect(page).toHaveURL(/\/workflows\/library/)
-
- // Navigate to Channels tab
- await page.click('[data-attr="workflows-scene-tabs"] >> text=Channels')
- await page.waitForSelector('[data-attr="message-channels"]', { timeout: 10000 })
- await expect(page).toHaveURL(/\/workflows\/channels/)
-
- // Navigate to Opt-outs tab
- await page.click('[data-attr="workflows-scene-tabs"] >> text=Opt-outs')
- await page.waitForSelector('[data-attr="opt-out-scene"]', { timeout: 10000 })
- await expect(page).toHaveURL(/\/workflows\/opt-outs/)
-
- // Navigate back to Workflows tab
- await page.click('[data-attr="workflows-scene-tabs"] >> text=Workflows')
- await page.waitForSelector('[data-attr="workflows-table"][data-loading="false"]', { timeout: 10000 })
- await expect(page).toHaveURL(/\/workflows\/workflows|\/workflows$/)
- })
- })
-
- // ──────────────────────────────────────────
- // Single workflow view tabs
- // ──────────────────────────────────────────
-
- test.describe('single workflow view', () => {
- test.beforeEach(async ({ page }) => {
- // Create a blank workflow to test with
- await page.waitForSelector('[data-attr="new-workflow"]', { timeout: 10000 })
- await page.waitForSelector('[data-attr="workflows-table"][data-loading="false"]', { timeout: 10000 })
-
- await page.click('[data-attr="new-workflow"]')
- await page.waitForSelector('[data-attr="new-workflow-chooser"]', { timeout: 3000 })
- await page.click('[data-attr="create-workflow-blank"]', { force: true })
-
- await page.waitForSelector('[data-attr="workflow-editor"]', { timeout: 10000 })
- await expect(page.getByText('Loading', { exact: true })).not.toBeVisible({ timeout: 5000 })
-
- // Configure the event trigger - click the trigger node to select it, then add an event
- await page.locator('[data-attr="workflow-editor"]').getByText('Trigger').click()
- await page.waitForSelector('[data-attr="workflow-trigger"]', { timeout: 5000 })
- await page.getByTestId('add-action-event-button').click()
-
- // Save the workflow so we get a real ID and tabs appear
- await page.click('[data-attr="workflow-save"]')
- // Wait for save to complete and URL to update to a real workflow ID
- await page.waitForURL(/\/workflows\/[a-zA-Z0-9-]+\/workflow/, { timeout: 10000 })
- })
-
- test.skip('workflow tab shows the editor canvas', async ({ page }) => {
- await expect(page.locator('[data-attr="workflow-editor"]')).toBeVisible()
- await expect(page.locator('[data-attr="workflow-launch"]')).toBeVisible()
-
- await expect(page).toHaveScreenshot('workflow-view-editor.png', { fullPage: true })
- })
-
- test.skip('invocations tab shows logs viewer', async ({ page }) => {
- // Click on Invocations tab
- await page.getByRole('tab', { name: /Invocations/ }).click()
- await page.waitForSelector('[data-attr="workflow-logs"]', { timeout: 10000 })
- // Wait for the loading spinner to disappear before taking a screenshot
- await expect(page.locator('[data-attr="workflow-logs"] svg.Spinner')).not.toBeVisible({ timeout: 10000 })
-
- await expect(page).toHaveScreenshot('workflow-view-logs.png', { fullPage: true })
- })
-
- test.skip('metrics tab shows metrics dashboard', async ({ page }) => {
- // Click on Metrics tab
- await page.getByRole('tab', { name: 'Metrics' }).click()
- await page.waitForSelector('[data-attr="workflow-metrics"]', { timeout: 10000 })
-
- await expect(page).toHaveScreenshot('workflow-view-metrics.png', { fullPage: true })
- })
-
- test.skip('history tab shows activity log', async ({ page }) => {
- // Click on History tab
- await page.getByRole('tab', { name: 'History' }).click()
- await page.waitForSelector('[data-attr="activity-log"]', { timeout: 10000 })
-
- await expect(page).toHaveScreenshot('workflow-view-history.png', { fullPage: true })
- })
-
- test.skip('can navigate between all workflow tabs', async ({ page }) => {
- // Start on workflow tab
- await expect(page.locator('[data-attr="workflow-editor"]')).toBeVisible()
-
- // Go to Invocations
- await page.getByRole('tab', { name: /Invocations/ }).click()
- await page.waitForSelector('[data-attr="workflow-logs"]', { timeout: 10000 })
- await expect(page).toHaveURL(/\/logs/)
-
- // Go to Metrics
- await page.getByRole('tab', { name: 'Metrics' }).click()
- await page.waitForSelector('[data-attr="workflow-metrics"]', { timeout: 10000 })
- await expect(page).toHaveURL(/\/metrics/)
-
- // Go to History
- await page.getByRole('tab', { name: 'History' }).click()
- await expect(page).toHaveURL(/\/history/)
-
- // Go back to Workflow
- await page.getByRole('tab', { name: 'Workflow' }).click()
- await page.waitForSelector('[data-attr="workflow-editor"]', { timeout: 10000 })
- await expect(page).toHaveURL(/\/workflow/)
- })
- })
-})
diff --git a/playwright/page-models/dashboardPage.ts b/playwright/page-models/dashboardPage.ts
index 409950ab9035..089c025111bb 100644
--- a/playwright/page-models/dashboardPage.ts
+++ b/playwright/page-models/dashboardPage.ts
@@ -28,7 +28,7 @@ export class DashboardPage {
}
async createNew(dashboardName?: string): Promise<DashboardPage> {
- // CI occasionally hits net::ERR_NETWORK_CHANGED on goto; retry the navigation only.
+ // CI occasionally hits net::ERR_NETWORK_CHANGED on this goto.
await expect(async () => {
await this.page.goto(urls.dashboards())
}).toPass({ timeout: 60000 })
@@ -70,6 +70,7 @@ export class DashboardPage {
'[data-attr="create-dashboard-from-template"], [data-attr="create-dashboard-from-template-featured"]'
)
.filter({ hasText: 'Website Metrics' })
+ .first()
await expect(templateOption).toBeVisible()
await templateOption.click()
@@ -270,7 +271,7 @@ export class DashboardPage {
}
async editPopoverTitle(newTitle: string): Promise<void> {
- await this.popoverTitleField.click()
+ await this.popoverTitleField.locator('.EditableField__display').click()
const input = this.popoverTitleField.locator('input')
await expect(input).toBeVisible()
await input.fill(newTitle)
@@ -278,7 +279,7 @@ export class DashboardPage {
}
async editPopoverDescription(description: string): Promise<void> {
- await this.popoverDescriptionField.click()
+ await this.popoverDescriptionField.locator('.EditableField__display').click()
const textarea = this.popoverDescriptionField.locator('textarea')
await expect(textarea).toBeVisible()
await textarea.fill(description)
diff --git a/playwright/playwright.config.ts b/playwright/playwright.config.ts
index 221e1bc4c46a..dc30aad796e6 100644
--- a/playwright/playwright.config.ts
+++ b/playwright/playwright.config.ts
@@ -30,8 +30,13 @@ export default defineConfig({
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
- /* Retry on CI only */
- retries: process.env.CI ? 3 : 2,
+ /*
+ Retries are 3 on CI by default. The nightly flake-audit workflow sets
+ PLAYWRIGHT_RETRIES=0 to surface the true per-test failure rate, which the
+ default retry budget otherwise hides (50%-flaky tests pass 93.75% of the time
+ with 4 attempts).
+ */
+ retries: process.env.PLAYWRIGHT_RETRIES ? Number(process.env.PLAYWRIGHT_RETRIES) : process.env.CI ? 3 : 2,
/*
GitHub Actions has 4 cores so run 3 workers
and leave one core for all the rest
diff --git a/playwright/utils/navigation.ts b/playwright/utils/navigation.ts
index 11fcf0580ace..c147263a0b44 100644
--- a/playwright/utils/navigation.ts
+++ b/playwright/utils/navigation.ts
@@ -32,6 +32,11 @@ const IDENTIFIER_URL_FALLBACKS: Record<string, string> = {
insights: '/insights',
}
+function teamIdFromPath(pathname: string): number | null {
+ const match = pathname.match(/^\/project\/(\d+)(?:\/|$)/)
+ return match ? Number(match[1]) : null
+}
+
export class Navigation {
readonly page: Page
@@ -49,7 +54,14 @@ export class Navigation {
// (and only when the parent collapsible section is expanded), so for known scenes
// we navigate by URL — that's the most reliable cross-layout behavior.
if (IDENTIFIER_URL_FALLBACKS[name]) {
- await this.page.goto(IDENTIFIER_URL_FALLBACKS[name])
+ // Caddy proxies the literal paths `/surveys`, `/surveys/`, `/api/surveys`
+ // to the SDK's hypercache-server, and going through `/project/<teamId>/...`
+ // avoids that matcher and lets the app load normally.
+ await this.page.waitForURL(/\/project\/\d+(?:\/|$)/, { timeout: 10_000 }).catch(() => {})
+ const teamId = teamIdFromPath(new URL(this.page.url()).pathname)
+ const path = IDENTIFIER_URL_FALLBACKS[name]
+ const target = teamId !== null ? `/project/${teamId}${path}` : path
+ await this.page.goto(target)
} else {
// Fall back to legacy selectors for scenes we haven't mapped yet.
const navbarSelector = this.page.getByTestId(`navbar-${name}`)
diff --git a/playwright/utils/playwright-test-base.ts b/playwright/utils/playwright-test-base.ts
index 0979513a6c88..a69be2312a56 100644
--- a/playwright/utils/playwright-test-base.ts
+++ b/playwright/utils/playwright-test-base.ts
@@ -5,8 +5,25 @@ import { urls } from 'scenes/urls'
import { LOGIN_PASSWORD, LOGIN_USERNAME, test as coreTest } from './playwright-test-core'
/**
- * Legacy Playwright test base with automatic login
- * This maintains backwards compatibility for existing tests
+ * Legacy Playwright test base with automatic login against the shared demo team.
+ *
+ * @deprecated New tests should use `workspace-test-base.ts`, which creates a
+ * dedicated workspace per test via the setup_test endpoint. The legacy base shares
+ * a single team across every spec that imports it, so any insight/cohort/survey/etc.
+ * created by one test is visible to the others — the four CI Playwright workers
+ * compound this into nondeterministic failures based on ordering.
+ *
+ * Migration plan:
+ * 1. For each spec on this base, decide if it depends on demo-team seed data
+ * (grep for `is_demo`, `Test-Cohort`, `CohortPage`, hardcoded demo references).
+ * 2. If yes: the seed needs to be migrated into setup_test fixtures before the
+ * spec can move. Known seed-dependent specs at time of writing:
+ * - playwright/e2e/surveys/crud.spec.ts (uses `is_demo` person property)
+ * - playwright/e2e/product-analytics/cohorts.spec.ts (uses Test-Cohort fixtures)
+ * 3. If no: swap the import to `./workspace-test-base` and call
+ * `playwrightSetup.createWorkspace()` + `playwrightSetup.login()` explicitly.
+ *
+ * Endgame is deleting this file.
*/
export const test = coreTest.extend<{ loginBeforeTests: void }>({
// this auto fixture makes sure we log in before every test (maintains legacy behavior)
@@ -29,54 +46,6 @@ export const test = coreTest.extend<{ loginBeforeTests: void }>({
},
{ auto: true },
],
- // mockStaticAssets: [
- // async ({ context }, use) => {
- // // also equivalent of cy.intercept('GET', '/surveys/*').as('surveys') ??
- // void context.route('**/e/*', (route) => {
- // void route.fulfill({
- // status: 200,
- // contentType: 'application/json',
- // body: JSON.stringify({ status: 1 }),
- // headers: {
- // 'Access-Control-Allow-Headers': '*',
- // 'Access-Control-Allow-Origin': '*',
- // 'Access-Control-Allow-Credentials': 'true',
- // },
- // })
- // })
- //
- // void context.route('**/ses/*', (route) => {
- // void route.fulfill({
- // status: 200,
- // contentType: 'application/json',
- // body: JSON.stringify({ status: 1 }),
- // })
- // })
- //
- // lazyLoadedJSFiles.forEach((key: string) => {
- // void context.route(new RegExp(`^.*/static/${key}\\.js(\\?.*)?$`), (route) => {
- // route.fulfill({
- // headers: {
- // loaded: 'using relative path by playwright',
- // },
- // path: `./dist/${key}.js`,
- // })
- // })
- //
- // void context.route(`**/static/${key}.js.map`, (route) => {
- // route.fulfill({
- // headers: { loaded: 'using relative path by playwright' },
- // path: `./dist/${key}.js.map`,
- // })
- // })
- // })
- //
- // await use()
- // // there's no teardown, so nothing here
- // },
- // // auto so that tests don't need to remember they need this... every test needs it
- // { auto: true },
- // ],
})
// Re-export everything for backwards compatibility