0
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Postmanテストケースの書き方

0
Posted at
  • Httpステータスコードの確認

    • tests["レスポンスコードが200であること"] = responseCode.code === 200;
  • レスポンスデータをJSONにパースする

    • var jsonData = JSON.parse(responseBody);
  • コンソールログ出力

    • console.log("ログコメント");
  • Postman環境変数に格納する

    • postman.setEnvironmentVariable("user_id", jsonData.userid);
  • レスポンスを丸ごと比較

    pm.test("レスポンス確認", function () {
        pm.expect(jsonData).to.eql(
        {
            "code": "ERROR",
            "message": "パラメータが不正です。",
            "message_detail": "user_idが未設定です。"
        }
            );
    });
    
0
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?