Skip to content

🔥 remove _generateActivity and clean up e2e infrastructure#90

Merged
bcaudan merged 7 commits into
mainfrom
bcaudan/cleanup-generate-activity
Apr 21, 2026
Merged

🔥 remove _generateActivity and clean up e2e infrastructure#90
bcaudan merged 7 commits into
mainfrom
bcaudan/cleanup-generate-activity

Conversation

@bcaudan

@bcaudan bcaudan commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

Motivation

_generateActivity() was a test escape hatch that directly emitted END_USER_ACTIVITY, bypassing the real user-activity pipeline. Removing it forces tests to use a real DOM click tracked by browser-sdk, flowing through the full DatadogEventBridge → BridgeHandler → UserActivityTracker → END_USER_ACTIVITY chain for genuine end-to-end coverage.

The removal also prompted a naming cleanup: e2e files previously conflated "renderer process" (Electron concept) with "bridge window" (test concept).

Changes

  • Remove _generateActivity from the SDK public API and all consumer code (playground, e2e app)
  • Rename e2e app files and page objects to main-window / bridge-window for clearer semantics
  • Extract BridgeWindowPage page object with static factory methods to open and await bridge windows
  • Add rumBrowserSdk Playwright fixture option to opt in to browser-sdk per test describe block

Test instructions

yarn test:e2e:init  # rebuild SDK + e2e app
yarn test:e2e       # run full Playwright suite

Checklist

  • Tested locally (playground)
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated related documentation.

@bcaudan bcaudan force-pushed the bcaudan/cleanup-generate-activity branch from 23a5c31 to 40a2a99 Compare April 8, 2026 16:21
@bcaudan bcaudan force-pushed the bcaudan/cleanup-generate-activity branch from 40a2a99 to 66a28fe Compare April 8, 2026 16:22
@bcaudan

bcaudan commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

bcaudan added 3 commits April 9, 2026 09:27
- preload exposes DD_E2E_RUM_BROWSER_SDK env var as window.e2eConfig.rumBrowserSdk
- main-window.ts conditionally inits browser-sdk with trackUserInteractions: true
- rumBrowserSdk Playwright fixture (null by default) passes config via env var
- waitForEventCount / getEventsByType accept optional predicate for scoped assertions
- tests using renewSession() wrap with test.use({ rumBrowserSdk: {} })
@bcaudan bcaudan force-pushed the bcaudan/cleanup-generate-activity branch from 66a28fe to 229dac9 Compare April 9, 2026 07:27
@bcaudan bcaudan marked this pull request as ready for review April 9, 2026 07:27
@bcaudan bcaudan requested a review from a team as a code owner April 9, 2026 07:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 229dac9f13

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread e2e/lib/helpers.ts
@bcaudan bcaudan merged commit 42668a8 into main Apr 21, 2026
14 checks passed
@bcaudan bcaudan deleted the bcaudan/cleanup-generate-activity branch April 21, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants