Conteúdo para o tech sharing de testes de API com Postman.
API utilizada:
**O ServeRest é uma API REST que simula uma loja virtual com intuito de servir de material de estudos de testes de API.**
Summary Item | Total | Failed |
---|---|---|
Requests | 7 | 0 |
Prerequest Scripts | 2 | 0 |
Test Scripts | 7 | 0 |
Assertions | 6 | 0 |
Skipped Tests | 0 | - |
Header Name | Header Value |
---|---|
Content-Type | application/json |
User-Agent | PostmanRuntime/7.37.1 |
Accept | */* |
Cache-Control | no-cache |
Postman-Token | e9957bde-e43b-48a8-8354-98968eeec953 |
Host | serverest.dev |
Accept-Encoding | gzip, deflate, br |
Connection | keep-alive |
Content-Length | 118 |
{
"nome": "{{nome}}",
"email": "Elda@qa.com.br",
"password": "eBjy0q0uP88POxN",
"administrador": "true"
}
Header Name | Header Value |
---|---|
access-control-allow-origin | * |
x-dns-prefetch-control | off |
x-frame-options | SAMEORIGIN |
strict-transport-security | max-age=15552000; includeSubDomains |
x-download-options | noopen |
x-content-type-options | nosniff |
x-xss-protection | 1; mode=block |
content-type | application/json; charset=utf-8 |
X-Cloud-Trace-Context | 13a7b4fb5544473d2e8428af526de1ed;o=1 |
Date | Wed, 24 Apr 2024 18:22:20 GMT |
Server | Google Frontend |
Content-Length | 82 |
{
"message": "Cadastro realizado com sucesso",
"_id": "qPkvEHt1e43jKoC7"
}
Header Name | Header Value |
---|---|
Content-Type | application/json |
User-Agent | PostmanRuntime/7.37.1 |
Accept | */* |
Cache-Control | no-cache |
Postman-Token | 503f11cc-2a3b-4324-8e5e-c99485285e9b |
Host | serverest.dev |
Accept-Encoding | gzip, deflate, br |
Connection | keep-alive |
Content-Length | 67 |
{
"email": "Elda@qa.com.br",
"password": "eBjy0q0uP88POxN"
}
Header Name | Header Value |
---|---|
access-control-allow-origin | * |
x-dns-prefetch-control | off |
x-frame-options | SAMEORIGIN |
strict-transport-security | max-age=15552000; includeSubDomains |
x-download-options | noopen |
x-content-type-options | nosniff |
x-xss-protection | 1; mode=block |
content-type | application/json; charset=utf-8 |
X-Cloud-Trace-Context | a40a5b2b627dd2c4984459e191a21044 |
Date | Wed, 24 Apr 2024 18:22:20 GMT |
Server | Google Frontend |
Content-Length | 280 |
{
"message": "Login realizado com sucesso",
"authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6IkVsZGFAcWEuY29tLmJyIiwicGFzc3dvcmQiOiJlQmp5MHEwdVA4OFBPeE4iLCJpYXQiOjE3MTM5ODI5NDAsImV4cCI6MTcxMzk4MzU0MH0.Q9kYVOeD4BApNS-5fVqa7mqUhIfGrpOGrW0HIppDeDA"
}
Name | Passed | Failed | Skipped |
---|---|---|---|
Deve retornar status 200 com mensagem de sucesso e token de auth | 1 | 0 | 0 |
Total | 1 | 0 | 0 |
Test Name | Assertion Error |
---|
Header Name | Header Value |
---|---|
User-Agent | PostmanRuntime/7.37.1 |
Accept | */* |
Cache-Control | no-cache |
Postman-Token | dfb569b4-8cc2-42bc-a757-0246a2ee3882 |
Host | serverest.dev |
Accept-Encoding | gzip, deflate, br |
Connection | keep-alive |
Header Name | Header Value |
---|---|
access-control-allow-origin | * |
x-dns-prefetch-control | off |
x-frame-options | SAMEORIGIN |
strict-transport-security | max-age=15552000; includeSubDomains |
x-download-options | noopen |
x-content-type-options | nosniff |
x-xss-protection | 1; mode=block |
content-type | application/json; charset=utf-8 |
X-Cloud-Trace-Context | 25e919b46b851685cdea0c016e56fac3 |
Date | Wed, 24 Apr 2024 18:22:20 GMT |
Server | Google Frontend |
Content-Length | 1604 |
{
"quantidade": 8,
"produtos": [
{
"nome": "Enormous Marble Clock",
"descricao": "Mouse",
"quantidade": 381,
"preco": 470,
"_id": "Bcp4BHknhcBGXtAT"
},
{
"nome": "Logitech MX Vertical",
"preco": 470,
"descricao": "Mouse",
"quantidade": 382,
"_id": "BeeJh5lz3k6kSIzA"
},
{
"nome": "Samsung 60 polegadas",
"preco": 5240,
"descricao": "TV",
"quantidade": 49977,
"_id": "K6leHdftCeOJj8BJ"
},
{
"nome": "Gorgeous Granite Shirt",
"descricao": "Mouse",
"quantidade": 381,
"preco": 470,
"_id": "NBZ9PzTSX4koXP86"
},
{
"nome": "Small Bronze Bag",
"descricao": "Mouse",
"quantidade": 381,
"preco": 470,
"_id": "OGDteUUgruWJpF7n"
},
{
"nome": "Small Copper Plate",
"descricao": "Mouse",
"quantidade": 381,
"preco": 470,
"_id": "TGywtWQaJNIq8uRU"
},
{
"nome": "Synergistic Granite Plate",
"descricao": "Mouse",
"quantidade": 381,
"preco": 470,
"_id": "aZ00n5EZpvtFexup"
},
{
"nome": "Durable Cotton Keyboard",
"descricao": "Mouse",
"quantidade": 381,
"preco": 470,
"_id": "fMNdusS7Onp7rEPc"
}
]
}
Name | Passed | Failed | Skipped |
---|---|---|---|
Valida o schema e status code | 1 | 0 | 0 |
Total | 1 | 0 | 0 |
Test Name | Assertion Error |
---|
Header Name | Header Value |
---|---|
Authorization | Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6IkVsZGFAcWEuY29tLmJyIiwicGFzc3dvcmQiOiJlQmp5MHEwdVA4OFBPeE4iLCJpYXQiOjE3MTM5ODI5NDAsImV4cCI6MTcxMzk4MzU0MH0.Q9kYVOeD4BApNS-5fVqa7mqUhIfGrpOGrW0HIppDeDA |
Content-Type | application/json |
User-Agent | PostmanRuntime/7.37.1 |
Accept | */* |
Cache-Control | no-cache |
Postman-Token | 74a55a28-1df8-42b9-977e-1a251b9a0371 |
Host | serverest.dev |
Accept-Encoding | gzip, deflate, br |
Connection | keep-alive |
Content-Length | 122 |
{
"nome": "Gorgeous Rubber Chips",
"preco": 764,
"descricao": "Fantastic Concrete Shoes",
"quantidade": 920
}
Header Name | Header Value |
---|---|
access-control-allow-origin | * |
x-dns-prefetch-control | off |
x-frame-options | SAMEORIGIN |
strict-transport-security | max-age=15552000; includeSubDomains |
x-download-options | noopen |
x-content-type-options | nosniff |
x-xss-protection | 1; mode=block |
content-type | application/json; charset=utf-8 |
X-Cloud-Trace-Context | e66c1f7bee4dddf7cfc34d753fefe1e3 |
Date | Wed, 24 Apr 2024 18:22:20 GMT |
Server | Google Frontend |
Content-Length | 82 |
{
"message": "Cadastro realizado com sucesso",
"_id": "BeNyKSY3Ed04m4T3"
}
Name | Passed | Failed | Skipped |
---|---|---|---|
Deve retornar status 201 com mensagem de sucesso e o id do produto | 1 | 0 | 0 |
Total | 1 | 0 | 0 |
Test Name | Assertion Error |
---|
Header Name | Header Value |
---|---|
Authorization | Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6IkVsZGFAcWEuY29tLmJyIiwicGFzc3dvcmQiOiJlQmp5MHEwdVA4OFBPeE4iLCJpYXQiOjE3MTM5ODI5NDAsImV4cCI6MTcxMzk4MzU0MH0.Q9kYVOeD4BApNS-5fVqa7mqUhIfGrpOGrW0HIppDeDA |
Content-Type | application/json |
User-Agent | PostmanRuntime/7.37.1 |
Accept | */* |
Cache-Control | no-cache |
Postman-Token | 34d86e91-98c3-4e6f-8ad9-3391c594b0fb |
Host | serverest.dev |
Accept-Encoding | gzip, deflate, br |
Connection | keep-alive |
Content-Length | 103 |
{
"produtos": [
{
"idProduto": "BeNyKSY3Ed04m4T3",
"quantidade": 1
}
]
}
Header Name | Header Value |
---|---|
access-control-allow-origin | * |
x-dns-prefetch-control | off |
x-frame-options | SAMEORIGIN |
strict-transport-security | max-age=15552000; includeSubDomains |
x-download-options | noopen |
x-content-type-options | nosniff |
x-xss-protection | 1; mode=block |
content-type | application/json; charset=utf-8 |
X-Cloud-Trace-Context | f651fd23bf475b0033a5739dbb18e440 |
Date | Wed, 24 Apr 2024 18:22:20 GMT |
Server | Google Frontend |
Content-Length | 82 |
{
"message": "Cadastro realizado com sucesso",
"_id": "cH9Uw94YI5t4XYIN"
}
Name | Passed | Failed | Skipped |
---|---|---|---|
Deve retornar status 201 com mensagem de sucesso e o id do carrinho | 1 | 0 | 0 |
Total | 1 | 0 | 0 |
Test Name | Assertion Error |
---|
Header Name | Header Value |
---|---|
Authorization | Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6IkVsZGFAcWEuY29tLmJyIiwicGFzc3dvcmQiOiJlQmp5MHEwdVA4OFBPeE4iLCJpYXQiOjE3MTM5ODI5NDAsImV4cCI6MTcxMzk4MzU0MH0.Q9kYVOeD4BApNS-5fVqa7mqUhIfGrpOGrW0HIppDeDA |
User-Agent | PostmanRuntime/7.37.1 |
Accept | */* |
Cache-Control | no-cache |
Postman-Token | 7e91c3e0-0966-4d0e-b2af-2c09b9e9d444 |
Host | serverest.dev |
Accept-Encoding | gzip, deflate, br |
Connection | keep-alive |
Header Name | Header Value |
---|---|
access-control-allow-origin | * |
x-dns-prefetch-control | off |
x-frame-options | SAMEORIGIN |
strict-transport-security | max-age=15552000; includeSubDomains |
x-download-options | noopen |
x-content-type-options | nosniff |
x-xss-protection | 1; mode=block |
content-type | application/json; charset=utf-8 |
X-Cloud-Trace-Context | 0bdf4e2732a922007059526b74a16175 |
Date | Wed, 24 Apr 2024 18:22:21 GMT |
Server | Google Frontend |
Content-Length | 425 |
{
"quantidade": 1,
"carrinhos": [
{
"produtos": [
{
"idProduto": "BeNyKSY3Ed04m4T3",
"quantidade": 1,
"precoUnitario": 764
}
],
"precoTotal": 764,
"quantidadeTotal": 1,
"idUsuario": "qPkvEHt1e43jKoC7",
"_id": "cH9Uw94YI5t4XYIN"
}
]
}
Name | Passed | Failed | Skipped |
---|---|---|---|
Valida o schema e status code | 1 | 0 | 0 |
Total | 1 | 0 | 0 |
Test Name | Assertion Error |
---|
Header Name | Header Value |
---|---|
Authorization | Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6IkVsZGFAcWEuY29tLmJyIiwicGFzc3dvcmQiOiJlQmp5MHEwdVA4OFBPeE4iLCJpYXQiOjE3MTM5ODI5NDAsImV4cCI6MTcxMzk4MzU0MH0.Q9kYVOeD4BApNS-5fVqa7mqUhIfGrpOGrW0HIppDeDA |
User-Agent | PostmanRuntime/7.37.1 |
Accept | */* |
Cache-Control | no-cache |
Postman-Token | 39f9be15-49a1-4500-8b50-6efedf03a3a3 |
Host | serverest.dev |
Accept-Encoding | gzip, deflate, br |
Connection | keep-alive |
Header Name | Header Value |
---|---|
access-control-allow-origin | * |
x-dns-prefetch-control | off |
x-frame-options | SAMEORIGIN |
strict-transport-security | max-age=15552000; includeSubDomains |
x-download-options | noopen |
x-content-type-options | nosniff |
x-xss-protection | 1; mode=block |
content-type | application/json; charset=utf-8 |
X-Cloud-Trace-Context | 013e364831df67545dd031b9de91fd51 |
Date | Wed, 24 Apr 2024 18:22:21 GMT |
Server | Google Frontend |
Content-Length | 51 |
{
"message": "Registro excluído com sucesso"
}
Name | Passed | Failed | Skipped |
---|---|---|---|
Deve retornar status 200 com mensagem de sucesso | 1 | 0 | 0 |
Total | 1 | 0 | 0 |
Test Name | Assertion Error |
---|