Skip to content

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

Open
aditya711-code wants to merge 1 commit into
mainfrom
AAP-20051-network-logs-capture-content
Open

Add network_logs_options input (capture network log content for XCUITest)#13
aditya711-code wants to merge 1 commit into
mainfrom
AAP-20051-network-logs-capture-content

Conversation

@aditya711-code

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 `network_logs_options` step input that mirrors the App Automate
`networkLogsOptions` capability (e.g. {"captureContent": true}) 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.

The input is parsed as JSON into networkLogsOptions and forwarded in the
build payload. Providing it automatically enables networkLogs (the option is
only honoured when network logs are on). When empty the payload is unchanged
(networkLogsOptions is omitted), so it is fully backward compatible. Invalid
JSON fails with a clear, actionable error.

- step.yml: new network_logs_options JSON input under "Debug logs"
- structs.go: NetworkLogsOptions struct + *NetworkLogsOptions field (omitempty)
- 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

AAP-20051

Co-Authored-By: Claude Opus 4.8 (1M context) <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