reserved. 26 Feature: sample karate test script Background: * url 'https://jsonplaceholder.typicode.com' Scenario: get all users and then get the first user by id Given path 'users' When method get Then status 200 And assert response.size() === 10 And assert response[0].id == 1 And match response[0] contains { id: 1, name: "Leanne Graham" } https://jsonplaceholder.typicode.com/users に対して GETメソッド でコールして HTTPステータス 200 であることをテスト レスポンスの内容をテスト
rights reserved. 29 # present / notpresent * def test = {id: '001’, name: 'Bob'} * match test == {id: '001’, name: '#present’, age: '#notpresent'} # number * def test = {foo: 1} * match test == {foo: '#number'} # string * def test = {foo: 'test'} * match test == {foo: '#string'} # boolean * def test = {foo: true} * match test == {foo: '#boolean'} パラメータの有無判定 パラメータの型判定