agentleFS
MathiasPaulenkoMathiasPaulenko/ai-toolkit/skills/wavexis-network-testing/SKILL.md

WaveXis Network Testing

Skill2 starsChanged 4 months agoMITView on GitHub

Network testing with wavexis. HAR capture, request interception, response mocking, network throttling, WebSocket inspection, request modification.

  • Installs packages

The file

Files
SKILL.md

WaveXis Network Testing

Description

Network testing with wavexis — capture HAR files, intercept and mock requests/responses, modify in-flight traffic, simulate network conditions, inspect WebSocket frames, and replay captured HAR files.

When to Invoke

  • Capturing HAR files for network analysis
  • Intercepting or mocking API requests
  • Modifying request headers or response bodies in-flight
  • Simulating slow or unreliable network conditions
  • Inspecting WebSocket traffic
  • Replaying captured HAR files for testing

Prerequisites

  • pip install wavexis[cdp]
  • Chrome or Edge installed
  • Basic familiarity with wavexis CLI (see wavexis-cli-automation skill)

HAR Capture

har command

Capture all network traffic during page load as a HAR (HTTP Archive) file:

wavexis har https://example.com --output traffic.har

HAR with interaction

wavexis har https://example.com \
    --click "#load-more" \
    --wait-for ".results" \
    --output traffic.har

HAR with filter

# Only capture API requests
wavexis har https://example.com \
    --url-filter "*/api/*" \
    --output api-traffic.har

HAR options

OptionTypeDefaultDescription
--outputstrstdoutOutput HAR file path
--url-filterstrNoneOnly capture matching URLs (regex)
--method-filterstrNoneOnly capture matching methods (GET, POST, etc.)
--resource-typestrNoneFilter by type: xhr, fetch, script, stylesheet, image, document
--include-bodiesflagoffInclude request/response bodies in HAR
--clickstrNoneClick selector after navigation
--inputstrNoneType into selector after navigation
--wait-forstrNoneWait for selector before stopping capture
--timeoutint30000Capture timeout in ms

HAR output format

The output is a standard HAR 1.2 file:

{
  "log": {
    "version": "1.2",
    "creator": {
      "name": "wavexis",
      "version": "1.0.0"
    },
    "entries": [
      {
        "request": {
          "method": "GET",
          "url": "https://example.com/api/data",
          "headers": [...],
          "queryString": [...],
          "bodySize": 0
        },
        "response": {
          "status": 200,
          "statusText": "OK",
          "headers": [...],
          "content": {
            "size": 1024,
            "mimeType": "application/json"
          },
          "bodySize": 1024
        },
        "timings": {
          "blocked": 0,
          "dns": 5,
          "connect": 20,
          "send": 1,
          "wait": 45,
          "receive": 10
        },
        "time": 81
      }
    ]
  }
}

Request Interception

intercept command

Block or allow requests matching a pattern:

wavexis intercept https://example.com \
    --block "*/ads/*" \
    --block "*/tracker.js" \
    --output result.json

intercept with allow

wavexis intercept https://example.com \
    --block "*/ads/*" \
    --allow "*/api/*" \
    --output result.json

intercept options

OptionTypeDefaultDescription
--blockstrNoneURL pattern to block (can repeat)
--allowstrNoneURL pattern to allow (overrides block)
--resource-typestrNoneBlock by resource type
--outputstrstdoutOutput file path
--wait-forstrNoneWait for selector before stopping
--timeoutint30000Timeout in ms

intercept output

{
  "blocked": [
    "https://ads.example.com/banner.js",
    "https://tracker.example.com/analytics.js"
  ],
  "allowed": [
    "https://api.example.com/data"
  ],
  "total_blocked": 2,
  "total_allowed": 1
}

Response Mocking

mock command

Mock API responses with custom status, headers, and body:

wavexis mock https://example.com \
    --url "*/api/users" \
    --status 200 \
    --body '{"users": []}' \
    --content-type "application/json" \
    --output result.json

mock with file

wavexis mock https://example.com \
    --url "*/api/products" \
    --status 200 \
    --body-file ./mocks/products.json \
    --content-type "application/json" \
    --output result.json

mock with delay

wavexis mock https://example.com \
    --url "*/api/slow" \
    --status 200 \
    --body '{"data": "delayed"}' \
    --delay 3000 \
    --output result.json

mock multiple endpoints

wavexis mock https://example.com \
    --mock '*/api/users:200:{"users": []}' \
    --mock '*/api/products:200:{"products": []}' \
    --mock '*/api/error:500:{"error": "Internal"}' \
    --output result.json

mock options

OptionTypeDefaultDescription
--urlstrNoneURL pattern to mock
--statusint200HTTP status code
--bodystrNoneResponse body string
--body-filestrNoneResponse body from file
--content-typestrapplication/jsonContent-Type header
--headerstrNoneAdditional response header (can repeat)
--delayint0Response delay in ms
--mockstrNoneShorthand: url:status:body (can repeat)
--outputstrstdoutOutput file path
--timeoutint30000Timeout in ms

In-Flight Modification

modify command

Modify request headers or URLs before they reach the server:

wavexis modify https://example.com \
    --set-header "Authorization: Bearer token123" \
    --set-header "X-Custom: value" \
    --output result.json

modify URL

wavexis modify https://example.com \
    --rewrite-url "*/staging/*->*/production/*" \
    --output result.json

modify-response command

Modify response headers or body before the browser receives them:

wavexis modify-response https://example.com \
    --url "*/api/config" \
    --set-header "X-Modified: true" \
    --output result.json

modify options

OptionTypeDefaultDescription
--set-headerstrNoneSet request header (can repeat)
--remove-headerstrNoneRemove request header (can repeat)
--rewrite-urlstrNoneRewrite URL pattern: from->to
--urlstrNoneURL pattern to match for modifications
--outputstrstdoutOutput file path
--timeoutint30000Timeout in ms

Network Throttling

throttle command

Simulate slow or unreliable network conditions:

wavexis throttle https://example.com \
    --profile slow-3g \
    --output result.json

throttle with CWV

wavexis throttle https://example.com \
    --profile slow-3g \
    --cwv \
    --output cwv-throttled.json

throttle profiles

ProfileDownloadUploadLatencyDescription
no-throttling———No throttling
fast-4g4 Mbps3 Mbps20 msFast 4G
slow-4g1.5 Mbps750 kbps40 msSlow 4G
fast-3g780 kbps330 kbps150 msFast 3G
slow-3g400 kbps400 kbps400 msSlow 3G
offline00—Offline

custom throttle

wavexis throttle https://example.com \
    --download 500000 \
    --upload 250000 \
    --latency 300 \
    --output result.json

throttle options

OptionTypeDefaultDescription
--profilestrslow-3gThrottle profile name
--downloadintNoneCustom download speed in bytes/s
--uploadintNoneCustom upload speed in bytes/s
--latencyintNoneCustom latency in ms
--cwvflagoffMeasure CWV under throttling
--outputstrstdoutOutput file path
--timeoutint60000Timeout in ms (longer for slow profiles)

Network Inspection

inspect command

Inspect all network requests during page load:

wavexis inspect https://example.com --output network.json

inspect with filter

wavexis inspect https://example.com \
    --url-filter "*/api/*" \
    --method "POST" \
    --output api-calls.json

inspect output

{
  "requests": [
    {
      "url": "https://api.example.com/data",
      "method": "GET",
      "resource_type": "fetch",
      "status": 200,
      "status_text": "OK",
      "mime_type": "application/json",
      "encoded_size": 512,
      "decoded_size": 1024,
      "time": 45,
      "protocol": "h2",
      "from_cache": false,
      "from_service_worker": false
    }
  ],
  "total_requests": 1,
  "total_size": 1024,
  "total_time": 45
}

inspect options

OptionTypeDefaultDescription
--url-filterstrNoneURL pattern filter (regex)
--methodstrNoneHTTP method filter
--resource-typestrNoneResource type filter
--statusintNoneStatus code filter
--include-bodiesflagoffInclude request/response bodies
--outputstrstdoutOutput file path
--wait-forstrNoneWait for selector before stopping
--timeoutint30000Timeout in ms

HAR Replay

har-replay command

Replay a captured HAR file against a target URL:

wavexis har-replay ./traffic.har --target https://staging.example.com

har-replay with verification

wavexis har-replay ./traffic.har \
    --target https://staging.example.com \
    --verify \
    --output replay-results.json

har-replay options

OptionTypeDefaultDescription
--targetstrrequiredTarget URL to replay against
--verifyflagoffCompare responses with original HAR
--delayint0Delay between requests in ms
--url-filterstrNoneOnly replay matching URLs
--outputstrstdoutOutput file path
--timeoutint60000Timeout in ms

WebSocket Inspection

WebSocket frame capture

wavexis inspect https://example.com \
    --websocket \
    --output ws-traffic.json

WebSocket output

{
  "websockets": [
    {
      "url": "wss://example.com/ws",
      "frames": [
        {
          "direction": "send",
          "data": "{\"type\": \"subscribe\", \"channel\": \"updates\"}",
          "timestamp": 1234567890
        },
        {
          "direction": "receive",
          "data": "{\"type\": \"update\", \"data\": {...}}",
          "timestamp": 1234567891
        }
      ]
    }
  ]
}

Multi-Action YAML

HAR capture with interaction

actions:
  - navigate:
      url: https://example.com
      wait_until: networkidle
  - har:
      url_filter: "*/api/*"
      include_bodies: true
      output: api-traffic.har
  - click:
      selector: "#load-data"
  - wait_for:
      selector: ".results"
  - har_stop:
      output: full-traffic.har

Mock and test

actions:
  - mock:
          url: "*/api/users"
          status: 200
          body: '{"users": [{"id": 1, "name": "Test User"}]}'
          content_type: application/json
  - navigate:
      url: https://example.com
      wait_until: networkidle
  - assert:
      text: "contains Test User"
  - screenshot:
      full_page: true

Throttle and measure

actions:
  - throttle:
      profile: slow-3g
  - navigate:
      url: https://example.com
      wait_until: load
  - cwv:
      mobile: true
      output: cwv-throttled.json
  - screenshot:
      full_page: true

Best Practices

  • Use --include-bodies sparingly — bodies can make HAR files very large.
  • Filter by URL — use --url-filter to focus on relevant traffic.
  • Mock external APIs in tests — don't depend on third-party services in CI.
  • Throttle with CWV — always measure CWV under slow-3g for real-world performance.
  • Block trackers in tests — use intercept --block to remove noise from analytics.
  • Verify HAR replays — use --verify to detect API response changes.
  • Save HAR files as artifacts — useful for debugging network issues in CI.
  • Use custom throttle for specific scenarios — simulate your users' actual network conditions.
  • Inspect WebSocket frames — debug real-time communication issues.
  • Mock with realistic delays — use --delay to simulate real API latency.

Common Pitfalls

  • HAR files too large — use --url-filter and avoid --include-bodies for large sites.
  • Mock not matching — URL patterns are regex; escape special characters.
  • Throttle profile too slow — slow-3g can cause timeouts; increase --timeout.
  • Intercept blocking too much — use --allow to whitelist critical resources.
  • HAR replay URL mismatch — the target URL must serve the same paths as the original capture.
  • WebSocket frames missing — use --websocket flag explicitly; not captured by default.
  • Modify headers not applied — modifications only apply to requests made after navigation starts.
  • Mock delay causing timeout — keep mock delays shorter than --timeout.

References

  • references/har-format.md — HAR file format reference
  • references/network-patterns.md — Common network testing patterns
  • assets/templates/har-capture.yml — HAR capture template
  • assets/templates/mock-api.yml — API mocking template
  • assets/templates/throttle-test.yml — Network throttling template
  • HAR 1.2 Specification
  • Chrome DevTools Network

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.