Skip to content

Test/wait for http characterization - #5436

Merged
Snooz82 merged 2 commits into
mainfrom
test/wait-for-http-characterization
Nov 1, 2026
Merged

Snooz82 merged 2 commits into
mainfrom
test/wait-for-http-characterization

Conversation

@Snooz82

@Snooz82 Snooz82 commented Nov 1, 2026

Copy link
Copy Markdown
Member

Just improved the tests for Wait For Request and Wait For Response to prepare #5119

@Snooz82 Snooz82 self-assigned this Nov 1, 2026
Copilot AI balanced review requested due to automatic review settings November 1, 2026 21:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are identified for the HTTP wait characterization tests and shared fixture changes.

No open issues 🎉

What changed in this PR

Adds characterization tests for the existing Wait For Request and Wait For Response behavior, preparing for #5119 without changing the keywords themselves.

Changes:

  • Covers legacy JSON parsing, response metadata, body chunking, and empty or unreadable bodies.
  • Adds acceptance checks for binary-to-text decoding and JSON responses served as plain text, while allowing additive request metadata.
  • Centralizes the mocked gRPC channel fixture for reuse across Python tests.
File Description
utest/​test_wait_for_http.py Adds Python coverage for response parsing, metadata, and nested request data.
utest/​test_failed_page.py Reuses the shared gRPC channel fixture.
utest/​conftest.py Introduces the shared gRPC channel fixture.
node/​playwright-wrapper/​__tests__/​network.test.ts Covers request parsing and response serialization, chunking, and read failures.
node/​dynamic-test-app/​src/​server.ts Adds a JSON-as-text endpoint and deterministic binary response bytes.
atest/​test/​05_JS_Tests/​http_with_waiting.robot Checks legacy binary decoding and content-type-independent JSON parsing.
atest/​test/​03_Waiting/​wait_for_http.robot Verifies required request keys without rejecting additional metadata.

Review effort: Balanced

…onse

Characterization tests for the behaviour that #5119 keeps backwards
compatible, before the keywords are enriched:

- utest: body parsing in Wait For Response (JSON parsed regardless of
  content type, scalars, chunk joining, empty and unreadable bodies,
  nested postData parsed only with a JSON content type)
- Jest: waitForResponse metadata, body transfer and chunking; JSON
  postData parsed regardless of content type in waitForRequest
- atest: JSON body served as text/plain is returned parsed

Fixes two weak acceptance tests: the binary response test compared two
equally mangled bodies of a single byte and now asserts the UTF-8
decoded PNG signature, and the request key count no longer blocks
additive keys.
- The waitForResponse metadata test uses toMatchObject, so new keys
  planned in #5119 do not break it while existing keys stay locked.
- The gRPC channel stub moves to a shared stub_grpc_channel fixture in
  utest/conftest.py, used by test_failed_page.py and
  test_wait_for_http.py.
- makeMockPage accepts a waitForResponse override instead of a separate
  pageResponding helper.
@Snooz82
Snooz82 force-pushed the test/wait-for-http-characterization branch from bd1f6c6 to 534768d Compare November 1, 2026 22:04
@Snooz82
Snooz82 merged commit a6cf8f9 into main Nov 1, 2026
31 checks passed
@Snooz82
Snooz82 deleted the test/wait-for-http-characterization branch November 1, 2026 22:41
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.

2 participants