Skip to content

Commit

Permalink
K6 Generator - Support for extracting parameter examples & minor fixes
Browse files Browse the repository at this point in the history
Fixed indentation
  • Loading branch information
ideas-into-software committed Jun 17, 2021
1 parent 5ea2dd0 commit c32657a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function() {
{{#requestGroups}}
group("{{{groupName}}}", () => {
{{#variables}}
let {{{key}}} = {{#lambda.handleParamValue}}{{value}}{{/lambda.handleParamValue}}
let {{{key}}} = {{#lambda.handleParamValue}}{{value}}{{/lambda.handleParamValue}}
{{/variables}}
{{#requests}}
{{#-first}}
Expand Down
16 changes: 8 additions & 8 deletions samples/client/petstore/k6/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function() {
sleep(SLEEP_DURATION);
});
group("/pet/findByStatus", () => {
let status = 'TODO_EDIT_THE_STATUS'; // specify value as there is no example value for this parameter in OpenAPI spec
let status = 'TODO_EDIT_THE_STATUS'; // specify value as there is no example value for this parameter in OpenAPI spec
let url = BASE_URL + `/pet/findByStatus?status=${status}`;
// Request No. 1
let request = http.get(url);
Expand All @@ -49,7 +49,7 @@ export default function() {
sleep(SLEEP_DURATION);
});
group("/pet/findByTags", () => {
let tags = 'TODO_EDIT_THE_TAGS'; // specify value as there is no example value for this parameter in OpenAPI spec
let tags = 'TODO_EDIT_THE_TAGS'; // specify value as there is no example value for this parameter in OpenAPI spec
let url = BASE_URL + `/pet/findByTags?tags=${tags}`;
// Request No. 1
let request = http.get(url);
Expand All @@ -59,7 +59,7 @@ export default function() {
sleep(SLEEP_DURATION);
});
group("/pet/{petId}", () => {
let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec
let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec
let url = BASE_URL + `/pet/${petId}`;
// Request No. 1
let request = http.get(url);
Expand All @@ -81,7 +81,7 @@ export default function() {
sleep(SLEEP_DURATION);
});
group("/pet/{petId}/uploadImage", () => {
let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec
let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec
let url = BASE_URL + `/pet/${petId}/uploadImage`;
// Request No. 1
// TODO: edit the parameters of the request body.
Expand Down Expand Up @@ -115,7 +115,7 @@ export default function() {
sleep(SLEEP_DURATION);
});
group("/store/order/{orderId}", () => {
let orderId = 'TODO_EDIT_THE_ORDERID'; // specify value as there is no example value for this parameter in OpenAPI spec
let orderId = 'TODO_EDIT_THE_ORDERID'; // specify value as there is no example value for this parameter in OpenAPI spec
let url = BASE_URL + `/store/order/${orderId}`;
// Request No. 1
let request = http.get(url);
Expand Down Expand Up @@ -161,8 +161,8 @@ export default function() {
sleep(SLEEP_DURATION);
});
group("/user/login", () => {
let password = 'TODO_EDIT_THE_PASSWORD'; // specify value as there is no example value for this parameter in OpenAPI spec
let username = 'TODO_EDIT_THE_USERNAME'; // specify value as there is no example value for this parameter in OpenAPI spec
let password = 'TODO_EDIT_THE_PASSWORD'; // specify value as there is no example value for this parameter in OpenAPI spec
let username = 'TODO_EDIT_THE_USERNAME'; // specify value as there is no example value for this parameter in OpenAPI spec
let url = BASE_URL + `/user/login?username=${username}&password=${password}`;
// Request No. 1
let request = http.get(url);
Expand All @@ -181,7 +181,7 @@ export default function() {
sleep(SLEEP_DURATION);
});
group("/user/{username}", () => {
let username = 'TODO_EDIT_THE_USERNAME'; // specify value as there is no example value for this parameter in OpenAPI spec
let username = 'TODO_EDIT_THE_USERNAME'; // specify value as there is no example value for this parameter in OpenAPI spec
let url = BASE_URL + `/user/${username}`;
// Request No. 1
let request = http.get(url);
Expand Down

0 comments on commit c32657a

Please sign in to comment.