From 0bb09ff4860824f030a48e20d08d5a9d2ad26d9b Mon Sep 17 00:00:00 2001 From: LorenaJMS <134311083+LorenaJMS@users.noreply.github.com> Date: Tue, 30 May 2023 14:29:56 -0600 Subject: [PATCH 01/13] =?UTF-8?q?Create=20Informaci=C3=B3n.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "Carpeta/Informaci\303\263n.txt" | 1 + 1 file changed, 1 insertion(+) create mode 100644 "Carpeta/Informaci\303\263n.txt" diff --git "a/Carpeta/Informaci\303\263n.txt" "b/Carpeta/Informaci\303\263n.txt" new file mode 100644 index 0000000..c57c618 --- /dev/null +++ "b/Carpeta/Informaci\303\263n.txt" @@ -0,0 +1 @@ +Hola mi nombre es Lore, tengo 25 años . From ecc3c90de6be2a161dddbd9e28c55bd22e9bfbcf Mon Sep 17 00:00:00 2001 From: 1069257 Date: Tue, 30 May 2023 14:59:28 -0600 Subject: [PATCH 02/13] Nuevo --- "Carpeta/Informaci\303\263n.txt" | 2 ++ 1 file changed, 2 insertions(+) diff --git "a/Carpeta/Informaci\303\263n.txt" "b/Carpeta/Informaci\303\263n.txt" index c57c618..ee4d0ed 100644 --- "a/Carpeta/Informaci\303\263n.txt" +++ "b/Carpeta/Informaci\303\263n.txt" @@ -1 +1,3 @@ Hola mi nombre es Lore, tengo 25 años . + +#Me gusta viajar. From 9fdf8f3b84e9f891459c838c05c2f2925b2acf0d Mon Sep 17 00:00:00 2001 From: 1069257 Date: Tue, 30 May 2023 15:02:34 -0600 Subject: [PATCH 03/13] Primer cambio --- "Carpeta/Informaci\303\263n.txt" | 1 + 1 file changed, 1 insertion(+) diff --git "a/Carpeta/Informaci\303\263n.txt" "b/Carpeta/Informaci\303\263n.txt" index ee4d0ed..db88882 100644 --- "a/Carpeta/Informaci\303\263n.txt" +++ "b/Carpeta/Informaci\303\263n.txt" @@ -1,3 +1,4 @@ Hola mi nombre es Lore, tengo 25 años . #Me gusta viajar. +Hola \ No newline at end of file From 0cdab3fd915cbac289f5c8e6c62131fa13e2c40c Mon Sep 17 00:00:00 2001 From: 1069257 Date: Tue, 30 May 2023 15:10:55 -0600 Subject: [PATCH 04/13] Cambio en segunda rama --- "Carpeta/Informaci\303\263n.txt" | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git "a/Carpeta/Informaci\303\263n.txt" "b/Carpeta/Informaci\303\263n.txt" index db88882..d193480 100644 --- "a/Carpeta/Informaci\303\263n.txt" +++ "b/Carpeta/Informaci\303\263n.txt" @@ -1,4 +1,3 @@ Hola mi nombre es Lore, tengo 25 años . -#Me gusta viajar. -Hola \ No newline at end of file +Cambios nuevos \ No newline at end of file From ea67e1ad920b95b7c73590353be581455649c876 Mon Sep 17 00:00:00 2001 From: 1069257 Date: Tue, 30 May 2023 15:28:58 -0600 Subject: [PATCH 05/13] Nuevo commit --- "Carpeta/Informaci\303\263n.txt" | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git "a/Carpeta/Informaci\303\263n.txt" "b/Carpeta/Informaci\303\263n.txt" index d193480..0c7eadc 100644 --- "a/Carpeta/Informaci\303\263n.txt" +++ "b/Carpeta/Informaci\303\263n.txt" @@ -1,3 +1,5 @@ Hola mi nombre es Lore, tengo 25 años . -Cambios nuevos \ No newline at end of file +Cambios nuevos + +Intento de nuevo cambio \ No newline at end of file From ea49b5c8de9ebf1ef8af0df146336460ba83b122 Mon Sep 17 00:00:00 2001 From: 1069257 Date: Tue, 30 May 2023 15:41:55 -0600 Subject: [PATCH 06/13] Nuevamente intentando --- "Carpeta/Informaci\303\263n.txt" | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git "a/Carpeta/Informaci\303\263n.txt" "b/Carpeta/Informaci\303\263n.txt" index 0c7eadc..bf58d22 100644 --- "a/Carpeta/Informaci\303\263n.txt" +++ "b/Carpeta/Informaci\303\263n.txt" @@ -2,4 +2,6 @@ Hola mi nombre es Lore, tengo 25 años . Cambios nuevos -Intento de nuevo cambio \ No newline at end of file +Intento de nuevo cambio + +Cambios y más cambios \ No newline at end of file From 1346ccfec84ba562db01ad693a34d0fd9a48b667 Mon Sep 17 00:00:00 2001 From: 1069257 Date: Tue, 30 May 2023 15:49:59 -0600 Subject: [PATCH 07/13] Nuevamente --- "Carpeta/Informaci\303\263n.txt" | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git "a/Carpeta/Informaci\303\263n.txt" "b/Carpeta/Informaci\303\263n.txt" index bf58d22..c19b3ed 100644 --- "a/Carpeta/Informaci\303\263n.txt" +++ "b/Carpeta/Informaci\303\263n.txt" @@ -4,4 +4,7 @@ Cambios nuevos Intento de nuevo cambio -Cambios y más cambios \ No newline at end of file +Cambios y más cambios + +Otra vez + From 3af8638602522ef5a5694e440ce51b8a8b562c37 Mon Sep 17 00:00:00 2001 From: 1069257 Date: Tue, 30 May 2023 16:07:06 -0600 Subject: [PATCH 08/13] Nuevo --- "Carpeta/Informaci\303\263n.txt" | 1 + 1 file changed, 1 insertion(+) diff --git "a/Carpeta/Informaci\303\263n.txt" "b/Carpeta/Informaci\303\263n.txt" index c19b3ed..d3c9633 100644 --- "a/Carpeta/Informaci\303\263n.txt" +++ "b/Carpeta/Informaci\303\263n.txt" @@ -8,3 +8,4 @@ Cambios y más cambios Otra vez +Tema Baz \ No newline at end of file From 4cacbfeb93d1de2fa515f539ade0ce46de0f2ad9 Mon Sep 17 00:00:00 2001 From: 1069257 Date: Tue, 30 May 2023 16:10:01 -0600 Subject: [PATCH 09/13] Nuevo --- "Carpeta/Informaci\303\263n.txt" | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git "a/Carpeta/Informaci\303\263n.txt" "b/Carpeta/Informaci\303\263n.txt" index d3c9633..46b00e6 100644 --- "a/Carpeta/Informaci\303\263n.txt" +++ "b/Carpeta/Informaci\303\263n.txt" @@ -8,4 +8,5 @@ Cambios y más cambios Otra vez -Tema Baz \ No newline at end of file +Tema Baz +Team \ No newline at end of file From 5b78d08fdbd07ce4f1db484ed13fe32abe9ad9f0 Mon Sep 17 00:00:00 2001 From: 1069257 Date: Tue, 30 May 2023 16:19:28 -0600 Subject: [PATCH 10/13] Mi bebida --- "Carpeta/Informaci\303\263n.txt" | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git "a/Carpeta/Informaci\303\263n.txt" "b/Carpeta/Informaci\303\263n.txt" index db88882..c5f4791 100644 --- "a/Carpeta/Informaci\303\263n.txt" +++ "b/Carpeta/Informaci\303\263n.txt" @@ -1,4 +1,6 @@ Hola mi nombre es Lore, tengo 25 años . #Me gusta viajar. -Hola \ No newline at end of file +Hola + +Mi bebida favorita es la cerveza \ No newline at end of file From 267486ec82a56743d3f7d00777a258b5e6db2bd2 Mon Sep 17 00:00:00 2001 From: 1069257 Date: Tue, 30 May 2023 16:44:06 -0600 Subject: [PATCH 11/13] Main --- "Carpeta/Informaci\303\263n.txt" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/Carpeta/Informaci\303\263n.txt" "b/Carpeta/Informaci\303\263n.txt" index c18028c..6079f06 100644 --- "a/Carpeta/Informaci\303\263n.txt" +++ "b/Carpeta/Informaci\303\263n.txt" @@ -13,5 +13,5 @@ Intento de nuevo cambio Otra vez Tema Baz -Team ->>>>>>> prueba_wizline +Team Market + From e4a4e53120d39593162db7eeb64b9046e74cd212 Mon Sep 17 00:00:00 2001 From: 1069257 Date: Tue, 30 May 2023 16:45:24 -0600 Subject: [PATCH 12/13] prueba_wizline --- "Carpeta/Informaci\303\263n.txt" | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git "a/Carpeta/Informaci\303\263n.txt" "b/Carpeta/Informaci\303\263n.txt" index 46b00e6..474bc46 100644 --- "a/Carpeta/Informaci\303\263n.txt" +++ "b/Carpeta/Informaci\303\263n.txt" @@ -9,4 +9,6 @@ Cambios y más cambios Otra vez Tema Baz -Team \ No newline at end of file +Team + +Intentando 2 \ No newline at end of file From 2c9c7646eb4c04b3c454d0d25afc3e1e02b0e229 Mon Sep 17 00:00:00 2001 From: 1069257 Date: Fri, 9 Jun 2023 12:12:45 -0600 Subject: [PATCH 13/13] Entregable API --- ... Proyecto Pokemon.postman_environment.json | 33 ++ .../Proyecto Pokemon.postman_collection.json | 391 ++++++++++++++++++ 2 files changed, 424 insertions(+) create mode 100644 Proyecto_API_Pokemon/Ambiente Proyecto Pokemon.postman_environment.json create mode 100644 Proyecto_API_Pokemon/Proyecto Pokemon.postman_collection.json diff --git a/Proyecto_API_Pokemon/Ambiente Proyecto Pokemon.postman_environment.json b/Proyecto_API_Pokemon/Ambiente Proyecto Pokemon.postman_environment.json new file mode 100644 index 0000000..8e00414 --- /dev/null +++ b/Proyecto_API_Pokemon/Ambiente Proyecto Pokemon.postman_environment.json @@ -0,0 +1,33 @@ +{ + "id": "08da8620-f512-4d28-a944-25083d98fbeb", + "name": "Ambiente Proyecto Pokemon", + "values": [ + { + "key": "url", + "value": "https://pokeapi.co/api/v2/pokemon", + "type": "default", + "enabled": true + }, + { + "key": "namePokemon", + "value": "", + "type": "any", + "enabled": true + }, + { + "key": "move_name", + "value": "", + "type": "any", + "enabled": true + }, + { + "key": "move_url", + "value": "", + "type": "any", + "enabled": true + } + ], + "_postman_variable_scope": "environment", + "_postman_exported_at": "2023-06-09T15:42:28.962Z", + "_postman_exported_using": "Postman/10.14.9" +} \ No newline at end of file diff --git a/Proyecto_API_Pokemon/Proyecto Pokemon.postman_collection.json b/Proyecto_API_Pokemon/Proyecto Pokemon.postman_collection.json new file mode 100644 index 0000000..683a6e5 --- /dev/null +++ b/Proyecto_API_Pokemon/Proyecto Pokemon.postman_collection.json @@ -0,0 +1,391 @@ +{ + "info": { + "_postman_id": "eeb5daad-3273-42fe-86a4-d0e14316fde0", + "name": "Proyecto pokemon", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "24488057", + "_collection_link": "https://universal-comet-839245.postman.co/workspace/Team-Workspace~5d5eff05-0cdd-43d8-8f30-079c871737de/collection/24488057-eeb5daad-3273-42fe-86a4-d0e14316fde0?action=share&creator=24488057&source=collection_link" + }, + "item": [ + { + "name": "Escenarios_Positivos", + "item": [ + { + "name": "ValidacionesPokemon", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let myResponse = pm.response.json() //Variable Gobal para guardar el json de respuesta\r", + "let name = myResponse.name;\r", + "\r", + "//Evaluar código de respuesta 200\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "//Validar tiempo de respuesta\r", + "pm.test(\"El tiempo de respuesta es 700ms\", function () {\r", + " pm.expect(pm.response.responseTime).to.be.below(700);\r", + "});\r", + "\r", + "pm.test(\"El movimiento del pokemon es\" + \" \"+ name, function (){\r", + " pm.expect(name).to.eql(pm.environment.get(\"move_name\"));\r", + "})" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{move_url}}", + "host": [ + "{{move_url}}" + ] + } + }, + "response": [] + }, + { + "name": "Elegir pokemon favorito", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let myResponse = pm.response.json();//Variable Gobal para guardar el json de respuesta\r", + "console.log(JSON.parse(responseBody).moves[0].move) //Se imprime en consola el nombre y url del movimiento de pokemon.\r", + "\r", + "//Crea variables de ambiente con el nombre y la url del movimiento.\r", + "pm.environment.set(\"move_name\" , myResponse.moves[0].move.name)\r", + "pm.environment.set(\"move_url\" , myResponse.moves[0].move.url)\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.environment.set(\"namePokemon\", \"metapod\"); //Se genero la variable de entorno con el nombre del pokemon favorito" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{url}}/{{namePokemon}}", + "host": [ + "{{url}}" + ], + "path": [ + "{{namePokemon}}" + ] + } + }, + "response": [] + }, + { + "name": "Movimiento_Pokemon_url", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let myResponse = pm.response.json() //Variable Gobal para guardar el json de respuesta\r", + "\r", + "\r", + "//Validar la url del movimiento del pokemon dentro de learned_by_pokemon\r", + "pm.test(\"La url del movimiento de mi Pokémon es\" + \" \" + pm.environment.get(\"move_url\"), function () {\r", + " pm.expect(myResponse.moves[0].move.url).to.eql(pm.environment.get(\"move_url\"));\r", + "});\r", + "\r", + "//Evaluar código de respuesta 200\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{url}}/{{namePokemon}}", + "host": [ + "{{url}}" + ], + "path": [ + "{{namePokemon}}" + ] + } + }, + "response": [] + }, + { + "name": "Movimiento_Pokemon_Nombre", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let myResponse = pm.response.json() //Variable Gobal para guardar el json de respuesta\r", + "\r", + "\r", + "//Validar el nombre del movimiento del pokemon dentro de learned_by_pokemon\r", + "pm.test(\"Valida el nombre del movimiento de mi Pokémon\", function () {\r", + " pm.expect(myResponse.name).to.eql(pm.environment.get(\"move_name\"));\r", + " console.log(myResponse.name)\r", + " console.log(myResponse.learned_by_pokemon[4])\r", + "});\r", + "\r", + "\r", + "//Evaluar código de respuesta 200\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{move_url}}", + "host": [ + "{{move_url}}" + ] + } + }, + "response": [] + }, + { + "name": "SCHEMA", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "const schema ={ \r", + " \"move\":{ \r", + " \"name\":{\r", + " \"type\": \"string\"\r", + " },\r", + " \"url\":{\r", + " \"type\": \"string\"\r", + " }\r", + " } \r", + "} \r", + "\r", + "pm.test(\"Validacion schema json\", () =>{ \r", + " pm.response.to.have.jsonSchema(schema); \r", + "});\r", + "\r", + "//Evaluar código de respuesta 200\r", + "pm.test(\"Status code is 200\", function () {\r", + " pm.response.to.have.status(200);\r", + "});\r", + "" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{url}}/{{namePokemon}}", + "host": [ + "{{url}}" + ], + "path": [ + "{{namePokemon}}" + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ] + }, + { + "name": "Escenarios_Negativos", + "item": [ + { + "name": "NombreIncorrectoPokemon", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "let myResponse = pm.response.json() //Constante Gobal para guardar el json de respuesta\r", + "//Caso de prueba visto en mentoría.\r", + "pm.test( \"Valida nombre de Pokémon\", () => {\r", + " let pokemon = \"Charmander\"\r", + " if(myResponse.name === pokemon){\r", + " pm.test(\"el nombre es: \" + pokemon)\r", + " } else {\r", + " pm.test(\"El nombre no es \" + pokemon + \" el nombre correcto es \"+ pm.environment.get(\"namePokemon\"))\r", + " }\r", + "});\r", + "\r", + "\r", + "" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.environment.set(\"namePokemon\", \"metapod\"); //Se genero la variable de entorno con el nombre del pokemon favorito" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{url}}/{{namePokemon}}", + "host": [ + "{{url}}" + ], + "path": [ + "{{namePokemon}}" + ] + } + }, + "response": [] + }, + { + "name": "EscenarioNegativo404", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "pm.environment.set(\"namePokemon\", \"charmand\"); //Se genero la variable de entorno con el nombre del pokemon favorito" + ], + "type": "text/javascript" + } + }, + { + "listen": "test", + "script": { + "exec": [ + "//var myResponse = pm.response.json()\r", + "\r", + "pm.test(\"Status code is 404\", function () {\r", + " pm.response.to.have.status(404);\r", + "});\r", + "\r", + "pm.test(\"El body es \" + pm.response.status, () => {\r", + " console.log(pm.response.status)\r", + " pm.expect(pm.response.status).to.equal(\"Not Found\")\r", + "})\r", + "\r", + "\r", + "//Limpiar Variables de entorno\r", + "pm.environment.unset(\"move_name\");\r", + "pm.environment.unset(\"move_url\");" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{url}}/{{namePokemon}}", + "host": [ + "{{url}}" + ], + "path": [ + "{{namePokemon}}" + ] + } + }, + "response": [] + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "", + "//Validar tiempo de respuesta", + "pm.test(\"El tiempo de respuesta es 700ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(700);", + "});" + ] + } + } + ] +} \ No newline at end of file