Skip to content

How to disable check_response by default #89

Answered by smicyk
AntonioSun asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, yes this is something missing but the reason for that is how the check_response works. It is actually short version of assert_response element. So instead of:

plan {
   group {
       http 'GET http://www.example.com', {
          assert_response field: 'response_code', rule: 'equals',  {
              pattern '200'
          }
          assert_response field: 'response_code', rule: 'equals',  {
              pattern '204'
          }
      }
   }
}

You write:

plan {
   group {
       http {
          check_response {
             status() eq 200
             status() eq 204
          }
      }
   }
}

The check_response is container to several Response Assertion objects where each can…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by AntonioSun
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants