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/CreateMyAccount.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Id,FirstName,LastName,DateOfBirth,Email,PhoneNumber
1,John,Doe,1990-02-15,johndoe@email.com,1234567890
2,Jane,Smith,1985-06-30,janesmith@email.com,0987654321
3,James,Bond,1960-11-15,jamesbond@email.com,1122334455
4,Emily,Johnson,1999-05-05,emilyjohnson@email.com,2233445566
5,Robert,Brown,1982-10-20,robertbrown@email.com,3344556677
6,Sarah,Williams,1975-03-25,sarahwilliams@email.com,4455667788
7,William,Jones,1994-07-10,williamjones@email.com,5566778899
8,Elizabeth,Miller,1988-12-18,elizabethmiller@email.com,6677889900
9,Joseph,Rodriguez,1972-04-21,josephrodriguez@email.com,7788990011
10,Jennifer,Garcia,1959-08-16,jennifergarcia@email.com,8899001122
63 changes: 63 additions & 0 deletions api_tests/CreateMyAccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# ********RoostGPT********

# Test generated by RoostGPT for test karateIntegration using AI Type Azure Open AI and AI Model roost-gpt4-32k
#
# ROOST_METHOD_HASH=dff35151d7
# ROOST_METHOD_SIG_HASH=3a7061432c
#
# ########## Scenario ##########
#
# {
# background: 'Given the base URL is "http://localhost:8080"',
# rule: null,
# scenario: 'Create my account \r\n' +
# ' When the client sends a POST request "/accounts" with the accounts_body payload\r\n' +
# ' Then create an account with the specified informatio\r\n' +
# ' And verify the account created using GET request for "/me"',
# title: 'Create my account'
# }
#

# ********RoostGPT********
config:
target: '{{$processEnvironment.API_HOST}}'
ensure:
p50: 200
p95: 200
plugins:
expect: {}
processor: "./my-functions.js"
environments:
dev:
target: 'http://localhost:8080'
http:
timeout: 10
payload:
path: "./CreateMyAccount.csv"
skipHeader: true
fields:
- "accounts_body"
scenarios:
- name: "Create my account"
flow:
- log: "Starting scenario: Create my account..."
- post:
headers:
Authorization: '{{$processEnvironment.AUTH_TOKEN}}'
url: "/accounts"
json:
accounts_body: "{{ accounts_body }}"
expect:
- statusCode: 201
- hasProperty: "accounts_body"
think: 1
- get:
headers:
Authorization: '{{$processEnvironment.AUTH_TOKEN}}'
url: "/me"
expect:
- statusCode: 200
- hasProperty: "accounts"
- hasProperty: "accounts.id"
- hasProperty: "accounts.created_at"
think: 1
11 changes: 11 additions & 0 deletions api_tests/CreateNewProduct.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
UserID,Name,Age,Email,City
1,John Doe,45,johndoe@email.com,New York
2,Jane Smith,37,janesmith@email.com,Chicago
3,Jim Brown,28,jimbrown@email.com,Houston
4,Jill Johnson,32,jilljohnson@email.com,Phoenix
5,Jack Wilson,39,jackwilson@email.com,Philadelphia
6,Julia Davis,25,juliadavis@email.com,San Antonio
7,Joseph Martinez,43,josephmartinez@email.com,San Diego
8,Jessica Garcia,34,jessicagarcia@email.com,Dallas
9,James Miller,30,jamesmiller@email.com,San Jose
10,Jennifer White,26,jenniferwhite@email.com,Austin
56 changes: 56 additions & 0 deletions api_tests/CreateNewProduct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# ********RoostGPT********

# Test generated by RoostGPT for test karateIntegration using AI Type Azure Open AI and AI Model roost-gpt4-32k
#
# ROOST_METHOD_HASH=cb57d42dd5
# ROOST_METHOD_SIG_HASH=29d644b4b5
#
# ########## Scenario ##########
#
# {
# background: 'Given the base URL is "http://localhost:8080"',
# rule: null,
# scenario: 'Create a new product\r\n' +
# ' Given the client provides the following product data:\r\n' +
# ' | name | description | price |\r\n' +
# ' | Test Product | This is a test product. | 10.0 |\r\n' +
# ' When the client sends a POST request to "/api/products"\r\n' +
# ' Then the saved product should not be null and its properties must correspond to those provided by client',
# title: 'Create a new product'
# }
#

# ********RoostGPT********
config:
target: "{{ $processEnvironment.API_HOST }}"
plugins:
expect: {}
payload:
path: "CreateNewProduct.csv"
skipHeader: true
fields:
- "name"
- "description"
- "price"

