-
Notifications
You must be signed in to change notification settings - Fork 42
test: introduced bruno collections for API Flows testing #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
test: introduced bruno collections for API Flows testing #489
Conversation
| } | ||
|
|
||
| put { | ||
| url: {{baseUrl}}/api/platform/v1/mentors/:mentorId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an automated way to populate the bruno collection in an openAPI format via the gradle build plugin ( similar to what we have done for generating the postman collection), not sure if that can help you import the endpoints quicker ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately (bc I also got excited with that idea) I don't think openapi-generator supports Bruno, as neither their README nor the languages folder list it :(
We can be creative and parse the OpenAPI ourselves via a custom script and re-populate the Bruno URLs or do it manually, but either approach seems too much for this PR...
|
|
||
| Mentor creation → Get Mentors and validate if the mentor was created → Update Mentor data → Get Mentors and validate if the mentor was updated → Delete Mentor → Get Mentors and validate if the mentor was deleted | ||
|
|
||
| **Run a Folder and Generate HRML Report** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Despite the suggestion, maybe worth to explain why such a report is useful?
| **Run a Folder and Generate HRML Report** | |
| **Run a Folder and Generate HTML Report** |
| 3. Give the request a clear, descriptive name | ||
| 4. Select the HTTP method and configure the endpoint, headers, and body | ||
| 5. Use environment variables (e.g. {{baseUrl}}, {{mentorId}}) instead of hardcoded values | ||
| 6. Use faker built-in faker library to generate realistic data for payloads |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This item-6 deserves some pointers to articles or how-to... are there some available?
| 3. Name the folder after the business flow or feature | ||
| 4. Example: `Mentee Registration & Approval Flow`, `Matching Flow` | ||
| 5. Add requests in the order they should be executed | ||
| 6. Ensure each request can be run sequentially as part of a folder execution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth adding a stage in the CI to run the folder via CLI so we know when it breaks?
| 6. Ensure each request can be run sequentially as part of a folder execution | |
| 6. Ensure each request can be run sequentially as part of a folder execution by running the whole folder and making sure the HTML report is generated |
|
|
||
| ### Prerequisites | ||
| Before using this flow, make sure you have: | ||
| 1. Bruno installed: https://www.usebruno.com/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe 3. would be npm install -g @usebruno/cli (that is only seen below) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we create package.json or dependencies so we could just execute npm install?
|
|
||
| **Run a Folder and Generate HRML Report** | ||
|
|
||
| 1. Install Bruno CLI: `npm install -g @usebruno/cli` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe step 0 would be to put up the application in docker?
Actually could you test again, the PR was merged with the fix ;) |
| @@ -0,0 +1,39 @@ | |||
| meta { | |||
| name: GET list of mentors and verify that mentor is created | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering if tis the convention of use files with spaces in Bruno. For me it is a bit confuse 🙈
| @@ -0,0 +1,9 @@ | |||
| { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this .DS_Store to gitignore, they are mac metadata files and they should not be pushed to git
| **Adding a New Request** | ||
| 1. In Bruno, right-click the target folder | ||
| 2. Select New Request | ||
| 3. Give the request a clear, descriptive name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this step necessary to have spaces?
GET list of mentors and verify that mentor is deleted.bru
or could be like this:
get_active_mentors_and_delete_mentor.bru
Description
Bruno is a fast, Git-friendly API client (think Postman, but local-first and text-based). This flow is designed so the whole team can run the same requests with minimal setup and predictable results. One of the main advantages for our team is the fact that it is easy to collaborate and version control our test cases and flows.
In this PR I implemented one test flow as an example:
Mentor creation → Get Mentors and validate if the mentor was created → Update Mentor data → Get Mentors and validate if the mentor was updated → Delete Mentor → Get Mentors and validate if the mentor was deleted
For more information, please refer to the updated documentation in README.md
Note: PUT /mentor doesn't work properly for now, since there was a bug, will be fixed soon.
Screenshots
Report in html:


Pull request checklist
Please check if your PR fulfills the following requirements: