Skip to content
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

Mock example #2

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
bba439a
Add files via upload
sreepathysois May 5, 2023
26059ac
Add files via upload
sreepathysois May 5, 2023
eb5e08b
Delete plan.md
sreepathysois May 5, 2023
447a46a
Add files via upload
sreepathysois May 5, 2023
57b1d73
Delete Scheduler_OpenAPI_17042023_V3.json
sreepathysois May 5, 2023
75bc78b
Delete test.txt
sreepathysois May 5, 2023
72060ec
Update createaffiliationnew.feature
sreepathysois Jun 22, 2023
afaed4a
Update createalertschedulenew.feature
sreepathysois Jun 22, 2023
7fe2b4d
Update createappointmentnew.feature
sreepathysois Jun 22, 2023
0d12ebb
Update createlognew.feature
sreepathysois Jun 22, 2023
0f7dc8c
Update createmessagenew.feature
sreepathysois Jun 22, 2023
909276f
Update createnewentity.feature
sreepathysois Jun 22, 2023
96156c8
Update createnewevent.feature
sreepathysois Jun 22, 2023
4c11d82
Update createresourcenew.feature
sreepathysois Jun 22, 2023
d54874e
Update createsubscribernew.feature
sreepathysois Jun 22, 2023
64004b9
Update deleteaffiliationnew.feature
sreepathysois Jun 22, 2023
a2d76d8
Update deletealertschedulenew.feature
sreepathysois Jun 22, 2023
ceed753
Update deleteappointmentnew.feature
sreepathysois Jun 22, 2023
d26ce7b
Update deleteentity.feature
sreepathysois Jun 22, 2023
7e402e5
Update deleteevent.feature
sreepathysois Jun 22, 2023
bcade74
Update deletelognew.feature
sreepathysois Jun 22, 2023
dbb2ea6
Update deletemessagenew.feature
sreepathysois Jun 22, 2023
fa0bff3
Update deleteresourcenew.feature
sreepathysois Jun 22, 2023
a28e5e4
Update deletesubscribernew.feature
sreepathysois Jun 22, 2023
9aa9599
Update getaffiliationlistnew.feature
sreepathysois Jun 22, 2023
749a681
Update getalertschedulelistnew.feature
sreepathysois Jun 22, 2023
4e4a894
Update getappointmentlistnew.feature
sreepathysois Jun 22, 2023
d1a8ccd
Update getentitylistnew.feature
sreepathysois Jun 22, 2023
0f34c30
Update geteventlistnew.feature
sreepathysois Jun 22, 2023
dd5d836
Update geteventlistnew.feature
sreepathysois Jun 22, 2023
452817c
Update getloglistnew.feature
sreepathysois Jun 22, 2023
73f3c41
Update getmessagelistnew.feature
sreepathysois Jun 22, 2023
af5d32e
Update getresourceavailabalitydetailsnew.feature
sreepathysois Jun 22, 2023
8dc8ddb
Update getresourceavailabalitydetailsnew.feature
sreepathysois Jun 22, 2023
8ba7ae5
Update getresourcelistnew.feature
sreepathysois Jun 22, 2023
f573de3
Update getsubscriberlistnew.feature
sreepathysois Jun 22, 2023
07bfe02
Update updateaffiliationnew.feature
sreepathysois Jun 22, 2023
0a48f64
Update updatealertschedulenew.feature
sreepathysois Jun 22, 2023
d67c49e
Update updateappointmentnew.feature
sreepathysois Jun 22, 2023
30776a4
Update updateentitynew.feature
sreepathysois Jun 22, 2023
03ac6bb
Update updateevent.feature
sreepathysois Jun 22, 2023
256a34f
Update updatelognew.feature
sreepathysois Jun 22, 2023
81b4f6a
Update updatemessagenew.feature
sreepathysois Jun 22, 2023
f9eeb02
Update updateresourcenew.feature
sreepathysois Jun 22, 2023
bc1eff9
Update updatesubscribernew.feature
sreepathysois Jun 22, 2023
a2863d7
Create config.yml
sreepathysois Jul 22, 2023
4c9de22
Update config.yml
sreepathysois Jul 22, 2023
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
1 change: 0 additions & 1 deletion api/test.txt

This file was deleted.

27 changes: 27 additions & 0 deletions examples/mock/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: "3"
services:
mockoon:
image: mockoon/cli:latest
command: -d /data # this is where the change takes place
container_name: myapi
ports:
- "3000:3000"
networks:
demo:
volumes:
- type: bind
source: ../../api/Scheduler_OpenAPI_17042023_V3.json
target: /data
pytest:
build:
context: ../../test/.
container_name: pytest
tty: true
stdin_open: true
networks:
demo:


