Catalog
fauziyasin-s2m4qw/devtools-testing-guidance

fauziyasin-s2m4qw

devtools-testing-guidance

Guidance on selecting the appropriate test suite (Unit, API, or E2E tests) when writing new tests in Chrome DevTools. MUST be used when writing new tests.

v1.0LATEST
NewUpdated Oct 20, 2026

Testing Guidance

This guide outlines when and how to select the appropriate test suite when writing new tests in Chrome DevTools.

[!NOTE] This skill provides guidance on which test suite to choose when writing tests. To learn how to run tests, build targets, or execute linters, refer to the devtools-verification skill.

Choosing a Test Suite

1. Unit Tests

Default choice: The vast majority of tests in DevTools should be unit tests.

Use unit tests for isolated testing of individual functions, classes, models, helpers, and UI components.

  • Utilities & Framework:
    • Use TestUniverse (and foundation test helpers) for easy, isolated setup of required dependencies and models.
    • For testing UI widgets, use stubbed view functions and screenshot assertions rather than spinning up heavy DOM/browser infrastructure.
  • Location: Co-located next to their implementation files (e.g. TimelinePanel.ts and TimelinePanel.test.ts).
  • Test functions: import describe, it, beforeEach, etc. from mocha (e.g. import {describe, it} from 'mocha';). They are not available as globals.
  • BUILD.gn: test file should be added to devtools_ui_module("unittests") or devtools_foundation_module("foundation_unittests") target in the corresponding BUILD.gn file.

2. API Tests

Use API tests for integration tests that verify business logic requiring more complex setups or extensive CDP (Chrome DevTools Protocol) traffic, without needing the full DevTools frontend UI.

  • When to use:
    • Evaluating JavaScript expressions in the target page (e.g. via Runtime.evaluate).
    • Complex source map setups and symbolization.
    • Multi-context or target setups (workers, iframes, OOPIFs).
    • Tests that require extensive CDP mock setup.
    • Verifying the "foundational layer" of DevTools models against a real browser/web page.
  • Location: Defined in front_end/ with .test.api.ts extension (e.g. Universe.test.api.ts).
  • Test functions: import describe, it and setup from test/api/mocha-interface.ts. They are not available as globals.
  • BUILD.gn: test file should be added to devtools_api_test_module("api_tests") target in the corresponding BUILD.gn file, which needs test/api in its ts_deps.

3. End-to-End (E2E) Tests

Use E2E tests to verify real end-to-end user stories and user journeys.

  • When to use:
    • Verifying full user journeys across DevTools panels and drawers.
    • Complex UI behaviors that require extensive user interaction setup and benefit from a complete DevTools frontend page connected to an inspected target page over CDP.
  • Location: Defined in test/e2e/ (e.g. test/e2e/console/console-log.test.ts).
  • Test functions: import describe, it and setup from test/e2e/conductor/mocha-interface.ts (e.g. import {describe, it} from '../conductor/mocha-interface.js';). They are not available as globals.
  • BUILD.gn: test file should be added to the node_ts_library target in the corresponding BUILD.gn file, which needs "../conductor:implementation" in its ts_deps. And node_ts_library in test/e2e/BUILD.gn for its dependencies.

Overall Score

88/100

Grade

A

Excellent

Grades are signals, not a certification. Always review a skill yourself before use.

Safety

92

Quality

87

Clarity

89

Completeness

83

Summary

A guidance skill that instructs developers on choosing between Unit, API, and E2E test suites when writing new tests in Chrome DevTools. It provides clear decision criteria, location conventions, import patterns, and BUILD.gn configuration for each test type, helping developers select the appropriate testing strategy based on their validation needs.

Detected Capabilities

documentation readingdecision guidanceproject configuration

Trigger Keywords

Phrases that agents use to match this skill to user intent.

write unit testschoose test suitedevtools api testse2e test setuptest selection guidance

Use Cases

  • Determine whether to write a unit, API, or E2E test for new DevTools functionality
  • Set up test file locations and imports correctly for each test suite type
  • Configure BUILD.gn targets for different test suite types
  • Understand when API tests are needed versus lighter unit tests
  • Plan comprehensive test coverage for complex DevTools features involving UI and CDP interactions

Quality Notes

  • Excellent use of hierarchical structure with three clear test suite categories
  • Each section includes consistent subsections: When to use, Location, Test functions, and BUILD.gn configuration
  • Practical examples provided for all categories (TimelinePanel, Universe, console-log)
  • Clear guidance on import sources and that test functions are not available as globals (common DevTools pitfall)
  • Explicit reference to complementary skill (devtools-verification) prevents scope creep
  • Helpful note callout clarifies the boundary between this skill (which test) and build/execution skills (how to run)
  • Detailed decision criteria for when API tests are necessary — includes specific examples (JavaScript evaluation, CDP mocking, multi-context setups)
Model: claude-haiku-4-5-20251001Analyzed: Oct 20, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Use fauziyasin-s2m4qw/devtools-testing-guidance in your dev environment

Command Palette

Search for a command to run...