feat!: Wait For Request also return more than uri#4940
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a breaking change to the Wait For Request keyword so it returns a structured object (intended to include url, method, headers, and postData) instead of only a URL, aligning with the request-introspection needs described in #4656.
Changes:
- Change the gRPC API for
WaitForRequestfromResponse.StringtoResponse.Json. - Update the Node wrapper to serialize request details (url/method/headers/postData) into the JSON response.
- Extend the dynamic test app and acceptance tests to exercise and validate the richer return value.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| protobuf/playwright.proto | Changes WaitForRequest RPC return type to Response.Json. |
| node/playwright-wrapper/network.ts | Returns JSON payload for waitForRequest including url/method/headers/postData. |
| node/dynamic-test-app/src/login.tsx | Adds a new UI button that triggers a delayed POST request for testing. |
| Browser/keywords/network.py | Updates Python keyword plumbing to consume JSON response and return it to Robot as a dict/DotDict. |
| atest/test/variables.resource | Updates expected button count due to new button in test app. |
| atest/test/03_Waiting/wait_for_http.robot | Updates/extends acceptance tests to validate the richer Wait For Request return value. |
return dict with url, method, headers and postData as keys Fixes: MarketSquare#4656
Comment on lines
+120
to
+132
| let postData; | ||
| try { | ||
| postData = JSON.parse(result.postData() || 'null'); | ||
| } catch (e) { | ||
| logger.info(`Failed to parse postData as JSON: ${String(e)}, using raw postData`); | ||
| postData = result.postData(); | ||
| } | ||
| const jsonData = JSON.stringify({ | ||
| url: result.url(), | ||
| method: result.method(), | ||
| headers: result.headers(), | ||
| postData: postData, | ||
| }); |
Comment on lines
+24
to
+25
| Should Contain ${data.url} /api/log/event | ||
| Should Be Equal ${data.method} POST |
Comment on lines
+122
to
+124
| except json.decoder.JSONDecodeError: | ||
| logger.info(f"Failed to decode JSON: {response.json}") | ||
| data = response.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
return dict with url, method, headers and postData as keys
Fixes: #4656