From 170ed0c7a8040554667d3f96e54998dbe6245a5b Mon Sep 17 00:00:00 2001 From: Tanvir Alam Shihab Date: Sun, 9 Aug 2026 12:31:42 +0600 Subject: [PATCH 1/7] Refactor CI/CD Pipeline : devs-> only run CI and che ck API testing, Release-> merge all the devs update and run CI and check API Testing, Main-> run CI and CD. . and Upload Shihab API Testing File --- .github/workflows/ci-cd.yml | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 5aff4c4..06aa84a 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -1,12 +1,37 @@ -name: Initial CI/CD Pipeline +name: CI/CD Pipeline (Test & Deploy) on: push: - branches: [ "main" ] + branches: [ "main", "release", "devs" ] jobs: - build-and-deploy: + test: + name: Run API Tests runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install Newman + run: npm install -g newman + + - name: Run all Postman collections + run: | + for file in collections/*.json; do + echo "Running $file" + newman run "$file" + done + + deploy: + name: Build & Deploy to Azure + runs-on: ubuntu-latest + needs: test + if: github.ref == 'refs/heads/main' steps: - name: Checkout Code uses: actions/checkout@v4 From b5dc060a81e1651b8019f30998c84626f24718f4 Mon Sep 17 00:00:00 2001 From: Tanvir Alam Shihab Date: Sun, 9 Aug 2026 12:33:32 +0600 Subject: [PATCH 2/7] Delete api-test.yml --- .github/workflows/api-tests.yml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 .github/workflows/api-tests.yml diff --git a/.github/workflows/api-tests.yml b/.github/workflows/api-tests.yml deleted file mode 100644 index d294b06..0000000 --- a/.github/workflows/api-tests.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: API Tests - -on: - push: - branches: - - release - - main - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - - - run: npm install -g newman - - - name: Run all Postman collections - run: | - for file in collections/*.json; do - echo "Running $file" - newman run "$file" - done From 5e06798e955862ee81950013cee68423c64df02e Mon Sep 17 00:00:00 2001 From: Tanvir Alam Shihab Date: Sun, 9 Aug 2026 12:34:06 +0600 Subject: [PATCH 3/7] Add Shihab API Testing JSON File --- collections/api_testing_shihab.json | 2035 +++++++++++++++++++++++++++ 1 file changed, 2035 insertions(+) create mode 100644 collections/api_testing_shihab.json diff --git a/collections/api_testing_shihab.json b/collections/api_testing_shihab.json new file mode 100644 index 0000000..00e870f --- /dev/null +++ b/collections/api_testing_shihab.json @@ -0,0 +1,2035 @@ +{ + "info": { + "_postman_id": "b23df5e4-7b6e-48f7-b401-3c49d74ec758", + "name": "Shihab's 50 API Tests (JSONPlaceholder)", + "description": "50 API tests for Lab 02 CI/CD Assignment", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "Posts", + "item": [ + { + "name": "Get Posts 1", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/posts/1", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "posts", + "1" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Posts 2", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/posts/2", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "posts", + "2" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Posts 3", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/posts/3", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "posts", + "3" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Posts 4", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/posts/4", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "posts", + "4" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Posts 5", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/posts/5", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "posts", + "5" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Posts 6", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/posts/6", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "posts", + "6" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Posts 7", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/posts/7", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "posts", + "7" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Posts 8", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/posts/8", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "posts", + "8" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Posts 9", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/posts/9", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "posts", + "9" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Posts 10", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/posts/10", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "posts", + "10" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + } + ] + }, + { + "name": "Comments", + "item": [ + { + "name": "Get Comments 1", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/comments/1", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "comments", + "1" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Comments 2", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/comments/2", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "comments", + "2" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Comments 3", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/comments/3", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "comments", + "3" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Comments 4", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/comments/4", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "comments", + "4" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Comments 5", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/comments/5", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "comments", + "5" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Comments 6", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/comments/6", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "comments", + "6" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Comments 7", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/comments/7", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "comments", + "7" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Comments 8", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/comments/8", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "comments", + "8" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Comments 9", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/comments/9", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "comments", + "9" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Comments 10", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/comments/10", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "comments", + "10" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + } + ] + }, + { + "name": "Albums", + "item": [ + { + "name": "Get Albums 1", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/albums/1", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "albums", + "1" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Albums 2", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/albums/2", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "albums", + "2" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Albums 3", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/albums/3", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "albums", + "3" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Albums 4", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/albums/4", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "albums", + "4" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Albums 5", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/albums/5", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "albums", + "5" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Albums 6", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/albums/6", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "albums", + "6" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Albums 7", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/albums/7", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "albums", + "7" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Albums 8", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/albums/8", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "albums", + "8" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Albums 9", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/albums/9", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "albums", + "9" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Albums 10", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/albums/10", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "albums", + "10" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + } + ] + }, + { + "name": "Photos", + "item": [ + { + "name": "Get Photos 1", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/photos/1", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "photos", + "1" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Photos 2", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/photos/2", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "photos", + "2" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Photos 3", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/photos/3", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "photos", + "3" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Photos 4", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/photos/4", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "photos", + "4" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Photos 5", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/photos/5", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "photos", + "5" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Photos 6", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/photos/6", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "photos", + "6" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Photos 7", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/photos/7", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "photos", + "7" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Photos 8", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/photos/8", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "photos", + "8" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Photos 9", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/photos/9", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "photos", + "9" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Photos 10", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/photos/10", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "photos", + "10" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + } + ] + }, + { + "name": "Users", + "item": [ + { + "name": "Get Users 1", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/users/1", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "users", + "1" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Users 2", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/users/2", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "users", + "2" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Users 3", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/users/3", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "users", + "3" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Users 4", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/users/4", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "users", + "4" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Users 5", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/users/5", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "users", + "5" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Users 6", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/users/6", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "users", + "6" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Users 7", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/users/7", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "users", + "7" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Users 8", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/users/8", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "users", + "8" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Users 9", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/users/9", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "users", + "9" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + }, + { + "name": "Get Users 10", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "https://jsonplaceholder.typicode.com/users/10", + "protocol": "https", + "host": [ + "jsonplaceholder", + "typicode", + "com" + ], + "path": [ + "users", + "10" + ] + } + }, + "response": [], + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "pm.test(\"Response time is less than 1000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(1000);", + "});", + "pm.test(\"Response is valid JSON\", function () {", + " pm.response.to.be.json;", + "});" + ], + "type": "text/javascript" + } + } + ] + } + ] + } + ] +} \ No newline at end of file From 195f07e846ec75723709cc30dd8dd62e0c8f2cd9 Mon Sep 17 00:00:00 2001 From: taskifbin Date: Sun, 9 Aug 2026 13:39:39 +0600 Subject: [PATCH 4/7] Taskif testing --- collections/api-testing-taskif.json | 1298 +++++++++++++++++++++++++++ 1 file changed, 1298 insertions(+) create mode 100644 collections/api-testing-taskif.json diff --git a/collections/api-testing-taskif.json b/collections/api-testing-taskif.json new file mode 100644 index 0000000..e1a1e66 --- /dev/null +++ b/collections/api-testing-taskif.json @@ -0,0 +1,1298 @@ +{ + "info": { + "_postman_id": "dfc71368-e8ac-40b5-a127-fee6d908b74f", + "name": "FakeStore_Requests", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", + "_exporter_id": "57084251", + "_collection_link": "https://go.postman.co/collection/57084251-dfc71368-e8ac-40b5-a127-fee6d908b74f?source=collection_link" + }, + "item": [ + { + "name": "Authentication", + "item": [ + { + "name": "Login_Valid", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Login successful\", function () {", + " pm.response.to.have.status(200);", + " pm.environment.set(\"token\", pm.response.json().token);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"username\": \"mor_2314\",\n \"password\": \"83r5^_\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/login", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "Login_Invalid_Pass", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"username\": \"mor_2314\",\n \"password\": \"wrong\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/login", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "Login_Missing_User", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"username\": \"mor_2314\",\n \"password\": \"wrong\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/login", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "login" + ] + } + }, + "response": [] + }, + { + "name": "Auth_User_With_Token", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "GET", + "header": [], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/auth/user", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "user" + ] + } + }, + "response": [] + }, + { + "name": "Auth_User_No_Token", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/auth/user", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "auth", + "user" + ] + } + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "packages": {}, + "requests": {}, + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "packages": {}, + "requests": {}, + "exec": [ + "pm.environment.set(\"token\", pm.response.json().token);" + ] + } + } + ] + }, + { + "name": "Products API", + "item": [ + { + "name": "All_Products", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "response": [] + }, + { + "name": "Products_Limit_3", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products?limit=3", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ], + "query": [ + { + "key": "limit", + "value": "3" + } + ] + } + }, + "response": [] + }, + { + "name": "Products_Sort_Desc", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products?sort=desc", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ], + "query": [ + { + "key": "sort", + "value": "desc" + } + ] + } + }, + "response": [] + }, + { + "name": "All_Categories", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/categories", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "categories" + ] + } + }, + "response": [] + }, + { + "name": "Category_Electronics", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/categories", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "categories" + ] + } + }, + "response": [] + }, + { + "name": "Category_Jewelery", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/category/jewelery", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "category", + "jewelery" + ] + } + }, + "response": [] + }, + { + "name": "Category_Mens", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/category/men's clothing", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "category", + "men's clothing" + ] + } + }, + "response": [] + }, + { + "name": "Category_Womens", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/category/women's clothing", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "category", + "women's clothing" + ] + } + }, + "response": [] + }, + { + "name": "Product_ID_1", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/1", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "1" + ] + } + }, + "response": [] + }, + { + "name": "Product_ID_5", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/5", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "5" + ] + } + }, + "response": [] + }, + { + "name": "Product_Invalid_ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 404 Not Found\", function () {", + " pm.response.to.have.status(404);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/999", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "999" + ] + } + }, + "response": [] + }, + { + "name": "Create_Product", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"Test\",\n \"price\": 10,\n \"description\": \"desc\",\n \"image\": \"url\",\n \"category\": \"electronic\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "response": [] + }, + { + "name": "Product_No_Title", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"price\": 10\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products" + ] + } + }, + "response": [] + }, + { + "name": "Update_Product_1", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"title\": \"Test\",\n \"price\": 10,\n \"description\": \"desc\",\n \"image\": \"url\",\n \"category\": \"electronic\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products/1", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "1" + ] + } + }, + "response": [] + }, + { + "name": "Update_Product_1", + "request": { + "method": "PATCH", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"price\": 99.99\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/products/1", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "1" + ] + } + }, + "response": [] + }, + { + "name": "Product_1", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/1", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "1" + ] + } + }, + "response": [] + }, + { + "name": "Invalid_Product", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 404 Not Found\", function () {", + " pm.response.to.have.status(404);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/999", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "999" + ] + } + }, + "response": [] + }, + { + "name": "Invalid_Category", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/products/category/xyz", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "products", + "category", + "xyz" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Carts API", + "item": [ + { + "name": "All_Carts", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/carts", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "carts" + ] + } + }, + "response": [] + }, + { + "name": "Carts_Limit_2", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/carts?limit=2", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "carts" + ], + "query": [ + { + "key": "limit", + "value": "2" + } + ] + } + }, + "response": [] + }, + { + "name": "Carts_Sort_Desc", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/carts?sort=desc", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "carts" + ], + "query": [ + { + "key": "sort", + "value": "desc" + } + ] + } + }, + "response": [] + }, + { + "name": "Date_Range", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/carts?startdate=2020-01-01&enddate=2023-01-01", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "carts" + ], + "query": [ + { + "key": "startdate", + "value": "2020-01-01" + }, + { + "key": "enddate", + "value": "2023-01-01" + } + ] + } + }, + "response": [] + }, + { + "name": "Cart_ID_1", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/carts/1", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "carts", + "1" + ] + } + }, + "response": [] + }, + { + "name": "Cart_ID_5", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/carts/5", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "carts", + "5" + ] + } + }, + "response": [] + }, + { + "name": "Carts_By_User_1", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/carts/user/1", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "carts", + "user", + "1" + ] + } + }, + "response": [] + }, + { + "name": "Carts_By_User_3", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/carts/user/3", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "carts", + "user", + "3" + ] + } + }, + "response": [] + }, + { + "name": "Carts_Invalid_User", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/carts/user/999", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "carts", + "user", + "999" + ] + } + }, + "response": [] + }, + { + "name": "Invalid_Cart_ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 404 Not Found\", function () {", + " pm.response.to.have.status(404);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/carts/999", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "carts", + "999" + ] + } + }, + "response": [] + }, + { + "name": "Create_Cart", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"userId\": 1,\n \"date\": \"2023-01-01\",\n \"products\": [\n {\n \"productId\": 1,\n \"quantity\": 2\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/carts", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "carts" + ] + } + }, + "response": [] + }, + { + "name": "Cart_Empty_Body", + "request": { + "method": "POST", + "header": [], + "url": { + "raw": "{{baseUrl}}/carts", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "carts" + ] + } + }, + "response": [] + }, + { + "name": "Update_Cart_1", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"userId\": 1,\n \"date\": \"2023-01-01\",\n \"products\": [\n {\n \"productId\": 1,\n \"quantity\": 2\n }\n ]\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/carts/1", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "carts", + "1" + ] + } + }, + "response": [] + }, + { + "name": "Cart_1", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/carts/1", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "carts", + "1" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Users API", + "item": [ + { + "name": "All_Users", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users" + ] + } + }, + "response": [] + }, + { + "name": "Users_Limit_2", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/users?limit=2", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users" + ], + "query": [ + { + "key": "limit", + "value": "2" + } + ] + } + }, + "response": [] + }, + { + "name": "Users_Sort_Desc", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/users?sort=desc", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users" + ], + "query": [ + { + "key": "sort", + "value": "desc" + } + ] + } + }, + "response": [] + }, + { + "name": "User_ID_1", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/users/1", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + "1" + ] + } + }, + "response": [] + }, + { + "name": "User_ID_5", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/users/999", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + "999" + ] + } + }, + "response": [] + }, + { + "name": "User_Invalid_ID", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 404 Not Found\", function () {", + " pm.response.to.have.status(404);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{baseUrl}}/users/999", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + "999" + ] + } + }, + "response": [] + }, + { + "name": "Create_User", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"test@test.com\",\n \"username\": \"testu\",\n \"password\": \"123\",\n \"name\": {\n \"firstname\": \"T\",\n \"lastname\": \"T\"\n },\n \"address\": {\n \"city\": \"NY\",\n \"street\": \"1st\",\n \"number\": 1,\n \"zipcode\": \"10001\"\n },\n \"phone\": \"1234567890\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users" + ] + } + }, + "response": [] + }, + { + "name": "User_Missing_Email", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"username\": \"testu\",\n \"password\": \"123\",\n \"name\": {\n \"firstname\": \"T\",\n \"lastname\": \"T\"\n },\n \"address\": {\n \"city\": \"NY\",\n \"street\": \"1st\",\n \"number\": 1,\n \"zipcode\": \"10001\"\n },\n \"phone\": \"1234567890\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users" + ] + } + }, + "response": [] + }, + { + "name": "Update_User_1", + "request": { + "method": "PUT", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"email\": \"test@test.com\",\n \"username\": \"testu\",\n \"password\": \"123\",\n \"name\": {\n \"firstname\": \"T\",\n \"lastname\": \"T\"\n },\n \"address\": {\n \"city\": \"NY\",\n \"street\": \"1st\",\n \"number\": 1,\n \"zipcode\": \"10001\"\n },\n \"phone\": \"1234567890\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/1", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + "1" + ] + } + }, + "response": [] + }, + { + "name": "Update_User_1", + "request": { + "method": "PATCH", + "header": [], + "body": { + "mode": "raw", + "raw": "{\n \"phone\": \"9999999999\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users/1", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + "1" + ] + } + }, + "response": [] + }, + { + "name": "User_1", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/users/1", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + "1" + ] + } + }, + "response": [] + }, + { + "name": "Invalid_User", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "pm.test(\"Status code is 404 Not Found\", function () {", + " pm.response.to.have.status(404);", + "});" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{baseUrl}}/users/999", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users", + "999" + ] + } + }, + "response": [] + }, + { + "name": "TEST_Invalid_JSON_Format", + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "invalid json {", + "options": { + "raw": { + "language": "text" + } + } + }, + "url": { + "raw": "{{baseUrl}}/users", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "users" + ] + } + }, + "response": [] + } + ] + } + ], + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "token", + "type": "string" + } + ] + }, + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "packages": {}, + "requests": {}, + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "packages": {}, + "requests": {}, + "exec": [ + "pm.test(\"Response time is less than 3000ms\", function () {", + " pm.expect(pm.response.responseTime).to.be.below(3000);", + "});", + "", + "pm.test(\"Response is JSON\", function () {", + " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");", + "});" + ] + } + } + ] +} \ No newline at end of file From 58300b4e491fda5a81952e21dbfc213042825ab0 Mon Sep 17 00:00:00 2001 From: taskifbin Date: Sun, 9 Aug 2026 13:53:47 +0600 Subject: [PATCH 5/7] Fixed Json --- collections/api-testing-taskif.json | 128 ++++++++-------------------- 1 file changed, 35 insertions(+), 93 deletions(-) diff --git a/collections/api-testing-taskif.json b/collections/api-testing-taskif.json index e1a1e66..1fcf286 100644 --- a/collections/api-testing-taskif.json +++ b/collections/api-testing-taskif.json @@ -3,9 +3,20 @@ "_postman_id": "dfc71368-e8ac-40b5-a127-fee6d908b74f", "name": "FakeStore_Requests", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "_exporter_id": "57084251", - "_collection_link": "https://go.postman.co/collection/57084251-dfc71368-e8ac-40b5-a127-fee6d908b74f?source=collection_link" + "_exporter_id": "57084251" }, + "variable": [ + { + "key": "baseUrl", + "value": "https://fakestoreapi.com", + "type": "string" + }, + { + "key": "token", + "value": "", + "type": "string" + } + ], "item": [ { "name": "Authentication", @@ -19,7 +30,7 @@ "exec": [ "pm.test(\"Login successful\", function () {", " pm.response.to.have.status(200);", - " pm.environment.set(\"token\", pm.response.json().token);", + " pm.collectionVariables.set(\"token\", pm.response.json().token);", "});" ], "type": "text/javascript", @@ -102,7 +113,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"username\": \"mor_2314\",\n \"password\": \"wrong\"\n}", + "raw": "{\n \"password\": \"83r5^_\"\n}", "options": { "raw": { "language": "json" @@ -124,22 +135,6 @@ }, { "name": "Auth_User_With_Token", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "" - ], - "type": "text/javascript", - "packages": {}, - "requests": {} - } - } - ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, "request": { "auth": { "type": "bearer", @@ -153,15 +148,6 @@ }, "method": "GET", "header": [], - "body": { - "mode": "raw", - "raw": "", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { "raw": "{{baseUrl}}/auth/user", "host": [ @@ -193,30 +179,6 @@ }, "response": [] } - ], - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "packages": {}, - "requests": {}, - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "packages": {}, - "requests": {}, - "exec": [ - "pm.environment.set(\"token\", pm.response.json().token);" - ] - } - } ] }, { @@ -309,13 +271,14 @@ "method": "GET", "header": [], "url": { - "raw": "{{baseUrl}}/products/categories", + "raw": "{{baseUrl}}/products/category/electronics", "host": [ "{{baseUrl}}" ], "path": [ "products", - "categories" + "category", + "electronics" ] } }, @@ -346,14 +309,14 @@ "method": "GET", "header": [], "url": { - "raw": "{{baseUrl}}/products/category/men's clothing", + "raw": "{{baseUrl}}/products/category/men's%20clothing", "host": [ "{{baseUrl}}" ], "path": [ "products", "category", - "men's clothing" + "men's%20clothing" ] } }, @@ -365,14 +328,14 @@ "method": "GET", "header": [], "url": { - "raw": "{{baseUrl}}/products/category/women's clothing", + "raw": "{{baseUrl}}/products/category/women's%20clothing", "host": [ "{{baseUrl}}" ], "path": [ "products", "category", - "women's clothing" + "women's%20clothing" ] } }, @@ -454,7 +417,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"title\": \"Test\",\n \"price\": 10,\n \"description\": \"desc\",\n \"image\": \"url\",\n \"category\": \"electronic\"\n}", + "raw": "{\n \"title\": \"Test\",\n \"price\": 10,\n \"description\": \"desc\",\n \"image\": \"url\",\n \"category\": \"electronics\"\n}", "options": { "raw": { "language": "json" @@ -506,7 +469,7 @@ "header": [], "body": { "mode": "raw", - "raw": "{\n \"title\": \"Test\",\n \"price\": 10,\n \"description\": \"desc\",\n \"image\": \"url\",\n \"category\": \"electronic\"\n}", + "raw": "{\n \"title\": \"Test\",\n \"price\": 10,\n \"description\": \"desc\",\n \"image\": \"url\",\n \"category\": \"electronics\"\n}", "options": { "raw": { "language": "json" @@ -527,7 +490,7 @@ "response": [] }, { - "name": "Update_Product_1", + "name": "Patch_Product_1", "request": { "method": "PATCH", "header": [], @@ -554,7 +517,7 @@ "response": [] }, { - "name": "Product_1", + "name": "Delete_Product_1", "request": { "method": "DELETE", "header": [], @@ -915,7 +878,7 @@ "response": [] }, { - "name": "Cart_1", + "name": "Delete_Cart_1", "request": { "method": "DELETE", "header": [], @@ -1024,13 +987,13 @@ "method": "GET", "header": [], "url": { - "raw": "{{baseUrl}}/users/999", + "raw": "{{baseUrl}}/users/5", "host": [ "{{baseUrl}}" ], "path": [ "users", - "999" + "5" ] } }, @@ -1149,7 +1112,7 @@ "response": [] }, { - "name": "Update_User_1", + "name": "Patch_User_1", "request": { "method": "PATCH", "header": [], @@ -1176,7 +1139,7 @@ "response": [] }, { - "name": "User_1", + "name": "Delete_User_1", "request": { "method": "DELETE", "header": [], @@ -1255,34 +1218,10 @@ ] } ], - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "token", - "type": "string" - } - ] - }, "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "packages": {}, - "requests": {}, - "exec": [ - "" - ] - } - }, { "listen": "test", "script": { - "type": "text/javascript", - "packages": {}, - "requests": {}, "exec": [ "pm.test(\"Response time is less than 3000ms\", function () {", " pm.expect(pm.response.responseTime).to.be.below(3000);", @@ -1291,7 +1230,10 @@ "pm.test(\"Response is JSON\", function () {", " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");", "});" - ] + ], + "type": "text/javascript", + "packages": {}, + "requests": {} } } ] From cc09be48a80cb4e1fee684a973572e188dff35a3 Mon Sep 17 00:00:00 2001 From: Tanvir Alam Shihab Date: Sun, 9 Aug 2026 14:18:36 +0600 Subject: [PATCH 6/7] Checking Taskif API --- collections/api-testing-rohan.json => api-testing-rohan.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename collections/api-testing-rohan.json => api-testing-rohan.json (100%) diff --git a/collections/api-testing-rohan.json b/api-testing-rohan.json similarity index 100% rename from collections/api-testing-rohan.json rename to api-testing-rohan.json From dd4c8b0003cfcd3f1f3fc5e14195d545349e54b3 Mon Sep 17 00:00:00 2001 From: Tanvir Alam Shihab Date: Sun, 9 Aug 2026 14:22:36 +0600 Subject: [PATCH 7/7] Remove taskif api --- collections/api-testing-taskif.json => api-testing-taskif.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename collections/api-testing-taskif.json => api-testing-taskif.json (100%) diff --git a/collections/api-testing-taskif.json b/api-testing-taskif.json similarity index 100% rename from collections/api-testing-taskif.json rename to api-testing-taskif.json