networks:
demo:

8 changes: 8 additions & 0 deletions test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#FROM joyzoursky/python-chromedriver:latest
#FROM qnib/pytest
FROM python:3.8
COPY requirnments.txt requirnments.txt
RUN pip3 install -r requirnments.txt
COPY . /test
WORKDIR /test/
CMD /bin/bash
43 changes: 43 additions & 0 deletions test/features/createaffiliationnew.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Feature: Create a new affiliation of Scheduler API

Gherkin feature files for GovStack Scheduler services

@smoke
Scenario Outline: Create a new affiliation for Scheduler API Smoke Test

Given the requestor Id is "healthngo1" with role as "healthworker" to create a new affiliation
When a POST request for an endpoint /affiliation/new/ is triggered to create new affiliation for scheduler block
Then the result should return affiliation Id as "1" for smoke testing
And response code of POST request is "200" for smoke testing



@unit @happyregression
Scenario Outline: Create a new affiliation for Scheduler API Unit and Regression Happy Testing

Given the requestor id is "<requestor_id>" with role as "<requestor_role>" to create an affiliation with its details "<resource_id>" "<entity_id>" for resource of category "<resource_category>" for a schedule on "<day_of_week>" from "<start_time>" to "<end_time>"
When a POST request for an endpoint /affiliation/new/ is triggered to create new affiliation for scheduler block
Then the result should return affiliation details like "<affiliation_id>" and "<affiliation_name>" for requested affiliation
And response code of POST request is "200"

Examples:
| requestor_id | requestor_role | resource_id | entity_id | resource_category | day_of_week | start_time | end_time | affiliation_name | affiliation_id |
| healthngo1 | healthworker | 12345 | 67890 | physician | monday | 09:00:00 | 17:00:00 | xyz hospital | 1 |


@unit @Negativeregression
Scenario Outline: Create a new affiliation for Scheduler API Unit and Regression Negative Testing

Given the invalid inputs for the requestor id is "<requestor_id>" with role as "<requestor_role>" to create an affiliation with its details "<resource_id>" "<entity_id>" for resource of category "<resource_category>" for a schedule on "<day_of_week>" from "<start_time>" to "<end_time>"
When a POST request for an endpoint /affiliation/new/ is triggered to create new affiliation for scheduler block
Then response code of negative testing POST request for invalid data is "<status_code>"



Examples:
| requestor_id | requestor_role | resource_id | entity_id | resource_category | day_of_week | start_time | end_time | status_code |
| healthngo1 | healthworker | 12345 | 67890 | physician | monday | 09:00:00 | 17:00:00 | 400 |
| healthngo1 | healthworker | 12345 | 67890 | physician | monday | 17:00:00 | 09:00:00 | 403 |
| healthngo1 | healthworker | resource | 67890 | nurse | monday | 17:00:00 | 09:00:00 | 404 |


42 changes: 42 additions & 0 deletions test/features/createalertschedulenew.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Feature: Create a new Alert Schedule for Management of Scheduler API

Gherkin feature files for GovStack Scheduler services

@smoke
Scenario Outline: Create a new Alert Schedule for Management of Scheduler API Smoke Test

Given the requestor Id is "healthngo1" with role as "healthworker" to create a new alert schedule
When a POST request for an endpoint /alert_schedule/new/ is triggered to create new alert schedule for scheduler block
Then the result should return alert schedule Id as "1" for smoke testing
And response code of POST request is "200" for smoke testing



@unit @happyregression
Scenario Outline: Create a new Alert Schedule for Management of Scheduler API Unit and Regression Happy Testing

Given the requestor id is "<requestor_id>" with role as "<requestor_role>" to create a new alert schedule with event "<event_id>" for "<target_category>" with "<message_id>" within a "<alert_datetime>"
When a POST request for an endpoint /alert_schedule/new/ is triggered to create new alert schedule for scheduler block
Then the result should return alert details like "<alert_schedule_name>" and "<alert_schedule_id>" for requested schedule
And response code of POST request is "200"

Examples:
| requestor_id | requestor_role | event_id | target_category | message_id | alert_datetime | alert_schedule_name | alert_schedule_id |
| healthngo1 | healthworker | 12345 | subscriber | 1 | 2018-02-15T09:00:00 | xyz hospital | 1 |


