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

Skip at stage level doesn't evaluate a tavern binary variable, instead it evaluates always as True #948

Open
RiGor66 opened this issue Feb 10, 2025 · 0 comments

Comments

@RiGor66
Copy link

RiGor66 commented Feb 10, 2025

Hello Tavern Team!!

As you know we can skip a stage become executed by using code like these

stages:
  - name: Test_stage name abc
     skip: !bool "yes"

In the same way I can tell tavern to don't skip a stage using something like this:

stages:
  - name: Test_stage name abc
     skip: !bool "NO"

However if I want to skip a stage based on a variable, someway like this:

...
stages:
  - name: Get a binary status
     request:
       url: "{test_url}/legal-acceptance"
       method: GET
     response:
       status_code: 200
      json:
        accept: !anybool
      save:
        json:
          skipStep: accept

  - name: Test_stage name abc
     skip: !bool "{skipStep}"
...

Tavern evaluates this skip always as True, independetly of the binary value stored in such variable {skipStep}. Why Tavern deal's this case in this way?
It will be strongly useful if Tavern could evaluate the binary content of a variable in the stage's skip, since in this way we could execute or not some stages depending on some logic variable states previous defined/stored among the test.

@RiGor66 RiGor66 changed the title Skip at stage level doesn't evaluate tavern binary variables, instead it evaluates all variables as True Skip at stage level doesn't evaluate a tavern binary variable, instead it evaluates always as True Feb 10, 2025
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

1 participant