Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions api_tests/Create_a_new_product.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Test generated by RoostGPT for test dm-integration-test using AI Type Open AI and AI Model gpt-4

config:
target: "{{ $processEnvironment.SERVER_URL }}"
phases:
- duration: 60
arrivalRate: 20

scenarios:

- name: "Create a new product"
comment: "This scenario tests the creation of a new product."
flow:
- post:
url: "/products"
headers:
Content-Type: "application/json"
json:
name: "Test Product"
description: "This is a test product."
price: 10.0
capture:
- json: "$.id"
as: "productId"
expect:
- statusCode: 200
- hasProperty: "name"
- hasProperty: "description"
- hasProperty: "price"
- equals:
- "{{ name }}"
- "Test Product"
- equals:
- "{{ description }}"
- "This is a test product."
- equals:
- "{{ price }}"
- 10.0

- name: "Retrieve a product by ID"
comment: "This scenario tests the retrieval of a product by its ID."
flow:
- get:
url: "/products/{{ productId }}"
expect:
- statusCode: 200
- hasProperty: "name"
- hasProperty: "description"
- hasProperty: "price"
- equals:
- "{{ name }}"
- "Test Product"
- equals:
- "{{ description }}"
- "This is a test product."
- equals:
- "{{ price }}"
- 10.0
36 changes: 36 additions & 0 deletions api_tests/Get_a_product_by_ID.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Test generated by RoostGPT for test dm-integration-test using AI Type Open AI and AI Model gpt-4

config:
target: "{{ $processEnvironment.SERVER_URL }}/api"
phases:
- duration: 60
arrivalRate: 20
scenarios:
- name: "Get a product by ID"
comment: "This scenario tests the retrieval of a product by its ID. The expected outcome is a successful operation with a response status code of 200, and the returned product should have the same ID as requested."
flow:
- get:
url: "/products/1"
headers:
- content-type: "application/json"
expect:
- statusCode: 200
- hasProperty: "id"
- equals:
- "id"
- 1
- hasProperty: "name"
- hasProperty: "description"
- hasProperty: "price"
- isType:
- "id"
- "integer"
- isType:
- "name"
- "string"
- isType:
- "description"
- "string"
- isType:
- "price"
- "integer"
47 changes: 47 additions & 0 deletions api_tests/Get_all_products.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Test generated by RoostGPT for test dm-integration-test using AI Type Open AI and AI Model gpt-4

config:
target: "{{ $processEnvironment.SERVER_URL }}/api"
phases:
- duration: 60
arrivalRate: 20
scenarios:
- name: "Get all products"
flow:
- get:
url: "/products"
headers:
Content-Type: "application/json"
capture:
- json: "$[*]"
as: "products"
expect:
- statusCode: 200
- equals:
- jsonPath: "$[*]"
value: []
- log: "Received all products successfully"
- name: "Validate product structure"
flow:
- get:
url: "/products"
headers:
Content-Type: "application/json"
capture:
- json: "$[0]"
as: "product"
expect:
- statusCode: 200
- hasProperty:
- jsonPath: "$[0]"
property: "id"
- hasProperty:
- jsonPath: "$[0]"
property: "name"
- hasProperty:
- jsonPath: "$[0]"
property: "description"
- hasProperty:
- jsonPath: "$[0]"
property: "price"
- log: "Product structure validated successfully"