httpyac / httpyac.github.io

Documentation and Examples for httpyac
https://httpyac.github.io
MIT License
105 stars 10 forks source link

Conditionally running test based on Environment? #38

Closed FrankRua closed 2 years ago

FrankRua commented 2 years ago

As a developer, there are certain test that I don't want to run in production but do want to run in non-production. Is it possible to skip test execution depending on environment?

AnWeber commented 2 years ago

There are several ways. I have per environment a setting system, on which I query in the sequence. But you could also access httpFile.activeEnvironment directly.

GET https://httpbin.org/json

{{
if(system === 'dev'){
  test.status(200);  
}
}}

Do any of the solutions work for your use case or do you have another idea?