AnWeber / vscode-httpyac

Quickly and easily send REST, Soap, GraphQL, GRPC, MQTT and WebSocket requests directly within Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=anweber.vscode-httpyac
MIT License
222 stars 20 forks source link

Sub environments possible? #259

Closed sir-farfan closed 4 months ago

sir-farfan commented 4 months ago

Hello I have a service running in various sites and I want to run the same tests overwriting specific things like the base url or IP but sharing others like user_id; which are different between dev and qa...

From the environments page, I'm not sure if or how I can use the env file names to specify a dependency.

The documentation says multiple environments can be selected but clicking the check mark on another env clears the variables set by the previous one.

Is it possible to achieve something like this: ?

# dev.env
base_url=https://echo.free.beeceptor.com

# dev.east.env
. dev.env
region=east

# dev.west.env
. dev.env
region=west

# test.http
GET {{base_url}}/sample-request?region={{region}}

I can't use the .env file because I have "environment specific globals" but not "global globals", if that makes sense xD

AnWeber commented 4 months ago

Is setting httpyac.environmentPickMany enabled. Default is true, maybe you disabled it.

tested with latest vscode and extension envs

sir-farfan commented 4 months ago

I was enabling them directly on the left panel. Thanks!