testing

This guide covers testing practices and patterns for the DuckDuckGo browser on iOS and macOS platforms.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/duckduckgo/apple-browsers/testing
Clone the repo
git clone --depth 1 https://github.com/duckduckgo/apple-browsers

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 12,248 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.12248
Opus 5 $0.00000 $0.06124
Sonnet 5 $0.00000 $0.02450
Haiku 4.5 $0.00000 $0.01225

Measured yesterday against content hash 7f59f51ed055, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

testing scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo cp com.apple.system.logging.plist /Library/Preferences/Logging/com.apple.system.logging.plist

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

let retrievedBookmark = bookmarkStore.fetch(by: bookmark.id)
.cursor/rules/testing.mdc · 1,681 lines

How it starts

The opening of the file, as written. The whole thing — 1,681 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing Guidelines & Best Practices

This guide covers testing practices and patterns for the DuckDuckGo browser on iOS and macOS platforms.

🚨 MANDATORY: Testing Execution Rules

NEVER Run Tests Without Permission

NEVER execute any test commands without EXPLICIT user permission or unles user explicitly asked to in their prompt.

Required Testing Workflow:
  1. Write or modify test code as requested
  2. if user did not ask to run tests in their prompt, STOP before running any test commands:
    • swift test
    • npm test
    • xcodebuild test
    • fastlane test
    • Any other test execution commands
  3. ASK the user: "Should I run the tests?"
  4. WAIT for explicit permission (e.g., "yes", "run tests", "test it")
  5. Only then execute test commands

This rule applies to ALL test execution - unit tests, integration tests, UI tests, performance tests, etc.


Future Improvements

This guide is a living document. Consider these areas for future improvements:

  • Tab Extensions Testing: Expand patterns for testing complex tab extension interactions and lifecycle management
  • WebKit Integration Testing: Add comprehensive patterns for testing WKWebView configurations, user scripts, and content blocking integration
  • Privacy Feature Testing: Develop specialized testing approaches for tracker protection, HTTPS upgrade, and content blocking rule validation
  • Cross-Platform Testing: Create patterns for testing SharedPackages functionality across iOS and macOS with consistent behavior validation
  • Fire Button Integration Testing: Add comprehensive testing patterns for data clearing workflows across all browser components
  • Autofill and Credential Testing: Expand testing approaches for AutofillCredentialProvider, password management, and form filling scenarios
  • Sync Testing: Develop patterns for testing bookmark sync, conflict resolution, and cross-device data consistency
  • AI Chat Integration Testing: Add testing patterns for AI chat functionality, context management, and user interaction flows
  • Feature Flag Testing: Expand MockFeatureFlagger usage patterns and integration testing with real feature configurations

Read the full file on GitHub · 1,681 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 1,681 lines · 0 tokens per session scan B 7f59f51ed055

Subscribe to this mod's changes

testing is a cursor rule published in the GitHub repository duckduckgo/apple-browsers (252 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 12,248 tokens. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.