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
11 changes: 11 additions & 0 deletions api_tests/scenario-bd4a05a554.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
creditCardNumber,creditCardBalance,dueDate,contactDetails.phoneNumber,contactDetails.email
1234567890123456,2000.65,2022-11-23,1234567890,john@example.com
2345678901234567,10000.00,2022-10-09,2345678901,paul@example.com
3456789012345678,5678.90,2022-12-31,3456789012,ringo@example.com
4567890123456789,1200.50,2022-11-30,4567890123,george@example.com
5678901234567890,7890.12,2022-10-29,5678901234,mick@example.com
6789012345678901,1234.56,2022-12-15,6789012345,keith@example.com
7890123456789012,3456.78,2022-12-24,7890123456,ronnie@example.com
8901234567890123,5400.00,2022-09-15,8901234567,charlie@example.com
9012345678901234,1050.75,2022-11-06,9012345678,freddy@example.com
0123456789012345,5000.00,2022-08-31,0123456789,brian@example.com
58 changes: 58 additions & 0 deletions api_tests/scenario-bd4a05a554.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# ********RoostGPT********

# Test generated by RoostGPT for test TDD-based-test using AI Type Azure Open AI and AI Model roost-gpt4-32k
#
# {
# background: null,
# rule: null,
# scenario: 'Arrange for a call to the user if the balance is unpaid and overdue\n' +
# ' Given there is an Unpaid and Overdue Credit Card balance\n' +
# ' When the client sends a POST request to "/api/creditCard/checkBalance" with the credit card balance, due date, and contact details\n' +
# ' Then the response status code should be 200\n' +
# ' And a call should be arranged to the user',
# title: 'Arrange for a call to the user if the balance is unpaid and overdue'
# }
#

# ********RoostGPT********
config:
target: "{{ $processEnvironment.API_HOST }}"
phases:
- duration: 60
arrivalRate: 20
payload:
path: "scenario-bd4a05a554.csv"
fields:
- "creditCardNumber"
- "creditCardBalance"
- "dueDate"
- "contactDetails"
skipHeader: true
plugins:
expect: {}

scenarios:
- name: "Arrange for a call to the user if the balance is unpaid and overdue"
flow:
# Fetches credit card due date and balance
- get:
url: "/creditCard/details?creditCardNumber={{ creditCardNumber }}"
headers:
Authorization: "Bearer {{$processEnvironment.AUTH_TOKEN}}"
expect:
- statusCode: 200
- hasProperty: "dueDate"
- hasProperty: "balance"
think: 1
# Arrange a call if balance is unpaid and overdue
- post:
url: "/creditCard/checkBalance"
json:
creditCardNumber: "{{ creditCardNumber }}"
dueDate: "{{ dueDate }}"
contactDetails: "{{ contactDetails }}"
headers:
Authorization: "Bearer {{$processEnvironment.AUTH_TOKEN}}"
expect:
- statusCode: 200
think: 1
11 changes: 11 additions & 0 deletions api_tests/scenario-ee492ced05.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
paymentAmount,creditCardNumber
785.09,4698306380556458
900.87,342143687602331
1023.48,5434267002836989
684.15,4482445716008898
805.65,5523496790336132
768.34,6286409820166267
852.78,8314176331606421
731.54,5040739054442256
920.11,9638460220933649
895.47,3218958342226583
53 changes: 53 additions & 0 deletions api_tests/scenario-ee492ced05.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# ********RoostGPT********

# Test generated by RoostGPT for test TDD-based-test using AI Type Azure Open AI and AI Model roost-gpt4-32k
#
# {
# background: null,
# rule: null,
# scenario: 'Update the card balance once payment is collected\n' +
# ' Given the system has started collecting payment and the payment is successful\n' +
# ' When the client sends a POST request to "/api/creditCard/payment" with the payment status\n' +
# ' Then the response status code should be 200\n' +
# ' And the card balance should be updated',
# title: 'Update the card balance once payment is collected'
# }
#

# ********RoostGPT********
config:
target: "{{ $processEnvironment.API_HOST }}"
plugins:
expect: {}
phases:
- duration: 60
arrivalRate: 20
payload:
path: "scenario-ee492ced05.csv"
fields:
- paymentAmount
- creditCardNumber
skipHeader: true
environments:
staging:
headers:
Authorization: "{{ $processEnvironment.AUTH_TOKEN }}"

scenarios:
- name: Update the card balance once payment is collected
flow:
- log: "System starts collecting payment and the payment is successful"
# POST payment details
- post:
url: "/creditCard/payment"
headers:
Content-Type: "application/json"
Authorization: "{{ $processEnvironment.AUTH_TOKEN }}"
json:
paymentAmount: "{{ paymentAmount }}"
creditCardNumber: "{{ creditCardNumber }}"
expect:
- statusCode: 200
- hasProperty: "balance"
think: 1
- log: "Card balance should be updated after payment is collected"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here output was cut in between. It should do get call as well to fetch the balance

11 changes: 11 additions & 0 deletions api_tests/scenario-f413ede025.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
creditCardNumber,creditCardCVV,creditCardExpiryDate
4512647819853456,564,2023-11-20
4768124569322145,456,2024-05-12
8945641237856321,368,2025-01-31
6234315789541237,294,2023-05-06
6874923156498102,716,2024-09-11
8749564132782459,326,2022-10-13
1549326874312897,150,2022-12-10
5687419325468921,972,2023-07-15
4568132789654,367,2025-03-25
9821456789135468,936,2026-02-18
47 changes: 47 additions & 0 deletions api_tests/scenario-f413ede025.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# ********RoostGPT********

# Test generated by RoostGPT for test TDD-based-test using AI Type Azure Open AI and AI Model roost-gpt4-32k
#
# {
# background: null,
# rule: null,
# scenario: 'Fetch the credit card due date and balance for a given credit card\n' +
# ' Given there are valid Credit Card details\n' +
# ' When the client sends a GET request to "/api/creditCard/details" with the credit card details\n' +
# ' Then the response status code should be 200\n' +
# ' And the response should contain the due date and balance',
# title: 'Fetch the credit card due date and balance for a given credit card'
# }
#

# ********RoostGPT********
config:
target: "{{ $processEnvironment.API_HOST }}/api"
plugins:
expect: {}
payload:
path: "scenario-f413ede025.csv"
fields:
- "creditCardNumber"
- "creditCardCVV"
- "creditCardExpiryDate"
skipHeader: true
phases:
- duration: 60
arrivalRate: 5
processor: "./processor.js"

scenarios:
- name: "Fetch the credit card due date and balance for a given credit card"
flow:
- log: "Executing scenario to fetch the credit card due date and balance"
- get:
url: "/creditCard/details?creditCardNumber={{ creditCardNumber }}&creditCardCVV={{ creditCardCVV }}&creditCardExpiryDate={{ creditCardExpiryDate }}"
headers:
Authorization: "{{ $processEnvironment.AUTH_TOKEN }}"
expect:
- statusCode: 200 # The response status code should be 200
- hasProperty: "dueDate" # The response should contain the due date
- hasProperty: "balance" # The response should contain the balance
- log: "Expecting a successful response with 200 status code and response body containing due date and balance"
- think: 1