scenarios:
- name: "Create a new product"
flow:
- post:
url: "/api/products"
json:
name: "{{ name }}"
description: "{{ description }}"
price: "{{ price }}"
headers:
authorization: "{{ $processEnvironment.AUTH_TOKEN }}"
expect:
- statusCode: 200
- hasProperty: "productId"
- hasProperty: "name"
- equals: ["name", "{{ name }}"]
- hasProperty: "description"
- equals: ["description", "{{ description }}"]
- hasProperty: "price"
- equals: ["price", "{{ price }}"]
- think: 1
11 changes: 11 additions & 0 deletions api_tests/DeleteAuthorization.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Id,Name,Email,DateOfBirth,Address,PhoneNumber
1,John Doe,johndoe@email.com,1990-01-01,123 Main St,555-123-4567
2,Jane Smith,janesmith@email.com,1985-02-02,456 Elm St,555-987-6543
3,Jim Brown,jimbrown@email.com,1982-03-03,789 Pine St,555-654-3210
4,Jessica White,jessicawhite@email.com,1995-04-04,1011 Oak St,555-456-7890
5,Jacob Black,jacobblack@email.com,1988-05-05,1213 Cedar St,555-789-0123
6,Jennifer Green,jennifergreen@email.com,1993-06-06,1415 Birch St,555-321-0987
7,Joseph Blue,josephblue@email.com,1990-07-07,1617 Maple St,555-012-3456
8,Julia Red,juliared@email.com,1987-08-08,1819 Willow St,555-234-5678
9,Jeremy Yellow,jeremyyellow@email.com,1992-09-09,2021 Palm St,555-345-6789
10,Jasmine Indigo,jasmineindigo@email.com,1994-10-10,2223 Cherry St,555-567-8901
53 changes: 53 additions & 0 deletions api_tests/DeleteAuthorization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# ********RoostGPT********

# Test generated by RoostGPT for test karateIntegration using AI Type Azure Open AI and AI Model roost-gpt4-32k
#
# ROOST_METHOD_HASH=87771cdd6d
# ROOST_METHOD_SIG_HASH=0a68a12aee
#
# ########## Scenario ##########
#
# {
# background: 'Given the base URL is "http://localhost:8080"',
# rule: null,
# scenario: 'Delete authorization\r\n' +
# ' Given authorization ID\r\n' +
# ' When the client sends a DELETE request to "/authorizations/ID"\r\n' +
# ' Then the response status code should be 200 for a successful delete\r\n' +
# ' And the authorizations should not appear in GET request for "/authorizations"',
# title: 'Delete authorization'
# }
#

# ********RoostGPT********
config:
target: "{{ $processEnvironment.API_HOST }}"
plugins:
expect: {}
variables:
authorizationID: []
headers:
Authorization: "{{ $processEnvironment.AUTH_TOKEN }}"
payload:
path: "DeleteAuthorization.csv"
fields:
- authorizationID
scenarios:
- name: "Delete Authorization Scenario"
flow:
- get:
url: "/authorizations/{{ authorizationID }}"
expect:
- statusCode: 200
- think: 1
- delete:
url: "/authorizations/{{ authorizationID }}"
expect:
- statusCode: 200
log: "Successful authorization deletion."
- think: 1
- get:
url: "/authorizations/{{ authorizationID }}"
expect:
- statusCode: 404
log: "Authorization ID does not exist post deletion."
11 changes: 11 additions & 0 deletions api_tests/DeleteExistingProduct.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
koreUserId,botId,accountId,Authorization,token,err,err.message
user1,bot1,acc1,auth1,token1,err1,message1
user2,bot2,acc2,auth2,token2,err2,message2
user3,bot3,acc3,auth3,token3,err3,message3
user4,bot4,acc4,auth4,token4,err4,message4
user5,bot5,acc5,auth5,token5,err5,message5
user6,bot6,acc6,auth6,token6,err6,message6
user7,bot7,acc7,auth7,token7,err7,message7
user8,bot8,acc8,auth8,token8,err8,message8
user9,bot9,acc9,auth9,token9,err9,message9
user10,bot10,acc10,auth10,token10,err10,message10
75 changes: 75 additions & 0 deletions api_tests/DeleteExistingProduct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# ********RoostGPT********

# Test generated by RoostGPT for test karateIntegration using AI Type Azure Open AI and AI Model roost-gpt4-32k
#
# ROOST_METHOD_HASH=18802fa8c7
# ROOST_METHOD_SIG_HASH=fa0f325ff0
#
# ########## Scenario ##########
#
# {
# background: 'Given the base URL is "http://localhost:8080"',
# rule: null,
# scenario: 'Delete an existing product\r\n' +
# ' Given there is an existing product with ID 1\r\n' +
# ' When the client sends a DELETE request to "/api/products/1"\r\n' +
# ' Then the response status code should be 200\r\n' +
# ' And the product with ID 1 should no longer exist',
# title: 'Delete an existing product'
# }
#

# ********RoostGPT********
config:
target: "{{ $processEnvironment.API_HOST }}"
phases:
- duration: 60
arrivalRate: 20
payload:
path: "DeleteExistingProduct.csv"
fields:
- "productId"
plugins:
expect: {}