@unit @Negativeregression
Scenario Outline: Create a new Alert Schedule for Management of Scheduler API Unit and Regression Negative Testing

Given the invalid inputs for the requestor id is "<requestor_id>" with role as "<requestor_role>" to create a new alert schedule with event "<event_id>" for "<target_category>" with "<message_id>" within a "<alert_datetime>"
When a POST request for an endpoint /alert_schedule/new/ is triggered to create new alert schedule for scheduler block
Then response code of negative testing POST request for invalid data is "<status_code>"



Examples:
| requestor_id | requestor_role | event_id | target_category | message_id | alert_datetime | status_code |
| healthngo1 | healthworker | 12345 | subscriber | 1 | 2018-02-15T09:00:00| 400 |
| healthngo1 | healthworker | 12345 | subscriber | 1 | 2018-02-15T09:00:00| 403 |
| healthngo1 | healthworker |12345 | subscriber | 1 | 2018-02-15T09:00:00| 404 |

41 changes: 41 additions & 0 deletions test/features/createappointmentnew.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Feature: Create a new appointment of Scheduler API

Gherkin feature files for GovStack Scheduler services

@smoke
Scenario Outline: Create a new appointment of Scheduler API Smoke Test

Given the requestor Id is "healthngo1" with role as "healthworker" to create a new appointment
When a POST request for an endpoint /appointment/new/ is triggered to create new appointment for scheduler block
Then the result should return appointment Id as "67890" for smoke testing
And response code of POST request is "200" for smoke testing



@unit @happyregression
Scenario Outline: Create a new appointment of Scheduler API Unit and Regression Happy Testing

Given the requestor id is "<requestor_id>" with role as "<requestor_role>" to create a new appointment for an entity with "<entity_id>" and "<entity_type>" for participant of "<participant_type>" "<participant_id>" and "<participant_entity_id>" for a time period "<From>" till "<To>" with deadline "<deadline>"
When a POST request for an endpoint /appointment/new/ is triggered to create new appointment for scheduler block
Then the result should return appointment details like "<appointment_id>" and "<appointment_name>" for requested appointment
And response code of POST request is "200"

Examples:
| requestor_id | requestor_role | entity_id | entity_type | participant_type | participant_id | participant_entity_id | From | To | deadline | appointment_name | appointment_id |
| healthngo1 | healthworker | 1 | doctor_consultation | subscriber | 12345 | 67890 | 2018-02-15T11:00:00 | 2018-02-15T11:30:00 | 2018-02-15T11:10:00 | doctorconsultation | 1 |


@unit @Negativeregression
Scenario Outline: Create a new appointment of Scheduler API Unit and Regression Negative Testing

Given the invalid inputs for the requestor id is "<requestor_id>" with role as "<requestor_role>" to create a new appointment for an entity with "<entity_id>" and "<entity_type>" for participant of "<participant_type>" "<participant_id>" and "<participant_entity_id>" for a time period "<From>" till "<To>" with deadline "<deadline>"
When a POST request for an endpoint /appointment/new/ is triggered to create new appointment for scheduler block
Then response code of negative testing POST request for invalid data is "<status_code>"



Examples:
| requestor_id | requestor_role | entity_id | entity_type | participant_type | participant_id | participant_entity_id | From | To | deadline | status_code |
| healthngo1 | healthworker | 1 | doctor_consultation | subscriber | 12345 | 67890 | 2018-02-15T11:00:00 | 2018-03-15T11:30:00 | 2018-02-15T11:10:00 | 400 |
| healthngo1 | healthworker | 1 | doctor_consultation | subscriber | 12345 | 67890 | 2018-02-15T11:45:00 | 2018-02-15T11:30:00 | 2018-02-15T11:10:00 | 403 |
| healthngo1 | healthworker | 1 | doctor_consultation | subscriber | 12345 | 67890 | 2018-02-15T11:00:00 | 2018-07-15T11:30:00 | 2018-02-15T11:10:00 | 404 |
41 changes: 41 additions & 0 deletions test/features/createlognew.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Feature: Create a new Log of Scheduler API

Gherkin feature files for GovStack Scheduler services

@smoke
Scenario Outline: Create a new Log of Scheduler API Smoke Test

Given the requestor Id is "healthngo1" with role as "healthworker" to create a new log
When a POST request for an endpoint /log/new/ is triggered to create new log for scheduler block
Then the result should return log Id as "1" for smoke testing
And response code of POST request is "200" for smoke testing



