2017-05-14 10 views
1

私はPOSTMANクライアントを使用しており、csvファイルからデータを読み取ろうとしています。 PoCとして、私は8月郵便番号を使用したデータ駆動テスト

以下

では、エンドポイントURL

https://www.googleapis.com/books/v1/volumes?q=Light以下で使用している私のコードそれが失敗している

tests["Status code is 200"] = responseCode.code === 200; 
 

 
postman.setEnvironmentVariable("requestBook", data.requestBook); 
 

 
var response = JSON.parse(responseBody); 
 
tests["Validate the title is correctly populated"] = /{{title}}/.test(response.items[0].volumeInfo.title); 
 
tests["Validate the author is correctly populated"] = /{{authors}}/.test(response.items[0].volumeInfo.authors); 
 
tests["Validate the publisher is correctly populated"] = /{{publisher}}/.test(response.items[0].volumeInfo.publisher); 
 
tests["Validate the published date is correctly populated"] = /{{publishedDate}}/.test(response.items[0].volumeInfo.publishedDate); 
 
tests["Validate the page count is correctly populated"] = /{{pageCount}}/.test(response.items[0].volumeInfo.pageCount); 
 
tests["Validate the category is correctly populated"] = /{{categories}}/.test(response.items[0].volumeInfo.categories); 
 
tests["Validate the amount is correctly populated"] = /{{amount}}/.test(response.items[0].saleInfo.listPrice.amount); 
 
tests["Validate the currency code is correctly populated"] = /{{currencyCode}}/.test(response.items[0].saleInfo.listPrice.currencyCode);

です。私はプレビューをクリックすると、すべての私のデータは、私はそれゆえソリューションはその解決を発見した二重引用符で囲ま

+0

解決策が見つかりましたので解決しました。新しいコードはテストです "[タイトルが正しく入力されたことを検証する]] = response.items [0] .volumeInfo.title === data.title; –

+0

代わりにこのコメントを回答として書き込み、それを受け入れます。それはあなたに少しの評判をもたらし、他の開発者にとってもその答えを見やすくするでしょう。 – Ray

+0

私はしようとしましたが、ボタンが見つからない "答え" –

答えて

1

を示しています。私は私のcsvファイルをチェックインすると、そのすべてが罰金

注意を探します。新しいコードはテストです "[タイトルが正しく入力されたことを検証する]] = response.items [0] .volumeInfo.title === data.title;