Skip to content
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

Spike: Investigar que tipo de pruebas se hacen en APIs #23

Closed
airvzxf opened this issue Dec 27, 2023 · 1 comment
Closed

Spike: Investigar que tipo de pruebas se hacen en APIs #23

airvzxf opened this issue Dec 27, 2023 · 1 comment
Assignees
Labels
ci/cd Continuous Integration and Continued Deployment. programmer A computer programmer is a person who creates computer programs. qa Assure the product delivered by performance, design, reliability, and maintainability expectations. spike Activities such as exploration, architecture, infrastructure, research, design, and prototyping. tester A tester is a professional who tests software products and applications for quality assurance.

Comments

@airvzxf
Copy link
Collaborator

airvzxf commented Dec 27, 2023

Como desarrollador y tester,
quiero saber qué tipo pruebas (pruebas unitarias, pruebas de integración) se tienen que realizar en el framewok T3Stack, con respecto del API,
para que mis cambios mantengan el QA.

@airvzxf airvzxf added ci/cd Continuous Integration and Continued Deployment. spike Activities such as exploration, architecture, infrastructure, research, design, and prototyping. qa Assure the product delivered by performance, design, reliability, and maintainability expectations. programmer A computer programmer is a person who creates computer programs. tester A tester is a professional who tests software products and applications for quality assurance. labels Dec 27, 2023
@airvzxf airvzxf added this to the Development setup milestone Dec 27, 2023
@airvzxf airvzxf self-assigned this Jan 10, 2024
@airvzxf
Copy link
Collaborator Author

airvzxf commented Jan 10, 2024

Testing

White box testing [unit tests].

Official documentation: tRPC

Sample Integration Test

How to easily test your tRPC API

Testing: Unit test for API and mock Prisma.
Tech stack: Jest and other modules related to Jest.

Feat: Set up tests and add at least one example

It has both e2e tests with playwright and integration / (unit if u want that) with Vitest.

I also suggest tools such as Wallaby.js

Jest is ok. It's gotten better since Facebook let it go. Vitest has some interesting possibilities too. And of course, there are others, but Jest and Vitest seem to be the "React stack" darlings.

the stack has a lot of issues with jest and simply doesn't work. examples would be nice.
can we at least this answered:
T3 stack: Mock TRPC api with jest
https://stackoverflow.com/questions/76469501/t3-stack-mock-trpc-api-with-jest

Black box testing [integration tests].

Blog » API Testing » Top 12 Best API Testing Tools (for Developers) [2021]

RapidAPI Testing

RapidAPI is the world’s largest API marketplace with over 1 million developers and 10,000 APIs. RapidAPI Testing is a RapidAPI product that provides a functional API testing solution for creating and managing comprehensive API tests from development to deployment. Tests can be run for any type of API (including REST, SOAP, and GraphQL).

RapidAPI Testing offers:
- Comprehensive Testing
- Global Monitoring
- Seamless Integration

Pros
- Free to use up to 100,000 API Calls. Unlimited Tests.
- Quickly create comprehensive tests for deep API validation
- Continuously run tests to monitor APIs across all geographies
- Native integrations to RapidAPI Marketplace and RapidAPI Enterprise Hub (and now RapidAPI Design)
- Functional testing, performance testing, automated testing, and API Monitoring all in one product / SKU
- CI/CD Integration to GitHub, Jenkins, CircleCI, Travis, GitLab, and more
- Real-time alerts including SMS, email, and integrations to incident management systems
Cons
- None (to be fair, we are biased!)
Pricing: Free up to 100k API calls, unlimited API tests. For Enterprise and plans above 100,000 API calls see pricing plan details here.

Postman

Launched initially as a Chrome plugin, Postman has evolved to become a top-tier API testing tool. It is ideal for those who want to test APIs without coding in an integrated development environment using the same language as developers.

Pros
- Runs on Windows, Mac, Linux and Chrome Apps
- Boasts run, test, document, and monitoring features
- You don’t need to learn a new language to use this API testing tool

Cons
- Although the enterprise version is easy to set up and use, it comes with limited requests
- Pricing for enterprise is high
Pricing: Free, enterprise – $21/user/month

REST Assured

If you are looking for a framework to test REST services in Java, Rest-assured is a perfect choice.it is an open-source platform with Java Domain-specific language that makes testing REST services simpler.

Pros
- Users don’t need to be HTTP experts
- It integrates with the Serenity automation framework
- It comes with some baked-in functionalities
Cons
- Supports only Java language
Price: Open Source

Karate

Another open-source framework for API testing is Karate DSL. It is based on a cucumber library, and it helps create scenarios for API-based BDD tests in a simple way without the need to write step-to-step definitions.

Pros
- Boasts powerful assertion capabilities
- It allows configuration switching
- The software permits reusing of payload-data for API testing
- It supports multi-thread parallel execution
Cons
- The tool doesn’t have Auth Schemes out of the box
Pricing: Open Source

Conclusions:

For white box testing, it doesn't have much diversity and should be Jest and Vitest, maybe we can test the other libraries as Wallaby.js.

For black box testing, I prefer Karate because the syntax is like cucumber, and it can provide better scenarios for the tests. My second option could be Postman because it is famous, it is easy as I used before. Or RapidAPI Testing because it is mentioned recursively and has this feature which is good for our project: CI/CD Integration to GitHub.

@airvzxf airvzxf closed this as completed Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/cd Continuous Integration and Continued Deployment. programmer A computer programmer is a person who creates computer programs. qa Assure the product delivered by performance, design, reliability, and maintainability expectations. spike Activities such as exploration, architecture, infrastructure, research, design, and prototyping. tester A tester is a professional who tests software products and applications for quality assurance.
Projects
None yet
Development

No branches or pull requests

1 participant