Skip to content

docs: split Lambda Hooks into Common / Selenium-only / Playwright-only sections - #3315

Open
SahilSawLT wants to merge 3 commits into
LambdaTest:testmuComfrom
SahilSawLT:restructure-lambda-hooks
Open

docs: split Lambda Hooks into Common / Selenium-only / Playwright-only sections#3315
SahilSawLT wants to merge 3 commits into
LambdaTest:testmuComfrom
SahilSawLT:restructure-lambda-hooks

Conversation

@SahilSawLT

@SahilSawLT SahilSawLT commented Jul 29, 2026

Copy link
Copy Markdown

Why

The Lambda Hooks page (https://www.testmuai.com/support/docs/lambda-hooks/) lists every hook in one flat table, with all examples in Selenium JavascriptExecutor syntax and no indication of which frameworks support which hook. Playwright users can't tell which hooks apply to them or how to invoke them (the Playwright syntax — page.evaluate with a lambdatest_action payload — is completely different), and several Playwright-only hooks weren't documented at all.

What changed

Reorganized the page into three sections. The classification comes from tracing the hub proxy's actual hook dispatch code for each engine (the Selenium JavascriptExecutor hook list + handlers, and the CDP lambdatest_action dispatch), not just constant definitions:

  • Common (Selenium & Playwright) — a capability matrix showing the per-framework hook names and syntax side by side: set test status (lambda-status / setTestStatus), test-case grouping (lambda-testCase-start/end — string form in Selenium, action form in Playwright), lambdaUpdateName, lambda-unbound-ping
  • Selenium-only — the remaining 19 existing hooks (file checks, files-delete, name/build, action, keyboard events, breakpoint, screenshot, throttle, ping, exceptions, clipboard, lambda:network, test-tags); these are not dispatched on the Playwright/CDP path
  • Playwright-onlygetTestDetails, lambdaSetBrowserPosition, lighthouseReport (with a note that Selenium gets Lighthouse automatically via the performance capability) — previously undocumented here

Also:

  • New "How Lambda Hooks are invoked" section showing both syntaxes (the Playwright example matches the one already used in docs/playwright-testing.md)
  • Fixed hook-name typos: underscore display names (lambda_breakpoint, …) → the actual hyphenated hook strings; lambda-network-throttlelambda-throttle-network (the string the grid actually matches)
  • Title/description generalized from "for Selenium Automation" to "for Automation Testing" (id/slug/canonical unchanged)

Existing table rows/examples were preserved verbatim wherever they only moved sections. The test-case grouping and setTestStatus Playwright examples are verified end-to-end (dashboard annotations render from them).

🤖 Generated with Claude Code

SahilSawLT and others added 3 commits July 29, 2026 17:47
…y sections

The page listed all hooks in one table with Selenium-only examples and no
framework applicability. Reorganized per hook support in the hub proxy's
two hook engines (Selenium JavascriptExecutor strings vs the CDP
lambdatest_action pattern), documented the Playwright invocation syntax,
added the previously-undocumented Playwright-only hooks (setTestStatus,
lambda-testCase-start/end, getTestDetails), and fixed hook-name typos
(underscores -> actual hyphenated names, lambda-network-throttle ->
lambda-throttle-network).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Traced the actual dispatch code (ML_LAMBDA_HOOKS + proxy.go handlers for
Selenium; the cdp/proxy.go lambdatest_action dispatch for Playwright)
instead of the constants files — many CDP hook constants are defined but
never dispatched. Corrections:

- lambda-testCase-start/end is COMMON (Selenium string form handled in
  proxy.go), not Playwright-only
- most previously-'common' hooks (file checks, clipboard, ping, throttle,
  breakpoint, screenshot, keyboard-events, exceptions, name, build) are
  Selenium-only: their CDP constants have zero dispatch references
- Common section rewritten as a capability matrix with the per-framework
  hook names (lambda-status vs setTestStatus, etc.)
- lighthouseReport note: Selenium gets Lighthouse via the performance
  capability automatically, not via a hook

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ia lambdatest_executor

Third Selenium dispatch family found in proxy_ml.go: lambdatest_executor
JSON payloads handle lambda-heal-start/stop (also plain-string on the RD
path), lighthouseReport, and lambda-accessibility-scan — so lighthouse and
accessibility-scan move to Common, and auto-heal (Selenium-only; the CDP
path has no heal action) joins the Selenium table linking to the dedicated
autoheal-with-hooks page.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant