33 lines
No EOL
599 B
Text
33 lines
No EOL
599 B
Text
meta {
|
|
name: List Products
|
|
type: http
|
|
seq: 1
|
|
}
|
|
|
|
get {
|
|
url: {{baseUrl}}/products
|
|
}
|
|
|
|
headers {
|
|
Authorization: Bearer {{authToken}}
|
|
}
|
|
|
|
assert {
|
|
res.status: equals 200
|
|
}
|
|
|
|
tests {
|
|
test("List products returns an array", function() {
|
|
const data = res.getBody();
|
|
expect(data).to.be.an("array");
|
|
});
|
|
|
|
test("Each product has correct shape", function() {
|
|
const data = res.getBody();
|
|
data.forEach(function(product) {
|
|
expect(product).to.have.property("id");
|
|
expect(product).to.have.property("name");
|
|
expect(product).to.have.property("barcode");
|
|
});
|
|
});
|
|
} |