@unit @happyregression
Scenario Outline: Create a new Log of Scheduler API Unit and Regression Happy Testing

Given the requestor id is "<requestor_id>" with role as "<requestor_role>" to create a log for role "<logger_role>" with its Id "<logger_id>" "<entity_id>" for category "<log_category>" from time period of "<datetime>" with data as "<log_data>"
When a POST request for an endpoint /log/new/ is triggered to create new log for scheduler block
Then the result should return log details like "<log_name>" and "<log_id>" for requested log
And response code of POST request is "200"

Examples:
| requestor_id | requestor_role | logger_role | logger_id | entity_id | log_category | datetime | log_data | log_name | log_id |
| healthngo1 | healthworker | resource | 1 | 67890 | attendence | 2018-02-15T11:00:00 | event_id:12345,subscriber_id:1,token:a2s3x2fer,status:attended | xyz hospital | 1 |


@unit @Negativeregression
Scenario Outline: Create a new Log of Scheduler API Unit and Regression Negative Testing

Given the invalid inputs for the requestor id is "<requestor_id>" with role as "<requestor_role>" to create a log for role "<logger_role>" with its Id "<logger_id>" "<entity_id>" for category "<log_category>" from time period of "<datetime>" with data as "<log_data>"
When a POST request for an endpoint /log/new/ is triggered to create new log for scheduler block
Then response code of negative testing POST request for invalid data is "<status_code>"



Examples:
| requestor_id | requestor_role | logger_role | logger_id | entity_id | log_category | datetime | log_data | status_code |
| healthngo1 | healthworker | resource | 1 | 67890 | attendence | 2018-02-15T11:00:00 | event_id:12345,subscriber_id:1,token:a2s3x2fer,status:attended | 400 |
| healthngo1 | healthworker | entity | 67890 | 67890 | attendence | 2018-02-15T11:00:00 | event_id:12345,subscriber_id:1,token:a2s3x2fer,status:attended | 403 |
| healthngo1 | healthworker | subscriber |1 | 67890 | attendence | 2018-02-15T11:00:00 | event_id:12345,subscriber_id:1,token:a2s3x2fer,status:attended | 404 |
43 changes: 43 additions & 0 deletions test/features/createmessagenew.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Feature: Create a new message of Scheduler API

Gherkin feature files for GovStack Scheduler services

@smoke
Scenario Outline: Create a new message of Scheduler API Smoke Test

Given the requestor Id is "healthngo1" with role as "healthworker" to create a new message
When a POST request for an endpoint /message/new/ is triggered to create new message for scheduler block
Then the result should return message Id as "1" for smoke testing
And response code of POST request is "200" for smoke testing



@unit @happyregression
Scenario Outline: Create a new message of Scheduler API Unit and Regression Happy Testing

Given the requestor id is "<requestor_id>" with role as "<requestor_role>" to create a message with details like "<entity_id>" "<category>" with message body as "<message_body>"
When a POST request for an endpoint /message/new/ is triggered to create new message for scheduler block
Then the result should return message details like "<message_name>" and "<message_id>" for requested message
And response code of POST request is "200"

Examples:
| requestor_id | requestor_role | entity_id | category | message_body | message_name | message_id |
| healthngo1 | healthworker | 67890 | reminder | you have a doctor consultatio today | xyz hospital | 1 |


@unit @Negativeregression
Scenario Outline: Create a new message of Scheduler API Unit and Regression Negative Testing

Given the invalid inputs for the requestor id is "<requestor_id>" with role as "<requestor_role>" to create a message with details like "<entity_id>" "<category>" with message body as "<message_body>"
When a POST request for an endpoint /message/new/ is triggered to create new message for scheduler block
Then response code of negative testing POST request for invalid data is "<status_code>"



Examples:
| requestor_id | requestor_role | entity_id | category | message_body | status_code |
| healthngo1 | healthworker | 67890 | reminder | you have a doctor consultatio today | 400 |
| healthngo1 | healthworker | 67890 | appointment | you have a doctor consultatio today | 403 |
| healthngo1 | healthworker | 67890 | invite | you have a doctor consultatio today | 404 |


42 changes: 42 additions & 0 deletions test/features/createnewentity.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Feature: Create a new entity of Scheduler API

Gherkin feature files for GovStack Scheduler services

@smoke
Scenario Outline: Create a new entity for Scheduler API Smoke Test

Given the requestor Id is "healthngo1" with role as "healthworker" to create a new entity
When a POST request for an endpoint /entity/new/ is triggered to create new entity for scheduler block
Then the result should return entity Id as "67890" for smoke testing
And response code of POST request is "200" for smoke testing



