diff --git a/api_tests/Create_a_new_product.yaml b/api_tests/Create_a_new_product.yaml new file mode 100644 index 00000000..b7b56c8c --- /dev/null +++ b/api_tests/Create_a_new_product.yaml @@ -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 diff --git a/api_tests/Get_a_product_by_ID.yaml b/api_tests/Get_a_product_by_ID.yaml new file mode 100644 index 00000000..2c101a98 --- /dev/null +++ b/api_tests/Get_a_product_by_ID.yaml @@ -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" diff --git a/api_tests/Get_all_products.yaml b/api_tests/Get_all_products.yaml new file mode 100644 index 00000000..ea3819af --- /dev/null +++ b/api_tests/Get_all_products.yaml @@ -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"