scenarios:
- name: "Delete an existing product"
flow:
- post:
url: "/authToken"
headers:
Authorization: "{{ $processEnvironment.AUTH_TOKEN }}"
koreUserId: "{{ $processEnvironment.KORE_USER_ID }}"
botId: "{{ $processEnvironment.BOT_ID }}"
accountId: "{{ $processEnvironment.ACCOUNT_ID }}"
expect:
- statusCode: 200
- hasProperty: "token"

- think: 1

- get:
url: "/GetAccountInfo"
headers:
Authorization: "{{ $processEnvironment.AUTH_TOKEN }}"
expect:
- statusCode: 200
- hasProperty: "productId"

- think: 1

- delete:
url: "/api/products/{{ productId }}"
headers:
Authorization: "{{ $processEnvironment.AUTH_TOKEN }}"
expect:
- statusCode: 200

- think: 1

- get:
url: "/GetAccountInfo"
headers:
Authorization: "{{ $processEnvironment.AUTH_TOKEN }}"
expect:
- statusCode: 404
11 changes: 11 additions & 0 deletions api_tests/GetAllProducts.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
id,firstName,lastName,email,birthDate,joinedDate,isActive
1,John,Doe,john.doe@gmail.com,1980-07-01,2020-01-01,true
2,Jane,Doe,jane.doe@gmail.com,1985-06-15,2021-02-15,true
3,Robert,Smith,robert.smith@gmail.com,1970-05-30,2019-03-15,true
4,Laura,Johnson,laura.johnson@gmail.com,1990-04-12,2019-06-12,false
5,Michael,Brown,michael.brown@gmail.com,1995-03-20,2021-01-20,true
6,Emily,Davis,emily.davis@gmail.com,1989-02-28,2019-07-20,false
7,James,Martin,james.martin@gmail.com,1975-08-01,2019-08-01,true
8,Jennifer,Thompson,jennifer.thompson@gmail.com,1992-09-01,2019-06-01,true
9,Patricia,Garcia,patricia.garcia@gmail.com,1986-10-02,2021-02-01,false
10,David,Anderson,david.anderson@gmail.com,1974-11-03,2019-05-25,true
59 changes: 59 additions & 0 deletions api_tests/GetAllProducts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# ********RoostGPT********

# Test generated by RoostGPT for test karateIntegration using AI Type Azure Open AI and AI Model roost-gpt4-32k
#
# ROOST_METHOD_HASH=102a7facd9
# ROOST_METHOD_SIG_HASH=b36dcf6e4b
#
# ########## Scenario ##########
#
# {
# background: 'Given the base URL is "http://localhost:8080"',
# rule: null,
# scenario: 'Get all products\r\n' +
# ' When the client sends a GET request "/api/products" to get the list of all products\r\n' +
# ' Then the list of products returned should be empty',
# title: 'Get all products'
# }
#

# ********RoostGPT********
config:
target: "{{ $processEnvironment.API_HOST }}"
plugins:
expect: {}
payload:
path: "GetAllProducts.csv"
fields:
- "productId"
- "productName"
processors: {}

scenarios:
- name: "Scenario: Get all products, expected to be empty"
flow:
# authorization
- post: "/authToken"
headers:
Authorization: "Bearer {{ $processEnvironment.AUTH_TOKEN }}"
expect:
- statusCode: 200
- hasProperty: 'token'
capture:
- json: "$.token"
as: "authToken"
log: "Got the auth token"
- think: 1

# request to api/products
- get: "/api/products"
headers:
Authorization: "Bearer {{ authToken }}"
expect:
- statusCode: 200
- hasProperty: 'products'
- equals:
- "products"
- []
log: "Product list returned is empty"
- think: 1
11 changes: 11 additions & 0 deletions api_tests/GetProductByID.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
id,username,email,dob,gender,city,state,zipcode
1,JohnDoe,johndoe@example.com,1980-12-12,Male,Los Angeles,California,90001
2,JaneDoe,janedoe@example.com,1985-05-15,Female,New York,New York,10001
3,RobertSmith,robertsmith@example.com,1990-08-30,Male,Chicago,Illinois,60616
4,EmilyJohnson,emilyjohnson@example.com,1987-07-24,Female,Houston,Texas,77001
5,MichaelBrown,michaelbrown@example.com,1982-03-14,Male,Philadelphia,Pennsylvania,19106
6,EmmaJones,emmajones@example.com,1989-11-18,Female,Phoenix,Arizona,85001
7,BrianMiller,brianmiller@example.com,1991-04-02,Male,San Diego,California,92101
8,SarahDavis,sarahdavis@example.com,1986-09-09,Female,Dallas,Texas,75201
9,JamesWilson,jameswilson@example.com,1983-06-19,Male,San Jose,California,95101
10,ElizabethTaylor,elizabethtaylor@example.com,1988-10-25,Female,Jacksonville,Florida,32201
Loading