Skip to content
Merged
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
17 changes: 17 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Automated API tests using Postman CLI

on: push

jobs:
automated-api-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Postman CLI
run: |
curl -o- "https://dl-cli.pstmn.io/install/linux64.sh" | sh
- name: Login to Postman CLI
run: postman login --with-api-key ${{ secrets.POSTMAN_API_KEY }}
- name: Run API tests
run: |
postman collection run "53985486-8a1d272c-91a2-4d1a-821a-580657e228e6" -e "53985486-567ea8c5-6d8a-563e-bda9-9a55d5d37be3" --report-events
18 changes: 18 additions & 0 deletions .postman/resources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Use this workspace to collaborate
workspace:
id: 60516508-172c-45cd-8356-b979bc84300f

localResources:
specs:
- ../contract/index.yaml

# Each entry here maps a local resource to one or more corresponding objects in Postman Cloud

cloudResources:
environments:
../postman/environments/Stage.environment.yaml: 567ea8c5-6d8a-563e-bda9-9a55d5d37be3
../postman/environments/Staging Environment.environment.yaml: ae2364ed-fa80-59b7-8e3d-32deca3c4930
specs:
../contract/index.yaml: c2593f6a-1c62-4685-b7e4-ce3b9ff0e55c
collections:
../postman/collections/User API Integration Test Suite: 53985486-8a1d272c-91a2-4d1a-821a-580657e228e6
15 changes: 15 additions & 0 deletions .postman/workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This is a Workflow metadata file for defining entity relationships in this workspace.
# Each workflow defines relations between entities and may include optional behavior/settings.
# The Paths are relative to the .postman directory (avoid absolute paths).
# Keep relation entries explicit and avoid duplicate pairs within the same workflow.
# This file is declarative metadata and does not execute workflows by itself.
workflows:
syncSpecToCollection:
- spec: ../contract/index.yaml
collection: ../postman/collections/User API Integration Test Suite
options:
syncExamples: false
- spec: ../contract/index.yaml
collection: ../postman/collections/UserAPI-Documentation
options:
syncExamples: false
1 change: 1 addition & 0 deletions contract/index.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
openapi: 3.0.0
info:
description: this is for webinar
title: User API
version: 1.0.0
paths:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$kind: collection
description: this is for webinar
variables:
baseUrl: /
auth:
- id: 60a7486b-cb00-48ae-9e17-4b426c1e3d6d
type: apikey
name: apikey auth
credentials:
key: X-API-Key
value: "{{apiKey}}"
in: header
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$kind: collection
order: 1000
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$kind: collection
name: users
order: 2000
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
$kind: http-example
name: Error occurred
request:
url: "{{baseUrl}}/v1/users/login"
method: POST
headers:
- key: Content-Type
value: application/json
- key: Accept
value: application/json
- key: X-API-Key
value: <API Key>
description: "Added as a part of security scheme: apikey"
body:
type: json
content: |-
{
"username": "string",
"password": "string"
}
response:
statusCode: 500
statusText: Internal Server Error
headers:
Content-Type: application/json
body:
type: json
content: |-
{
"message": "string"
}
order: 6000
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
$kind: http-example
name: Error occurred
request:
url: "{{baseUrl}}/v1/users/login"
method: POST
headers:
- key: Content-Type
value: application/json
- key: Accept
value: application/json
- key: X-API-Key
value: <API Key>
description: "Added as a part of security scheme: apikey"
body:
type: json
content: |-
{
"username": "string",
"password": "string"
}
response:
statusCode: 500
statusText: Internal Server Error
headers:
Content-Type: application/json
body:
type: json
content: |-
{
"message": "string"
}
order: 9000
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
$kind: http-example
name: Error occurred
request:
url: "{{baseUrl}}/v1/users/login"
method: POST
headers:
- key: Content-Type
value: application/json
- key: Accept
value: application/json
- key: X-API-Key
value: <API Key>
description: "Added as a part of security scheme: apikey"
body:
type: json
content: |-
{
"username": "string",
"password": "string"
}
response:
statusCode: 500
statusText: Internal Server Error
headers:
Content-Type: application/json
body:
type: json
content: |-
{
"message": "string"
}
order: 12000
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
$kind: http-example
request:
url: "{{baseUrl}}/v1/users/login"
method: POST
headers:
- key: Content-Type
value: application/json
- key: Accept
value: application/json
- key: X-API-Key
value: <API Key>
description: "Added as a part of security scheme: apikey"
body:
type: json
content: |-
{
"username": "string",
"password": "string"
}
response:
statusCode: 500
statusText: Internal Server Error
headers:
Content-Type: application/json
body:
type: json
content: |-
{
"message": "string"
}
order: 3000
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
$kind: http-example
name: Unauthorized
request:
url: "{{baseUrl}}/v1/users/login"
method: POST
headers:
- key: Content-Type
value: application/json
- key: Accept
value: application/json
- key: X-API-Key
value: <API Key>
description: "Added as a part of security scheme: apikey"
body:
type: json
content: |-
{
"username": "string",
"password": "string"
}
response:
statusCode: 401
statusText: Unauthorized
headers:
Content-Type: application/json
body:
type: json
content: |-
{
"message": "string"
}
order: 5000
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
$kind: http-example
name: Unauthorized
request:
url: "{{baseUrl}}/v1/users/login"
method: POST
headers:
- key: Content-Type
value: application/json
- key: Accept
value: application/json
- key: X-API-Key
value: <API Key>
description: "Added as a part of security scheme: apikey"
body:
type: json
content: |-
{
"username": "string",
"password": "string"
}
response:
statusCode: 401
statusText: Unauthorized
headers:
Content-Type: application/json
body:
type: json
content: |-
{
"message": "string"
}
order: 8000
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
$kind: http-example
name: Unauthorized
request:
url: "{{baseUrl}}/v1/users/login"
method: POST
headers:
- key: Content-Type
value: application/json
- key: Accept
value: application/json
- key: X-API-Key
value: <API Key>
description: "Added as a part of security scheme: apikey"
body:
type: json
content: |-
{
"username": "string",
"password": "string"
}
response:
statusCode: 401
statusText: Unauthorized
headers:
Content-Type: application/json
body:
type: json
content: |-
{
"message": "string"
}
order: 11000
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
$kind: http-example
request:
url: "{{baseUrl}}/v1/users/login"
method: POST
headers:
- key: Content-Type
value: application/json
- key: Accept
value: application/json
- key: X-API-Key
value: <API Key>
description: "Added as a part of security scheme: apikey"
body:
type: json
content: |-
{
"username": "string",
"password": "string"
}
response:
statusCode: 401
statusText: Unauthorized
headers:
Content-Type: application/json
body:
type: json
content: |-
{
"message": "string"
}
order: 2000
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
$kind: http-example
name: User logged in successfully
request:
url: "{{baseUrl}}/v1/users/login"
method: POST
headers:
- key: Content-Type
value: application/json
- key: Accept
value: application/json
- key: X-API-Key
value: <API Key>
description: "Added as a part of security scheme: apikey"
body:
type: json
content: |-
{
"username": "string",
"password": "string"
}
response:
statusCode: 200
statusText: OK
headers:
Content-Type: application/json
body:
type: json
content: |-
{
"id": 1706,
"username": "string",
"token": "string"
}
order: 4000
Loading
Loading