Вы действительно должны прочитать документы и посмотреть демонстрации и сэкономить много времени.
Обратите внимание, что вы можете использовать ключевое слово params
для этого варианта использования значения null
будут игнорироваться (параметр запроса не будет установлен).
Scenario Outline:
* def query = { name: <name>, country: <country>, active: <active>, limit: <limit> }
Given path 'search'
And params query
When method get
Then status 200
# response should NOT contain a key expected to be missing
And match response !contains <missing>
# observe how strings are enclosed in quotes, and we set null-s here below
# and you can get creative by stuffing json into table cells !
Examples:
| name | country | active | limit | missing |
| 'foo' | 'IN' | true | 1 | {} |
| 'bar' | null | null | 5 | { country: '#notnull', active: '#notnull' } |
| 'baz' | 'JP' | null | null | { active: '#notnull', limit: '#notnull' } |
| null | 'US' | null | 3 | { name: '#notnull', active: '#notnull' } |
| null | null | false | null | { name: '#notnull', country: '#notnull', limit: '#notnull' } |