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(e2e): drop product analytics playwright tests covered elsewhere (#129385)

Georges-Antoine Assid0e7e3f215ee
diff --git a/playwright/e2e/product-analytics/dashboards.spec.ts b/playwright/e2e/product-analytics/dashboards.spec.ts
index 89d6b53698ba..6ed96b9e87d7 100644
--- a/playwright/e2e/product-analytics/dashboards.spec.ts
+++ b/playwright/e2e/product-analytics/dashboards.spec.ts
@@ -44,25 +44,6 @@ test.describe('Dashboards', () => {
await playwrightSetup.login(page, workspace!)
})
- test('Can create a new dashboard with an insight', async ({ page }) => {
- const dashboard = new DashboardPage(page)
- const dashboardName = randomString('dash-edit')
- const insightName = randomString('dash-trends')
-
- await test.step('create a saved Trends insight', async () => {
- await createSavedTrendsInsight(page, insightName, workspace!)
- })
-
- await test.step('create a dashboard', async () => {
- await dashboard.createNew(dashboardName)
- })
-
- await test.step('add the insight to the dashboard', async () => {
- await dashboard.addInsightToNewDashboard(insightName)
- await expect(dashboard.insightCards).toBeVisible()
- })
- })
-
test('Editing an insight updates the dashboard tile', async ({ page }) => {
const dashboard = new DashboardPage(page)
const insight = new InsightPage(page)
@@ -333,142 +314,6 @@ test.describe('Dashboards', () => {
await expect(dashboard.insightCards).toHaveCount(0)
})
})
-
- test('Creating a dashboard from a template populates tiles', async ({ page }) => {
- const dashboard = new DashboardPage(page)
-
- await test.step('create a dashboard from a template', async () => {
- await dashboard.createFromTemplate()
- })
-
- await test.step('verify the template dashboard has tiles', async () => {
- await expect(dashboard.insightCards.first()).toBeVisible({ timeout: 30000 })
-
- const tileCount = await dashboard.insightCards.count()
- expect(tileCount).toBeGreaterThan(0)
- })
- })
-})
-
-test.describe('Dashboard duplication', () => {
- let workspace: PlaywrightWorkspaceSetupResult | null = null
-
- test.beforeAll(async ({ playwrightSetup }) => {
- workspace = await playwrightSetup.createWorkspace({
- use_current_time: true,
- skip_onboarding: true,
- insight_variables: [{ name: 'Test Var', type: 'Number', default_value: 10 }],
- insights: [
- {
- name: 'Variable insight',
- query: {
- kind: 'DataVisualizationNode',
- source: { kind: 'HogQLQuery', query: 'SELECT {variables.test_var}' },
- chartSettings: {},
- tableSettings: {},
- },
- variable_indexes: [0],
- },
- ],
- dashboards: [
- {
- name: 'Duplication source',
- insight_indexes: [0],
- variable_overrides: { '0': 42 },
- },
- ],
- })
- })
-
- test.beforeEach(async ({ page, playwrightSetup }) => {
- await playwrightSetup.login(page, workspace!)
- })
-
- test('Duplicating a dashboard preserves text cards, date filter, and variables', async ({ page }) => {
- const dashboard = new DashboardPage(page)
- const cardText = randomString('card-text')
- const seededDashboardId = workspace!.created_dashboards![0].id
- let sourceDashboardUrl: string
-
- await test.step('navigate to seeded dashboard and add a text card', async () => {
- await page.goto(`/project/${workspace!.team_id}/dashboard/${seededDashboardId}`)
- await expect(dashboard.insightCards).toBeVisible()
- await dashboard.addTextCard(cardText)
- })
-
- await test.step('set date filter', async () => {
- sourceDashboardUrl = page.url()
- await dashboard.setDateFilter('Last 30 days')
- await dashboard.saveFilters()
- })
-
- await test.step('duplicate the dashboard', async () => {
- await dashboard.duplicate()
- await expect(page).not.toHaveURL(sourceDashboardUrl)
- })
-
- await test.step('verify duplicated dashboard preserves text card, date filter, and variable override', async () => {
- await expect(dashboard.textCards).toBeVisible()
- await expect(dashboard.textCards).toContainText(cardText)
- await expect(dashboard.dateFilter).toContainText('Last 30 days')
- await expect(dashboard.variableButtons.first()).toContainText('42')
- })
- })
-})
-
-test.describe('Dashboard link variable and filter overrides', () => {
- let workspace: PlaywrightWorkspaceSetupResult | null = null
-
- test.beforeAll(async ({ playwrightSetup }) => {
- workspace = await playwrightSetup.createWorkspace({
- use_current_time: true,
- skip_onboarding: true,
- insight_variables: [{ name: 'Test Var', type: 'Number', default_value: 10 }],
- insights: [
- {
- name: 'Variable insight',
- query: {
- kind: 'DataVisualizationNode',
- source: { kind: 'HogQLQuery', query: 'SELECT {variables.test_var}' },
- chartSettings: {},
- tableSettings: {},
- },
- variable_indexes: [0],
- },
- ],
- dashboards: [
- {
- name: 'URL query variables seed',
- insight_indexes: [0],
- variable_overrides: { '0': 42 },
- filters: { date_from: '-30d' },
- },
- ],
- })
- })
-
- test.beforeEach(async ({ page, playwrightSetup }) => {
- await playwrightSetup.login(page, workspace!)
- })
-
- test('Opening a shared dashboard link applies variable and filter overrides from the URL on first load', async ({
- page,
- }) => {
- const dashboard = new DashboardPage(page)
- const seededDashboardId = workspace!.created_dashboards![0].id
- const urlOverride = 77
- const searchParams = new URLSearchParams()
- searchParams.set('query_variables', JSON.stringify({ test_var: urlOverride }))
- searchParams.set('query_filters', JSON.stringify({ date_from: '-7d' }))
-
- await page.goto(`/project/${workspace!.team_id}/dashboard/${seededDashboardId}?${searchParams.toString()}`, {
- waitUntil: 'domcontentloaded',
- })
-
- await expect(dashboard.insightCards).toBeVisible()
- await expect(dashboard.variableButtons.first()).toContainText(String(urlOverride))
- await expect(dashboard.dateFilter).toContainText('Last 7 days')
- })
})
test.describe('Dashboard compact cards and inline editing', () => {
@@ -482,29 +327,6 @@ test.describe('Dashboard compact cards and inline editing', () => {
await playwrightSetup.login(page, workspace!)
})
- test('Edit mode button enters and exits edit mode', async ({ page }) => {
- const dashboard = new DashboardPage(page)
- const insightName = randomString('dash-trends')
-
- await test.step('create a saved Trends insight', async () => {
- await createSavedTrendsInsight(page, insightName, workspace!)
- })
-
- await test.step('create a dashboard with an insight', async () => {
- await dashboard.createNew()
- await dashboard.addInsightToNewDashboard(insightName)
- await expect(dashboard.insightCards).toBeVisible()
- })
-
- await test.step('enter edit mode via the edit button', async () => {
- await dashboard.enterEditMode()
- })
-
- await test.step('save and exit edit mode', async () => {
- await dashboard.saveEditMode()
- })
- })
-
test('Inline editing insight title via compact card popover', async ({ page }) => {
const dashboard = new DashboardPage(page)
const insightName = randomString('dash-trends')
diff --git a/playwright/e2e/product-analytics/insights/funnels.spec.ts b/playwright/e2e/product-analytics/insights/funnels.spec.ts
index 9ad4df42b6e0..6420dfeeedb6 100644
--- a/playwright/e2e/product-analytics/insights/funnels.spec.ts
+++ b/playwright/e2e/product-analytics/insights/funnels.spec.ts
@@ -1,7 +1,6 @@
import { InsightShortId, InsightType } from '~/types'
import { InsightPage } from '../../../page-models/insightPage'
-import { randomString } from '../../../utils'
import { createEvent, daysAgo } from '../../../utils/event-data'
import { PlaywrightSetupEvent } from '../../../utils/playwright-setup'
import { PlaywrightWorkspaceSetupResult, expect, test } from '../../../utils/workspace-test-base'
@@ -9,7 +8,6 @@ import { PlaywrightWorkspaceSetupResult, expect, test } from '../../../utils/wor
const STEP_1 = 'funnel_step_one'
const STEP_2 = 'funnel_step_two'
const STEP_3 = 'funnel_step_three'
-const EXCLUSION_EVENT = 'funnel_excluded_action'
/**
* Generates funnel events for 20 users across 3 steps with predictable conversion rates.
@@ -18,36 +16,17 @@ const EXCLUSION_EVENT = 'funnel_excluded_action'
* Chrome 10 10 5 (50% total conversion)
* Firefox 10 0 0 (0% total conversion)
* Total 20 10 5 (25% total conversion)
- *
- * chrome-user-0 performs the exclusion event between steps 1 and 2.
- * This user converts through all 3 steps, so excluding them meaningfully
- * changes the numbers: 20→19 at step 1, 10→9 at step 2, 5→4 at step 3.
- * Steps are spaced 24h apart so a 1-hour conversion window yields 0 conversions.
*/
function generateFunnelEvents(): PlaywrightSetupEvent[] {
const chromeUsers = (n: number): string => `chrome-user-${n}`
const firefoxUsers = (n: number): string => `firefox-user-${n + 10}`
- const chrome = { $browser: 'Chrome', $session_id: 'chrome-session' }
- const firefox = { $browser: 'Firefox', $session_id: 'firefox-session' }
-
- // Midpoint between step 1 and step 2 — immune to time-of-day drift
- const betweenStep1And2 = (() => {
- const d = new Date()
- d.setDate(d.getDate() - 5)
- d.setHours(12, 0, 0, 0)
- return d.toISOString()
- })()
+ const chrome = { $browser: 'Chrome' }
+ const firefox = { $browser: 'Firefox' }
return [
...createEvent({ event: STEP_1, user: chromeUsers, timestamp: daysAgo(5), properties: chrome }).repeat(10),
...createEvent({ event: STEP_1, user: firefoxUsers, timestamp: daysAgo(5), properties: firefox }).repeat(10),
- ...createEvent({
- event: EXCLUSION_EVENT,
- user: 'chrome-user-0',
- timestamp: betweenStep1And2,
- properties: chrome,
- }).events,
...createEvent({ event: STEP_2, user: chromeUsers, timestamp: daysAgo(4), properties: chrome }).repeat(10),
...createEvent({ event: STEP_3, user: chromeUsers, timestamp: daysAgo(3), properties: chrome }).repeat(5),
]
@@ -75,13 +54,7 @@ test.describe('Funnel insights', () => {
use_current_time: true,
skip_onboarding: true,
events: generateFunnelEvents(),
- // Tests that save the insight get their own copy — saving a shared insight
- // leaks state (e.g. step order) into every test that loads it afterwards.
- insights: [
- { name: 'Seeded Funnel', query: FUNNEL_QUERY },
- { name: 'Step Order Funnel', query: FUNNEL_QUERY },
- { name: 'Lifecycle Funnel', query: FUNNEL_QUERY },
- ],
+ insights: [{ name: 'Seeded Funnel', query: FUNNEL_QUERY }],
dashboards: [{ name: 'Funnel Dashboard', insight_indexes: [0] }],
})
})
@@ -90,15 +63,8 @@ test.describe('Funnel insights', () => {
await playwrightSetup.login(page, workspace!)
})
- function seededInsightId(insightIndex: number = 0): InsightShortId {
- return workspace!.created_insights![insightIndex].short_id as InsightShortId
- }
-
- async function goToSeededFunnel(page: InsightPage['page'], insightIndex: number = 0): Promise<InsightPage> {
- const insight = new InsightPage(page)
- await insight.goToInsight(seededInsightId(insightIndex), { edit: true })
- await insight.funnels.waitForChart()
- return insight
+ function seededInsightId(): InsightShortId {
+ return workspace!.created_insights![0].short_id as InsightShortId
}
// Setting the conversion window right after navigation or entering edit mode can race
@@ -183,245 +149,6 @@ test.describe('Funnel insights', () => {
})
})
- test('Switch between funnel visualization types', async ({ page }) => {
- const insight = await goToSeededFunnel(page)
-
- await test.step('default is Conversion steps with correct counts', async () => {
- await expect(insight.funnels.verticalChart).toBeVisible()
- await expect(insight.funnels.stepLegend(0)).toContainText('20')
- await expect(insight.funnels.stepLegend(1)).toContainText('10')
- await expect(insight.funnels.stepLegend(2)).toContainText('5')
- })
-
- await test.step('switch to Time to convert', async () => {
- await insight.funnels.selectVizType('Time to convert')
- await insight.funnels.waitForHistogram()
- await expect(insight.funnels.verticalChart).not.toBeVisible()
- })
-
- await test.step('switch to Historical trends', async () => {
- await insight.funnels.selectVizType('Historical trends')
- await insight.funnels.waitForTrendsLineGraph()
- await expect(insight.funnels.histogram).not.toBeVisible()
- })
-
- await test.step('switch back to Conversion steps and verify counts preserved', async () => {
- await insight.funnels.selectVizType('Conversion steps')
- await insight.funnels.waitForChart()
- await expect(insight.funnels.trendsLineGraph).not.toBeVisible()
- await expect(insight.funnels.stepLegend(0)).toContainText('20')
- await expect(insight.funnels.stepLegend(1)).toContainText('10')
- await expect(insight.funnels.stepLegend(2)).toContainText('5')
- })
- })
-
- test('Configure step ordering and session aggregation gating', async ({ page }) => {
- const insight = await goToSeededFunnel(page, 1)
-
- await test.step('default step order is Sequential', async () => {
- await expect(insight.funnels.stepOrderFilter).toContainText('Sequential')
- })
-
- await test.step('switch to Strict order and verify counts', async () => {
- await insight.funnels.selectStepOrder('Strict order')
- await insight.funnels.waitForChart()
- await expect(insight.funnels.stepOrderFilter).toContainText('Strict')
- await expect(insight.funnels.stepLegend(0)).toContainText('20')
- await expect(insight.funnels.stepLegend(1)).toContainText('9')
- await expect(insight.funnels.stepLegend(2)).toContainText('4')
- })
-
- await test.step('switch to Any order and verify counts', async () => {
- await insight.funnels.selectStepOrder('Any order')
- await insight.funnels.waitForChart()
- await expect(insight.funnels.stepOrderFilter).toContainText('Any order')
- await expect(insight.funnels.stepLegend(0)).toContainText('20')
- await expect(insight.funnels.stepLegend(1)).toContainText('10')
- await expect(insight.funnels.stepLegend(2)).toContainText('5')
- })
-
- await test.step('switch back to Sequential', async () => {
- await insight.funnels.selectStepOrder('Sequential')
- await insight.funnels.waitForChart()
- await expect(insight.funnels.stepOrderFilter).toContainText('Sequential')
- })
-
- await test.step('clicking dropped-off count opens persons modal with correct users', async () => {
- // Repeat runs share the workspace, so the round-trip back to Sequential can
- // match the saved state exactly — only save when there is something to save.
- if (!(await insight.saveButton.innerText()).includes('No changes')) {
- await insight.save()
- }
- await insight.funnels.waitForChart()
-
- await insight.funnels.clickStepDropOff(1)
-
- const modal = page.getByTestId('persons-modal')
- await expect(modal).toBeVisible({ timeout: 10000 })
- // The actors query can take well over the local 10s expect default under load.
- // Depending on person merge/deletion state, actors may appear as named users,
- // "Anonymous", or not be shown at all (no associated distinct IDs). Wait for
- // the query to finish (person rows appear OR the "not shown" fallback renders)
- // before asserting the modal loaded successfully.
- const personRows = modal.locator('[data-attr^="persons-modal-expand-"]')
- const notShownMessage = modal.locator('text=/not shown/')
- await expect(personRows.first().or(notShownMessage)).toBeVisible({ timeout: 30000 })
-
- await modal.getByRole('button', { name: 'close' }).click()
- await expect(modal).not.toBeVisible()
- })
-
- await test.step('session aggregation allows opening sessions modal on step counts', async () => {
- await insight.edit()
- await insight.funnels.selectAggregation('Unique sessions')
- await insight.funnels.waitForChart()
- await insight.save()
- await insight.funnels.waitForChart()
-
- const step2 = insight.funnels.stepLegend(1)
- await expect(step2).toBeVisible()
-
- await expect(step2.getByTestId('funnel-inspect-converted')).toHaveCount(1)
-
- await insight.funnels.clickStepDropOff(1)
-
- const modal = page.getByTestId('persons-modal')
- await expect(modal).toBeVisible({ timeout: 10000 })
-
- await modal.getByRole('button', { name: 'close' }).click()
- await expect(modal).not.toBeVisible()
- })
-
- await test.step('revert seeded insight to unique users', async () => {
- await insight.edit()
- await insight.funnels.selectAggregation('Unique users')
- await insight.funnels.waitForChart()
- await insight.save()
- })
- })
-
- test('Change conversion window', async ({ page }) => {
- const insight = await goToSeededFunnel(page)
-
- await test.step('verify baseline counts with default 14-day window', async () => {
- await expect(insight.funnels.stepLegend(0)).toContainText('20')
- await expect(insight.funnels.stepLegend(1)).toContainText('10')
- })
-
- await test.step('set conversion window to 1 hour — step 2 drops to 0', async () => {
- await insight.funnels.setConversionWindowInterval('1')
- await insight.funnels.selectConversionWindowUnit('Hour')
- await insight.funnels.waitForChart()
-
- await expect(insight.funnels.stepLegend(0)).toContainText('20')
- await expect(insight.funnels.stepLegend(1)).toContainText('0')
- })
-
- await test.step('set conversion window back to 14 days — original numbers return', async () => {
- await insight.funnels.setConversionWindowInterval('14')
- await insight.funnels.selectConversionWindowUnit('Day')
- await insight.funnels.waitForChart()
-
- await expect(insight.funnels.stepLegend(0)).toContainText('20')
- await expect(insight.funnels.stepLegend(1)).toContainText('10')
- })
- })
-
- test('Add breakdown and verify steps table', async ({ page }) => {
- const insight = await goToSeededFunnel(page)
-
- await test.step('add breakdown by $browser', async () => {
- await insight.funnels.addBreakdown('$browser')
- await insight.funnels.waitForChart()
- })
-
- await test.step('verify breakdown table shows Chrome and Firefox', async () => {
- const table = page.getByTestId('funnel-breakdown-table')
- await expect(table).toBeVisible()
- await expect(table.getByText('Chrome')).toBeVisible()
- await expect(table.getByText('Firefox')).toBeVisible()
- })
-
- await test.step('verify Chrome: 50% total conversion (5/10)', async () => {
- const table = page.getByTestId('funnel-breakdown-table')
- const chromeRow = table.getByRole('row').filter({ hasText: 'Chrome' })
- await expect(chromeRow).toContainText('50')
- })
-
- await test.step('verify Firefox: 0% total conversion (0/10)', async () => {
- const table = page.getByTestId('funnel-breakdown-table')
- const firefoxRow = table.getByRole('row').filter({ hasText: 'Firefox' })
- await expect(firefoxRow).toContainText('0%')
- })
- })
-
- test('Exclusion steps filter out users', async ({ page }) => {
- const insight = await goToSeededFunnel(page)
-
- await test.step('verify baseline: 20 → 10 → 5', async () => {
- await expect(insight.funnels.stepLegend(0)).toContainText('20')
- await expect(insight.funnels.stepLegend(1)).toContainText('10')
- })
-
- await test.step('add exclusion for funnel_excluded_action between steps 1 and 2', async () => {
- await insight.funnels.addExclusion(EXCLUSION_EVENT)
- await insight.funnels.waitForChart()
- })
-
- await test.step('verify chrome-user-0 is excluded: 19 → 9 → 4', async () => {
- await expect(insight.funnels.stepLegend(0)).toContainText('19')
- await expect(insight.funnels.stepLegend(1)).toContainText('9')
- await expect(insight.funnels.stepLegend(2)).toContainText('4')
- })
- })
-
- test('Save, button states, edit, and cancel lifecycle', async ({ page }) => {
- const insight = await goToSeededFunnel(page, 2)
- const funnelName = randomString('funnel-lifecycle')
-
- // Repeat runs share the workspace, so derive window values from the currently
- // saved one — hardcoded values would be a no-op edit on the second run.
- const savedWindow = Number(await insight.funnels.getConversionWindowInterval())
- const windowA = String(savedWindow >= 300 ? 2 : savedWindow + 1)
- const windowB = String(savedWindow >= 300 ? 3 : savedWindow + 2)
-
- await test.step('save button is enabled on unsaved changes', async () => {
- await setConversionWindowUntilDirty(insight, windowA)
- await insight.funnels.waitForChart()
- await expect(insight.saveButton).toBeEnabled()
- await expect(insight.saveButton).not.toContainText('No changes')
- })
-
- await test.step('name and save the insight', async () => {
- await insight.editName(funnelName)
- await insight.save()
- await expect(insight.editButton).toBeVisible()
- })
-
- await test.step('click edit — save button shows No changes when clean', async () => {
- await insight.edit()
- await expect(insight.saveButton).toContainText('No changes')
- await expect(insight.saveButton).toBeDisabled()
- })
-
- await test.step('make a change — save enables, cancel button appears', async () => {
- await setConversionWindowUntilDirty(insight, windowB)
- await insight.funnels.waitForChart()
-
- await expect(insight.saveButton).toBeEnabled()
- await expect(insight.saveButton).toContainText('Save')
- await expect(insight.cancelButton).toBeVisible()
- })
-
- await test.step('cancel edit — conversion window reverts to saved value', async () => {
- await insight.discard()
- await insight.funnels.waitForChart()
-
- await insight.edit()
- await expect(insight.funnels.conversionWindowInput).toHaveValue(windowA)
- })
- })
-
test('Override/discard lifecycle from dashboard', async ({ page }) => {
const insight = new InsightPage(page)
const dashboardId = workspace!.created_dashboards![0].id
diff --git a/playwright/e2e/product-analytics/insights/insight-side-panel.spec.ts b/playwright/e2e/product-analytics/insights/insight-side-panel.spec.ts
index c86d7cd62ec8..f5875318bb7a 100644
--- a/playwright/e2e/product-analytics/insights/insight-side-panel.spec.ts
+++ b/playwright/e2e/product-analytics/insights/insight-side-panel.spec.ts
@@ -1,13 +1,10 @@
import { NodeKind } from '../../../../frontend/src/queries/schema/schema-general'
import { InsightPage } from '../../../page-models/insightPage'
-import { randomString } from '../../../utils'
import { PlaywrightWorkspaceSetupResult, expect, test } from '../../../utils/workspace-test-base'
test.describe('Insight side panel actions', () => {
let workspace: PlaywrightWorkspaceSetupResult | null = null
let insightUrl: string
- let favoriteInsightUrl: string
- const favoriteInsightName = randomString('Favorite Test')
test.beforeAll(async ({ playwrightSetup }) => {
workspace = await playwrightSetup.createWorkspace({
@@ -24,22 +21,10 @@ test.describe('Insight side panel actions', () => {
},
},
},
- {
- name: favoriteInsightName,
- query: {
- kind: NodeKind.InsightVizNode,
- source: {
- kind: NodeKind.TrendsQuery,
- series: [{ kind: NodeKind.EventsNode, event: '$pageview' }],
- },
- },
- },
],
})
const shortId = workspace!.created_insights![0].short_id
insightUrl = `/project/${workspace!.team_id}/insights/${shortId}`
- const favoriteShortId = workspace!.created_insights![1].short_id
- favoriteInsightUrl = `/project/${workspace!.team_id}/insights/${favoriteShortId}`
})
test.beforeEach(async ({ page, playwrightSetup }) => {
@@ -69,31 +54,6 @@ test.describe('Insight side panel actions', () => {
})
})
- test('Favorite insight from side panel shows in favorites list', async ({ page }) => {
- const insight = new InsightPage(page)
-
- await test.step('navigate to seeded insight', async () => {
- await page.goto(favoriteInsightUrl)
- await insight.trends.waitForChart()
- })
-
- await test.step('open side panel and click favorite', async () => {
- await insight.openInfoPanel()
- const favoriteButton = page.getByTestId('insight-favorite-button')
- await expect(favoriteButton).toBeEnabled()
-
- const patchPromise = page.waitForResponse(
- (resp) =>
- resp.url().includes('/api/projects/') &&
- resp.url().includes('/insights/') &&
- resp.request().method() === 'PATCH'
- )
- await favoriteButton.click()
- await patchPromise
- await expect(favoriteButton).toHaveAttribute('data-active', 'true')
- })
- })
-
test('View source toggle enters edit mode and shows query editor', async ({ page }) => {
const insight = new InsightPage(page)
@@ -141,19 +101,6 @@ test.describe('Insight side panel actions', () => {
})
})
- test('Open subscriptions modal from insight header', async ({ page }) => {
- await test.step('navigate to seeded insight', async () => {
- await page.goto(insightUrl)
- })
-
- await test.step('click Monitor and open subscriptions', async () => {
- await page.getByTestId('insight-notify-prominent-button').click()
- await page.getByRole('menuitem', { name: /Subscriptions/ }).click()
- const modal = page.getByTestId('insight-subscriptions-modal')
- await expect(modal).toBeVisible()
- })
- })
-
test('Export insight as Terraform and download the file', async ({ page }) => {
const insight = new InsightPage(page)
diff --git a/playwright/e2e/product-analytics/insights/paths.spec.ts b/playwright/e2e/product-analytics/insights/paths.spec.ts
index 8e01cb1bb683..18e6e393f7dd 100644
--- a/playwright/e2e/product-analytics/insights/paths.spec.ts
+++ b/playwright/e2e/product-analytics/insights/paths.spec.ts
@@ -3,10 +3,10 @@ import { InsightType } from '~/types'
import { InsightPage } from '../../../page-models/insightPage'
import { PathNode } from '../../../page-models/insights/pathsInsight'
import { randomString } from '../../../utils'
-import { sequentialCustomEvents, sequentialPageviews } from '../../../utils/test-data'
+import { sequentialPageviews } from '../../../utils/test-data'
import { PlaywrightWorkspaceSetupResult, expect, test } from '../../../utils/workspace-test-base'
-const events = [...sequentialPageviews.events, ...sequentialCustomEvents.events]
+const events = sequentialPageviews.events
function expectNodesToMatch(actual: PathNode[], expected: { name: string; count: number }[]): void {
for (const exp of expected) {
@@ -71,38 +71,4 @@ test.describe('User Paths insights', () => {
expectNodesToMatch(nodes, sequentialPageviews.expected.nodes.slice(0, 3))
})
})
-
- test('Switch to custom events and verify node counts match seeded data', async ({ page }) => {
- const insight = new InsightPage(page)
-
- await test.step('navigate to new Paths insight with pageview data', async () => {
- await insight.goToNewInsight(InsightType.PATHS)
- await expect(insight.activeTab).toContainText('User Paths')
- await insight.paths.waitForNodes()
- })
-
- await test.step('verify initial pageview nodes', async () => {
- const nodes = await insight.paths.getNodes()
- expectNodesToMatch(nodes, sequentialPageviews.expected.nodes)
- })
-
- await test.step('switch to Custom event and verify custom event nodes', async () => {
- await insight.paths.selectEventType('Custom event')
- await insight.paths.waitForNodes()
- const nodes = await insight.paths.getNodes()
- expectNodesToMatch(nodes, sequentialCustomEvents.expected.nodes)
- })
-
- await test.step('switch back to Page views and verify pageview nodes return', async () => {
- await insight.paths.selectEventType('Page views')
- await insight.paths.waitForNodes()
- const nodes = await insight.paths.getNodes()
- expectNodesToMatch(nodes, sequentialPageviews.expected.nodes)
- })
-
- await test.step('save and verify view mode', async () => {
- await insight.save()
- await expect(insight.editButton).toBeVisible()
- })
- })
})
diff --git a/playwright/e2e/product-analytics/insights/persons-modal.spec.ts b/playwright/e2e/product-analytics/insights/persons-modal.spec.ts
deleted file mode 100644
index 9ad6df0d36ed..000000000000
--- a/playwright/e2e/product-analytics/insights/persons-modal.spec.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import { InsightPage } from '../../../page-models/insightPage'
-import { pageviews } from '../../../utils/test-data'
-import { PlaywrightWorkspaceSetupResult, expect, test } from '../../../utils/workspace-test-base'
-
-const events = [...pageviews.events]
-
-test.describe('Persons modal', () => {
- let workspace: PlaywrightWorkspaceSetupResult | null = null
-
- test.beforeAll(async ({ playwrightSetup }) => {
- workspace = await playwrightSetup.createWorkspace({
- use_current_time: true,
- skip_onboarding: true,
- no_demo_data: true,
- events,
- })
- })
-
- test.beforeEach(async ({ page, playwrightSetup }) => {
- await playwrightSetup.login(page, workspace!)
- })
-
- test('"View events" navigates to the events explorer, not a Trends insight', async ({ page }) => {
- const insight = new InsightPage(page)
-
- await test.step('open a Number chart and click the value to open the persons modal', async () => {
- await insight.goToNewTrends()
- await insight.trends.waitForChart()
- // A Number chart exposes a single clickable aggregated value — a far more deterministic
- // drill-down target than a line-graph data point.
- await insight.trends.selectChartType(/^Number/)
- await expect(insight.trends.boldNumber).toContainText(pageviews.expected.total)
- await insight.trends.boldNumber.click()
- await expect(insight.personsModal).toBeVisible()
- })
-
- await test.step('"View events" opens the events explorer', async () => {
- await expect(insight.personsModalViewEventsButton).toBeVisible()
- const popupPromise = page.context().waitForEvent('page')
- await insight.personsModalViewEventsButton.click()
- const eventsTab = await popupPromise
- await expect(eventsTab).toHaveURL(/\/activity\/events/)
- })
- })
-})
diff --git a/playwright/e2e/product-analytics/insights/stickiness.spec.ts b/playwright/e2e/product-analytics/insights/stickiness.spec.ts
index 53045418de44..493b19dde0a9 100644
--- a/playwright/e2e/product-analytics/insights/stickiness.spec.ts
+++ b/playwright/e2e/product-analytics/insights/stickiness.spec.ts
@@ -1,13 +1,12 @@
import { InsightType } from '~/types'
import { InsightPage } from '../../../page-models/insightPage'
-import { stickinessPageviews, stickinessWithBreakdown } from '../../../utils/test-data'
+import { stickinessPageviews } from '../../../utils/test-data'
import { PlaywrightWorkspaceSetupResult, expect, test } from '../../../utils/workspace-test-base'
const pv = stickinessPageviews.expected
-const bd = stickinessWithBreakdown.expected
-const events = [...stickinessPageviews.events, ...stickinessWithBreakdown.events]
+const events = stickinessPageviews.events
test.describe('Stickiness insights', () => {
let workspace: PlaywrightWorkspaceSetupResult | null = null
@@ -60,112 +59,4 @@ test.describe('Stickiness insights', () => {
expect(day5).toContain(`(${pv.day5.users})`)
})
})
-
- test('Switch to custom event and verify stickiness values', async ({ page }) => {
- const insight = new InsightPage(page)
-
- await test.step('navigate to stickiness and switch to custom event', async () => {
- await insight.goToNewInsight(InsightType.STICKINESS)
- await expect(insight.activeTab).toContainText('Stickiness')
- await insight.stickiness.waitForChart()
- await insight.stickiness.selectEvent(0, stickinessWithBreakdown.eventName)
- await insight.stickiness.waitForChart()
- })
-
- await test.step('verify custom event stickiness distribution', async () => {
- await insight.stickiness.waitForDetailsTable()
-
- const day1 = await insight.stickiness.details.row(stickinessWithBreakdown.eventName).column('Day 1')
- expect(day1).toContain(`${bd.day1.percent.toFixed(1)}%`)
- expect(day1).toContain(`(${bd.day1.users})`)
-
- const day3 = await insight.stickiness.details.row(stickinessWithBreakdown.eventName).column('Day 3')
- expect(day3).toContain(`${bd.day3.percent.toFixed(1)}%`)
- expect(day3).toContain(`(${bd.day3.users})`)
-
- const day2 = await insight.stickiness.details.row(stickinessWithBreakdown.eventName).column('Day 2')
- expect(day2).toContain(`${bd.day2.percent.toFixed(1)}%`)
- expect(day2).toContain(`(${bd.day2.users})`)
- })
-
- await test.step('switch back to Pageview and verify original distribution', async () => {
- await insight.stickiness.selectEvent(0, 'Pageview')
- await insight.stickiness.waitForChart()
- await insight.stickiness.waitForDetailsTable()
-
- const day1 = await insight.stickiness.details.row('Pageview').column('Day 1')
- expect(day1).toContain(`${pv.day1.percent.toFixed(1)}%`)
- expect(day1).toContain(`(${pv.day1.users})`)
-
- const day5 = await insight.stickiness.details.row('Pageview').column('Day 5')
- expect(day5).toContain(`${pv.day5.percent.toFixed(1)}%`)
- expect(day5).toContain(`(${pv.day5.users})`)
- })
- })
-
- test('Add second series and verify both rows in details table', async ({ page }) => {
- const insight = new InsightPage(page)
-
- await test.step('navigate to stickiness with custom event', async () => {
- await insight.goToNewInsight(InsightType.STICKINESS)
- await expect(insight.activeTab).toContainText('Stickiness')
- await insight.stickiness.waitForChart()
- await insight.stickiness.selectEvent(0, stickinessWithBreakdown.eventName)
- await insight.stickiness.waitForChart()
- })
-
- await test.step('add second series with Pageview and verify both rows', async () => {
- await insight.stickiness.addSeries()
- await insight.stickiness.selectEvent(1, 'Pageview')
- await insight.stickiness.waitForChart()
- await insight.stickiness.waitForDetailsTable()
-
- const customDay1 = await insight.stickiness.details.row(stickinessWithBreakdown.eventName).column('Day 1')
- expect(customDay1).toContain(`${bd.day1.percent.toFixed(1)}%`)
-
- const pageviewDay1 = await insight.stickiness.details.row('Pageview').column('Day 1')
- expect(pageviewDay1).toContain(`${pv.day1.percent.toFixed(1)}%`)
- })
- })
-
- test('Change date range and toggle comparison', async ({ page }) => {
- const insight = new InsightPage(page)
-
- await test.step('navigate to stickiness insight', async () => {
- await insight.goToNewInsight(InsightType.STICKINESS)
- await expect(insight.activeTab).toContainText('Stickiness')
- await insight.stickiness.waitForChart()
- })
-
- await test.step('change date range to Last 14 days and verify data persists', async () => {
- await insight.stickiness.selectDateRange('Last 14 days')
- await insight.stickiness.waitForDetailsTable()
-
- const day1 = await insight.stickiness.details.row('Pageview').column('Day 1')
- expect(day1).toContain(`${pv.day1.percent.toFixed(1)}%`)
- expect(day1).toContain(`(${pv.day1.users})`)
-
- const day3 = await insight.stickiness.details.row('Pageview').column('Day 3')
- expect(day3).toContain(`${pv.day3.percent.toFixed(1)}%`)
- expect(day3).toContain(`(${pv.day3.users})`)
- })
-
- await test.step('enable comparison and verify no NaN in table', async () => {
- await insight.stickiness.selectComparison('Compare to previous period')
- await insight.stickiness.waitForDetailsTable()
- const tableText = await insight.stickiness.detailsTable.textContent()
- expect(tableText).not.toContain('NaN')
- expect(tableText).not.toContain('undefined')
- })
-
- await test.step('disable comparison and verify values restored', async () => {
- await insight.stickiness.selectComparison('No comparison between periods')
- await expect(insight.stickiness.comparisonButton).toContainText('No comparison')
- await insight.stickiness.waitForDetailsTable()
-
- const day1 = await insight.stickiness.details.row('Pageview').column('Day 1')
- expect(day1).toContain(`${pv.day1.percent.toFixed(1)}%`)
- expect(day1).toContain(`(${pv.day1.users})`)
- })
- })
})
diff --git a/playwright/e2e/product-analytics/insights/trends.spec.ts b/playwright/e2e/product-analytics/insights/trends.spec.ts
index 5587c4a9754f..9d8c10de35b6 100644
--- a/playwright/e2e/product-analytics/insights/trends.spec.ts
+++ b/playwright/e2e/product-analytics/insights/trends.spec.ts
@@ -1,9 +1,9 @@
import { InsightPage } from '../../../page-models/insightPage'
import { randomString } from '../../../utils'
-import { customEventsWithBreakdown, pageviews } from '../../../utils/test-data'
+import { pageviews } from '../../../utils/test-data'
import { PlaywrightWorkspaceSetupResult, expect, test } from '../../../utils/workspace-test-base'
-const events = [...pageviews.events, ...customEventsWithBreakdown.events]
+const events = pageviews.events
test.describe('Trends insights', () => {
let workspace: PlaywrightWorkspaceSetupResult | null = null
@@ -53,222 +53,6 @@ test.describe('Trends insights', () => {
})
})
- test('Add, duplicate, and delete series', async ({ page }) => {
- const insight = new InsightPage(page)
- await insight.goToNewTrends()
- await insight.trends.waitForChart()
-
- await test.step('change event to custom event and verify total', async () => {
- await insight.trends.selectEvent(0, customEventsWithBreakdown.eventName)
- await insight.trends.waitForChart()
- await insight.trends.expectTotals([customEventsWithBreakdown.expected.total])
- })
-
- await test.step('add second series with pageview and verify both totals', async () => {
- await insight.trends.addSeries()
- await insight.trends.selectEvent(1, 'Pageview')
- await insight.trends.waitForChart()
- await insight.trends.expectTotals([customEventsWithBreakdown.expected.total, pageviews.expected.total])
- })
-
- await test.step('duplicate first series', async () => {
- await insight.trends.duplicateSeries(0)
- await expect(page.getByTestId('trend-element-subject-2')).toBeVisible()
- })
-
- await test.step('delete first series and verify count drops to two', async () => {
- await insight.trends.deleteSeries(0)
- await expect(page.getByTestId('trend-element-subject-2')).not.toBeVisible()
- await expect(page.getByTestId('trend-element-subject-1')).toBeVisible()
- })
- })
-
- test('Switch aggregation to verify unique users and property value sums', async ({ page }) => {
- const insight = new InsightPage(page)
-
- await test.step('switch to custom event', async () => {
- await insight.goToNewTrends()
- await insight.trends.waitForChart()
- await insight.trends.selectEvent(0, customEventsWithBreakdown.eventName)
- await insight.trends.waitForChart()
- })
-
- await test.step('set property value sum of amount and verify total = 35', async () => {
- await insight.trends.selectMathWithAggregation(0, /property value/, 'sum')
- await insight.trends.selectMathProperty('amount')
- await insight.trends.selectChartType(/^Number/)
- await expect(insight.trends.boldNumber).toContainText(customEventsWithBreakdown.expected.amountSum)
- })
-
- await test.step('switch to unique users and verify bold number = 5', async () => {
- await insight.trends.selectMath(0, 'Unique users')
- await expect(insight.trends.boldNumber).toContainText(customEventsWithBreakdown.expected.uniqueUsers)
- })
-
- await test.step('switch to total count and verify bold number = 8', async () => {
- await insight.trends.selectMath(0, 'Total count')
- await expect(insight.trends.boldNumber).toContainText(customEventsWithBreakdown.expected.total)
- })
- })
-
- test('View data as Number chart, cumulative line, and table', async ({ page }) => {
- const insight = new InsightPage(page)
- await insight.goToNewTrends()
- await insight.trends.waitForChart()
-
- await test.step('cumulative line chart shows total in details table', async () => {
- await insight.trends.selectChartType(/^Line chart \(cumulative\)/)
- await insight.trends.expectTotals([pageviews.expected.total])
- })
-
- await test.step('Number chart shows bold number = 38', async () => {
- await insight.trends.selectChartType(/^Number/)
- await expect(insight.trends.boldNumber).toBeVisible()
- await expect(insight.trends.boldNumber).toContainText(pageviews.expected.total)
- })
-
- await test.step('enable comparison and verify no NaN', async () => {
- await insight.trends.selectComparison('Compare to previous period')
- await expect(insight.trends.boldNumberComparison).toBeVisible()
- const comparisonText = await insight.trends.boldNumberComparison.textContent()
- expect(comparisonText).not.toContain('NaN')
- expect(comparisonText).not.toContain('undefined')
- })
- })
-
- test('Filter by date range and verify totals change', async ({ page }) => {
- const insight = new InsightPage(page)
- await insight.goToNewTrends()
- await insight.trends.waitForChart()
-
- await test.step('Last 7 days shows total = 38', async () => {
- await insight.trends.expectTotals([pageviews.expected.total])
- })
-
- await test.step('Last 24 hours shows total = 2', async () => {
- await insight.trends.selectDateRange('Last 24 hours')
- await insight.trends.expectTotals(['2'])
- })
-
- await test.step('enable comparison and verify no NaN', async () => {
- await insight.trends.selectComparison('Compare to previous period')
- await expect(insight.trends.comparisonButton).toContainText('Previous period')
- await insight.trends.waitForDetailsTable()
- const tableText = await insight.trends.detailsTable.textContent()
- expect(tableText).not.toContain('NaN')
- })
-
- await test.step('disable comparison', async () => {
- await insight.trends.selectComparison('No comparison between periods')
- await expect(insight.trends.comparisonButton).toContainText('No comparison')
- })
- })
-
- test('Break down custom events by browser and verify per-browser totals', async ({ page }) => {
- const insight = new InsightPage(page)
- await insight.goToNewTrends()
- await insight.trends.waitForChart()
-
- await test.step('add Browser breakdown and switch to custom event', async () => {
- await insight.trends.addBreakdown('Browser')
- await insight.trends.waitForChart()
- await insight.trends.selectEvent(0, customEventsWithBreakdown.eventName)
- await insight.trends.waitForChart()
- await insight.trends.waitForDetailsTable()
- })
-
- await test.step('verify Chrome = 5 and Firefox = 3', async () => {
- await insight.trends.expectRowTotal('Chrome', customEventsWithBreakdown.expected.chromeCount)
- await insight.trends.expectRowTotal('Firefox', customEventsWithBreakdown.expected.firefoxCount)
- })
-
- await test.step('remove breakdown and verify single total returns', async () => {
- await insight.trends.removeBreakdown()
- await insight.trends.waitForChart()
- await insight.trends.expectTotals([customEventsWithBreakdown.expected.total])
- })
- })
-
- test('Combine two series with a formula and verify computed total', async ({ page }) => {
- const insight = new InsightPage(page)
-
- await test.step('add pageview and custom event as two series', async () => {
- await insight.goToNewTrends()
- await insight.trends.waitForChart()
- await insight.trends.addSeries()
- await insight.trends.selectEvent(1, customEventsWithBreakdown.eventName)
- await insight.trends.waitForChart()
- })
-
- await test.step('enable formula A + B and verify computed total', async () => {
- await insight.trends.setFormula('A + B')
- await insight.trends.waitForChart()
- await insight.trends.expectTotals(['46'])
- })
-
- await test.step('disable formula mode and verify both series return', async () => {
- await insight.trends.formulaSwitch.click()
- await expect(insight.trends.formulaInput).not.toBeVisible()
- await expect(insight.trends.firstSeries).toBeVisible()
- await expect(insight.trends.secondSeries).toBeVisible()
- })
- })
-
- test('Display negative values and formatted numbers correctly in details table', async ({ page }) => {
- const insight = new InsightPage(page)
-
- await test.step('set up custom event with browser breakdown and property sum', async () => {
- await insight.goToNewTrends()
- await insight.trends.waitForChart()
- await insight.trends.addBreakdown('Browser')
- await insight.trends.waitForChart()
- await insight.trends.selectEvent(0, customEventsWithBreakdown.eventName)
- await insight.trends.waitForChart()
- await insight.trends.selectMathWithAggregation(0, /property value/, 'sum')
- await insight.trends.selectMathProperty('amount')
- await insight.trends.waitForDetailsTable()
- })
-
- await test.step('verify Chrome row totals 50 and Firefox row totals -15', async () => {
- const rows = insight.trends.detailsTable.locator('tbody tr')
- const chromeRow = rows.filter({ hasText: 'Chrome' })
- const firefoxRow = rows.filter({ hasText: 'Firefox' })
- await expect(chromeRow).toContainText(customEventsWithBreakdown.expected.chromeAmountSum)
- await expect(firefoxRow).toContainText(customEventsWithBreakdown.expected.firefoxAmountSum)
- })
-
- await test.step('remove the breakdown, switch to Number chart and verify bold number shows net sum of 35', async () => {
- await insight.trends.removeBreakdown()
- await insight.trends.waitForChart()
- await insight.trends.selectChartType(/^Number/)
- await expect(insight.trends.boldNumber).toContainText(customEventsWithBreakdown.expected.amountSum)
- })
-
- await test.step('switch to line chart and set axis format to Percentage to verify % in details', async () => {
- await insight.trends.selectChartType(/^Line chart(?! \()/)
- await insight.trends.waitForDetailsTable()
- await insight.trends.openOptionsPanel()
- const formatPicker = page.getByTestId('chart-aggregation-axis-format')
- await formatPicker.waitFor({ state: 'visible' })
- await formatPicker.click()
- await page.getByRole('button', { name: 'Percent (0-100)' }).click()
- await page.keyboard.press('Escape')
- await expect(insight.trends.detailsTable).toContainText('35%')
- await expect(insight.trends.detailsTable).toContainText('50%')
- await expect(insight.trends.detailsTable).toContainText('-15%')
- })
-
- await test.step('set axis format back to None and verify formatting is removed', async () => {
- await insight.trends.openOptionsPanel()
- const formatPicker = page.getByTestId('chart-aggregation-axis-format')
- await formatPicker.waitFor({ state: 'visible' })
- await formatPicker.click()
- await page.getByRole('button', { name: 'None' }).click()
- await page.keyboard.press('Escape')
- await expect(insight.trends.detailsTable).not.toContainText('35%')
- })
- })
-
test('Hover chart to see tooltip with data point values', async ({ page }) => {
const insight = new InsightPage(page)
diff --git a/playwright/e2e/product-analytics/notebooks.spec.ts b/playwright/e2e/product-analytics/notebooks.spec.ts
index 534b18e047b8..55dfc45220ef 100644
--- a/playwright/e2e/product-analytics/notebooks.spec.ts
+++ b/playwright/e2e/product-analytics/notebooks.spec.ts
@@ -1,30 +1,9 @@
-import { InsightPage } from '../../page-models/insightPage'
import { NotebookPage } from '../../page-models/notebookPage'
import { randomString } from '../../utils'
-import { createEvent, daysAgo } from '../../utils/event-data'
-import { PlaywrightSetupEvent } from '../../utils/playwright-setup'
import { pageviews } from '../../utils/test-data'
import { PlaywrightWorkspaceSetupResult, expect, test } from '../../utils/workspace-test-base'
-const STEP_1 = 'funnel_step_one'
-const STEP_2 = 'funnel_step_two'
-const STEP_3 = 'funnel_step_three'
-
-function generateFunnelEvents(): PlaywrightSetupEvent[] {
- const chromeUsers = (n: number): string => `chrome-user-${n}`
- const firefoxUsers = (n: number): string => `firefox-user-${n + 10}`
- const chrome = { $browser: 'Chrome' }
- const firefox = { $browser: 'Firefox' }
-
- return [
- ...createEvent({ event: STEP_1, user: chromeUsers, timestamp: daysAgo(5), properties: chrome }).repeat(10),
- ...createEvent({ event: STEP_1, user: firefoxUsers, timestamp: daysAgo(5), properties: firefox }).repeat(10),
- ...createEvent({ event: STEP_2, user: chromeUsers, timestamp: daysAgo(4), properties: chrome }).repeat(10),
- ...createEvent({ event: STEP_3, user: chromeUsers, timestamp: daysAgo(3), properties: chrome }).repeat(5),
- ]
-}
-
-const events = [...pageviews.events, ...generateFunnelEvents()]
+const events = pageviews.events
test.describe('Notebooks', () => {
let workspace: PlaywrightWorkspaceSetupResult | null = null
@@ -80,45 +59,6 @@ test.describe('Notebooks', () => {
})
})
- test('Add a funnel insight, configure steps, and verify conversion rates', async ({ page }) => {
- const notebook = new NotebookPage(page)
- const insight = new InsightPage(page)
- const notebookName = randomString('nb-funnels')
-
- await test.step('create a notebook and add a Funnel insight', async () => {
- await notebook.createNew(notebookName)
- await notebook.addInsightViaSlashCommand('Funnel')
- await expect(notebook.insightNodes).toHaveCount(1)
- })
-
- await test.step('expand the insight and configure 3 funnel steps', async () => {
- await notebook.expandInsightNode(0)
-
- await insight.funnels.selectStepEvent(0, STEP_1)
- await page.getByRole('button', { name: 'Add step' }).click()
- await page.keyboard.press('Escape')
- await insight.funnels.selectStepEvent(1, STEP_2)
- await page.getByRole('button', { name: 'Add step' }).click()
- await page.keyboard.press('Escape')
- await insight.funnels.selectStepEvent(2, STEP_3)
- await insight.funnels.waitForChart()
- })
-
- await test.step('verify step counts: 20 → 10 → 5 and conversion rates', async () => {
- const step1 = insight.funnels.stepLegend(0)
- await expect(step1).toContainText('20')
- await expect(step1).toContainText(STEP_1)
-
- const step2 = insight.funnels.stepLegend(1)
- await expect(step2).toContainText('10')
- await expect(insight.funnels.stepValueLabel(1)).toContainText('50')
-
- const step3 = insight.funnels.stepLegend(2)
- await expect(step3).toContainText('5')
- await expect(insight.funnels.stepValueLabel(2)).toContainText('25')
- })
- })
-
test('Remove an insight from a notebook and verify text persists', async ({ page }) => {
const notebook = new NotebookPage(page)
const notebookName = randomString('nb-remove')
diff --git a/playwright/utils/test-data.ts b/playwright/utils/test-data.ts
index 1abb4536f82e..5a63f995e511 100644
--- a/playwright/utils/test-data.ts
+++ b/playwright/utils/test-data.ts
@@ -6,9 +6,9 @@
* or recalculating expected totals.
*
* Usage:
- * import { pageviews, customEventsWithBreakdown } from '../../utils/test-data'
+ * import { pageviews, personsWithIdentity } from '../../utils/test-data'
*
- * const events = [...pageviews.events, ...customEventsWithBreakdown.events]
+ * const events = [...pageviews.events, ...personsWithIdentity.events]
* // then pass to createWorkspace({ events })
* // and assert with e.g. pageviews.expected.total
*/
@@ -16,7 +16,6 @@
import { createEvent, daysAgo, hoursAgo } from './event-data'
const pvUser = (n: number): string => `pv-user-${n}`
-const customUser = (n: number): string => `custom-user-${n}`
/**
* Two persons with known identities and person properties (via $set).
@@ -100,40 +99,6 @@ export const pageviews = {
},
}
-/**
- * Custom events split across two browsers with positive/negative amounts.
- * - Chrome: 5 events with amount=10 each (sum=50)
- * - Firefox: 3 events with amount=-5 each (sum=-15)
- * Users overlap: custom-user-0..4 for Chrome, custom-user-0..2 for Firefox,
- * so unique users = 5.
- */
-export const customEventsWithBreakdown = {
- eventName: 'custom_test_event',
- events: [
- ...createEvent({
- event: 'custom_test_event',
- user: customUser,
- timestamp: daysAgo(3),
- properties: { $browser: 'Chrome', amount: 10 },
- }).repeat(5),
- ...createEvent({
- event: 'custom_test_event',
- user: customUser,
- timestamp: daysAgo(2),
- properties: { $browser: 'Firefox', amount: -5 },
- }).repeat(3),
- ],
- expected: {
- total: '8',
- uniqueUsers: '5',
- chromeCount: '5',
- firefoxCount: '3',
- amountSum: '35',
- chromeAmountSum: '50',
- firefoxAmountSum: '-15',
- },
-}
-
/**
* Stickiness-specific pageview data: 10 users with known day-activity patterns.
*
@@ -171,58 +136,6 @@ export const stickinessPageviews = {
},
}
-/**
- * Stickiness custom events with browser breakdown.
- *
- * - 2 Chrome users (sticky-chrome-0..1): active on 3 days → Day 3
- * - 3 Firefox users (sticky-firefox-0..2): active on 1 day → Day 1
- *
- * Without breakdown (5 total):
- * Day 1: 3 users, Day 3: 2 users
- * With breakdown by $browser:
- * Chrome: Day 3 = 2 users
- * Firefox: Day 1 = 3 users
- */
-const stickyChromeUser = (n: number): string => `sticky-chrome-${n}`
-const stickyFirefoxUser = (n: number): string => `sticky-firefox-${n}`
-
-export const stickinessWithBreakdown = {
- eventName: 'sticky_test_event',
- events: [
- // Chrome users (2): active on 3 distinct days (daysAgo 0, 2, 4)
- ...createEvent({
- event: 'sticky_test_event',
- user: stickyChromeUser,
- timestamp: daysAgo(0),
- properties: { $browser: 'Chrome' },
- }).repeat(2),
- ...createEvent({
- event: 'sticky_test_event',
- user: stickyChromeUser,
- timestamp: daysAgo(2),
- properties: { $browser: 'Chrome' },
- }).repeat(2),
- ...createEvent({
- event: 'sticky_test_event',
- user: stickyChromeUser,
- timestamp: daysAgo(4),
- properties: { $browser: 'Chrome' },
- }).repeat(2),
- // Firefox users (3): active on 1 day only (daysAgo 1)
- ...createEvent({
- event: 'sticky_test_event',
- user: stickyFirefoxUser,
- timestamp: daysAgo(1),
- properties: { $browser: 'Firefox' },
- }).repeat(3),
- ],
- expected: {
- day1: { users: 3, percent: 60 },
- day2: { users: 0, percent: 0 },
- day3: { users: 2, percent: 40 },
- },
-}
-
/**
* Pageview events with different URLs to produce paths data.
* 8 users land on /, all 8 go to /docs, 5 continue to /pricing, 3 to /signup.
@@ -278,37 +191,3 @@ export const sequentialPageviews = {
],
},
}
-
-const ceUser = (n: number): string => `ce-user-${n}`
-
-/**
- * Sequential custom events with decreasing user counts:
- * button_click (7) → form_submit (7) → checkout (4).
- * Uses separate users (ce-user-*) so pageview data doesn't interfere.
- */
-export const sequentialCustomEvents = {
- events: [
- ...createEvent({
- event: 'button_click',
- user: ceUser,
- timestamp: () => minutesAfterDaysAgo(2, 10),
- }).repeat(7),
- ...createEvent({
- event: 'form_submit',
- user: ceUser,
- timestamp: () => minutesAfterDaysAgo(2, 11),
- }).repeat(7),
- ...createEvent({
- event: 'checkout',
- user: ceUser,
- timestamp: () => minutesAfterDaysAgo(2, 12),
- }).repeat(4),
- ],
- expected: {
- nodes: [
- { name: 'button_click', count: 7 },
- { name: 'form_submit', count: 7 },
- { name: 'checkout', count: 4 },
- ],
- },
-}