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

How to chain and assert across all chained requests? #79

Open
inakihn opened this issue Jul 26, 2024 · 1 comment
Open

How to chain and assert across all chained requests? #79

inakihn opened this issue Jul 26, 2024 · 1 comment

Comments

@inakihn
Copy link

inakihn commented Jul 26, 2024

Hi,

Thanks for the amazing library, I'm starting to try and use it and I wanted to chain requests while asserting in all requests.

Given those two files, from the examples of the library, where I want to add assertions:

# @name getHttpbinA
GET https://httpbin.org/get?source=getHttpbinA
X-Foo: barA

?? status == 204
# @import ./a.http
###
# @name getHttpbinB
# @ref getHttpbinA
GET https://httpbin.org/get?source=getHttpbinB
X-Foo: barB-{{getHttpbinA.headers["X-Foo"]}}

?? status == 200

I expected that when executing B, the asserts from A would also be executed. But it does not seem to be the case for me. If I put a wrong assert (for example status == 500), B is still shown as executed and passed in vs code.

My goal is to execute a full flow on my application, by composing the different reusable parts of the flow. But I would like to be sure that all imported requests have assertions and have passed.

Does anybody have any hints on this?

@inakihn inakihn changed the title Need support in chaining and asserting across all chained requests. How to chain and assert across all chained requests? Jul 26, 2024
@AnWeber
Copy link
Contributor

AnWeber commented Aug 3, 2024

I expected that when executing B, the asserts from A would also be executed. But it does not seem to be the case for me. If I put a wrong assert (for example status == 500), B is still shown as executed and passed in vs code.

The asserts of A get executed, but they are not shown in vscode. If you use CLI you would see the results.. I'll see if I can get the results from A to the corresponding test item, but it might be difficult, as I don't even realize that A is running.

My goal is to execute a full flow on my application, by composing the different reusable parts of the flow. But I would like to be sure that all imported requests have assertions and have passed.

The intended way is actually to simply run all tests in all test files.

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

No branches or pull requests

2 participants