Skip to content

Add network_logs_options input (capture network log content for XCUITest)#12

Closed
aditya711-code wants to merge 2 commits into
browserstack:mainfrom
aditya711-code:AAP-20051-network-logs-capture-content
Closed

Add network_logs_options input (capture network log content for XCUITest)#12
aditya711-code wants to merge 2 commits into
browserstack:mainfrom
aditya711-code:AAP-20051-network-logs-capture-content

Conversation

@aditya711-code

@aditya711-code aditya711-code commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a network_logs_options step input that mirrors the App Automate networkLogsOptions capability, so XCUITest builds on BrowserStack App Automate can capture the content (request and response bodies) of network logs — not just metadata such as URLs, headers, latency and status codes.

Until now the step exposed only a network_logs on/off toggle, so capture-content could be enabled on local/IDE runs but not when running through this Bitrise step.

Usage

- network_logs_options: '{"captureContent": true}'

The value is the same JSON you would pass as the networkLogsOptions capability elsewhere, so it maps 1:1 from local/IDE configurations.

Behavior

  • The input is parsed as JSON and forwarded as networkLogsOptions in the build payload.
  • Providing it automatically enables network_logs, because networkLogsOptions is only honoured when network logs are enabled (a notice is logged when this happens).
  • When empty/omitted, the payload is unchanged — networkLogsOptions is omitted entirely — so the change is fully backward compatible.
  • Invalid JSON produces a clear, actionable error.

Changes

File Change
step.yml New network_logs_options JSON input under "Debug logs"
structs.go NetworkLogsOptions struct + *NetworkLogsOptions field (omitempty) on the payload
util_fns.go parseNetworkLogsOptions helper + wiring in createBuildPayload()
constants.go Actionable error string for invalid JSON
main_test.go Unit tests for parsing and payload shape
README.md Documented the new input

Testing

  • gofmt, go build ./..., go vet ./..., go test ./... all pass.
  • New unit tests cover input parsing (valid {"captureContent": true/false}, empty, malformed JSON, wrong value type) and payload shape (provided → networkLogs:true + networkLogsOptions.captureContent:true; empty → networkLogsOptions absent).

Ref: AAP-20051

🤖 Generated with Claude Code

Adds a boolean step input `network_logs_capture_content` so XCUITest builds
can capture the request/response content (bodies) of network logs, not just
metadata. Previously this could only be set on local/IDE runs.

When enabled, the step sends networkLogsOptions.captureContent in the build
payload and automatically enables networkLogs (capture content is only
honoured when network logs are on). When disabled/omitted the payload is
unchanged (networkLogsOptions is omitted), so it is fully backward compatible.
Invalid values fail with a clear, actionable error.

- step.yml: new boolean input under "Debug logs"
- structs.go: NetworkLogsOptions struct + *NetworkLogsOptions field (omitempty)
- util_fns.go: parseCaptureContent helper + wiring in createBuildPayload
- constants.go: actionable error string for invalid values
- main_test.go: unit tests for parsing and payload shape
- README.md: documented the new input

AAP-20051

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@aditya711-code aditya711-code requested a review from a team as a code owner June 30, 2026 10:24
Use a `network_logs_options` JSON input that mirrors the App Automate
`networkLogsOptions` capability (e.g. {"captureContent": true}) instead of a
boolean toggle, so the Bitrise input matches what users already pass on
local/IDE runs and can carry future networkLogsOptions keys.

- step.yml: network_logs_capture_content (bool) -> network_logs_options (JSON)
- util_fns.go: parseCaptureContent -> parseNetworkLogsOptions (json.Unmarshal)
- constants.go: error string updated for invalid JSON
- main_test.go: tests updated for the JSON input
- README.md: input row updated

The wire payload is unchanged: networkLogs:true + networkLogsOptions:{captureContent:true}.

AAP-20051

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@aditya711-code aditya711-code changed the title Add network_logs_capture_content input (capture network log content for XCUITest) Add network_logs_options input (capture network log content for XCUITest) Jun 30, 2026
@aditya711-code

Copy link
Copy Markdown
Collaborator Author

Superseded by #13 — direct push access to this repo was granted, so moving to a same-repo PR (clean single commit, runs the repo's checks directly).

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