Skip to content

Feature/test get request #281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: API Tests
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Newman
run: npm install -g newman
- name: Run tests
run: npm test
7 changes: 7 additions & 0 deletions .replit
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
run = "node index.js"
modules = ["nodejs-20"]
[nix]
channel = "stable-24_05"

[deployment]
run = ["sh", "-c", "node index.js"]
60 changes: 60 additions & 0 deletions API Tareas.postman_collection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"info": {
"_postman_id": "475a70c8-9bec-4f94-a276-05eceb9145c4",
"name": "API Tareas",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "29823705"
},
"item": [
{
"name": "Consultar tarea",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://jsonplaceholder.typicode.com/todos/1",
"protocol": "https",
"host": [
"jsonplaceholder",
"typicode",
"com"
],
"path": [
"todos",
"1"
]
}
},
"response": []
},
{
"name": "Crear tarea",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"title\": \"Nueva tarea\",\r\n \"body\": \"Descripción de la tarea\",\r\n \"userId\": 1\r\n}\r\n",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://jsonplaceholder.typicode.com/posts",
"protocol": "https",
"host": [
"jsonplaceholder",
"typicode",
"com"
],
"path": [
"posts"
]
}
},
"response": []
}
]
}
15 changes: 15 additions & 0 deletions Entorno de pruebas.postman_environment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"id": "3f785452-82ae-48a0-a8e0-787f6621c3e2",
"name": "Entorno de pruebas",
"values": [
{
"key": "base_url",
"value": "https://jsonplaceholder.typicode.com",
"type": "default",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2025-06-05T21:09:12.147Z",
"_postman_exported_using": "Postman/11.48.4"
}
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "api-tests",
"version": "1.0.0",
"description": "Automatización de pruebas API con Newman",
"main": "index.js",
"scripts": {
"test": "newman run API\\ Tareas.postman_collection.json -e Entorno\\ de\\ pruebas.postman_environment.json"
},
"author": "Rigoberto Franco",
"license": "ISC",
"dependencies": {}
}