rights reserved. 17 No ⽐較ポイント Karate Cucumber 1 Step Definitions built-in, no Java code needed × 2 Re-Use Feature files from other Features × 3 Dynamic Data-Driven Testing × 4 Parallel Test Execution and Reporting × 5 Option to run routines only once per Feature × https://www.slideshare.net/intuit_india/karate-for-complex-webservice-api-testing-by-peter-thomas
reserved. 20 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. 23 # 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'} パラメータの有無判定 パラメータの型判定