@unit @happyregression
Scenario Outline: Create a new entity for Scheduler API Unit and Regression Happy Testing

Given the requestor id is "<requestor_id>" with role as "<requestor_role>" to create a entity with name "<name>" for "<category>" with following details like "<phone>" "<email>" with "<website>"
When a POST request for an endpoint /entity/new/ is triggered to create new entity for scheduler block
Then the result should return entity details like "<entity_id>" and "<entity_name>" for requested entity
And response code of POST request is "200"

Examples:
| requestor_id | requestor_role | name | category |phone | email | website | entity_name | entity_id |
| healthngo1 | healthworker | practo | hospital | 9980555504 | abc@gmail.com | www.abc.com | hospital | 67890 |


@unit @Negativeregression
Scenario Outline: Create a new entity for Scheduler API Unit and Regression Negative Testing

Given the invalid inputs for the requestor id is "<requestor_id>" with role as "<requestor_role>" to create a entity with name "<name>" for "<category>" with following details like "<phone>" "<email>" with "<website>"
When a POST request for an endpoint /entity/new/ is triggered to create new entity for scheduler block
Then response code of negative testing POST request for invalid data is "<status_code>"



Examples:
| requestor_id | requestor_role | name | category | phone | email | website | status_code |
| healthngo1 | healthworker | practo | hospital | 9980555504 | sree@gmail.com | http://alert.com | 400 |
| healthngo1 | healthworker | practo | education | 9980555504 | sree@gmail.com | http://alert.com | 403 |
| healthngo1 | healthworker | practo | agriculture | 9980555504 | sree@gmail.com | http://alert.com | 404 |

42 changes: 42 additions & 0 deletions test/features/createnewevent.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Feature: Create a new event of Scheduler API

Gherkin feature files for GovStack Scheduler services

@smoke
Scenario Outline: Create a new event for Scheduler API Smoke Test

Given the requestor is "healthngoadmin1" with role as "healthworker" to create a new event
When a POST request for an endpoint /event/new is triggered to create new event for scheduler block
Then response code of POST request is "200" for smoke testing



@unit @happyregression
Scenario Outline: Create a new event for Scheduler API Unit and Regression Happy Testing

Given the requestor is "<requestor_id>" with role as "healthworker" to create a new event with following details like "<name>" "<category>" "<host_entity_id>" for a period "<From>" till "<To>" for a venue in "<street>" "<building>" "<area>" with "<lat>" "<long>"
When a POST request for an endpoint /event/new is triggered to create new event for scheduler block
Then the result should return event details as "<event_name>" "<event_id>" for requested event
And response code of POST request is "200"


Examples:
| requestor_id | requestor_role | name | category | host_entity_id | From | To | street | building | area | lat | long | event_name | event_id |
| healthngoadmin1 | healthworker |doctor_consultation | opd_physician_consultation | 67890 | 2018-02-15T11:00:00 | 2018-02-15T11:30:00 | 7th | xyx | wilsongarden | 0.1 | 0.2 |doctorconsultation | 4524458935 |


@unit @Negativeregression
Scenario Outline: Create a new event for Scheduler API Unit and Regression Negative Testing

Given the invalid inputs for the requestor is "<requestor_id>" with role as "healthworker" to create a new event with following details like "<name>" "<category>" "<host_entity_id>" for a period "<From>" till "<To>" for a venue in "<street>" "<building>" "<area>" with "<lat>" "<long>"
When a POST request for an endpoint /event/new is triggered to create new event for scheduler block
Then response code of negative testing POST request for error is "<status_code>"


Examples:
| requestor_id | requestor_role | name | category | host_entity_id | From | To | street | building | area | lat | long | status_code |
| healthngoadmin1 | healthworker | doctor_consultation | opd_physician_consultation | 67890 | 2018-02-15T11:00:00 | 2018-02-15T11:30:00 | 7th | xyz | manipal | 0.1 | 0.2 | 404 |
| healthngoadmin1 | healthworker | doctor_consultation | opd_physician_consultation | 67890 | 2018-02-15T11:00:00 | 2018-02-15T11:30:00 | 7th | xyz | manipal | 0.1 | 0.2 | 403 |
| healthngoadmin1 | healthworker |doctor_consultation | opd_physician_consultation | 67890 | 2018-02-15T11:00:00 | 2018-02-15T11:30:00 | 7th | xyz | manipal | 0.1 | 0.2 |400 |


Loading