Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation and test coverage for complicated request waits and captures #611

Open
xylix opened this issue Dec 22, 2020 · 0 comments

Comments

@xylix
Copy link
Collaborator

xylix commented Dec 22, 2020

User use case from RF Slack: https://robotframework.slack.com/archives/C015KB1QSDN/p1608553440345200 , inlined here for archiving

"
I'm returning to the "intercept my app's Graphql responses" problem, except this time on behalf of a colleague who wants to intercept REST responses where (again) the request url strings are all the same, and the requests differ by what’s in the request body.
... so, I think we should be able to do this by Wait For Response with matcher= a JS function that looks for something in the request body. If the request I'm looking for is the one that has a body

{
"operationName":"sitesSummary",
"variables":{"startTime":1608548953678,"endTime":1608552553678},
"query": <... all the rest of it ...>
}

then I think something close to this ought to work:

${promise}=     Promise To            Wait For Response     matcher= (requestBody) => {requestBody.hasOwnProperty("operationName") && requestBody["operationName"] === "sitesSummary";}    timeout=10

It doesn’t – should it? Am I doing something wrong? (It might help if I knew more Javascript than a few hours of going through tutorials)
thanks for any advice! (edited)

@Snooz82 Snooz82 added this to the v18.0.0 milestone Sep 17, 2023
@aaltat aaltat modified the milestones: v17.5.2, v18.0.0 Oct 13, 2023
@aaltat aaltat modified the milestones: v18.0.0, v18.1.0 Oct 30, 2023
@Snooz82 Snooz82 modified the milestones: v18.0.0, Some Next Issues Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants