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

Generate sample test cases for collections #32

Open
Gbahdeyboh opened this issue Sep 16, 2022 · 1 comment
Open

Generate sample test cases for collections #32

Gbahdeyboh opened this issue Sep 16, 2022 · 1 comment
Labels
enhancement New feature or request p4 lowest priority

Comments

@Gbahdeyboh
Copy link

GraphQL is a very declarative query language. It provides a declarative approach to data fetching. From the schema, you already know what kind of data to expect and you can choose to request just what you need.

Postman has something called postman scripts that can be used to write unit-like tests. Its assertion and test suite were built atop mocha and chai making it quite similar in usage to them.

Postman scripts can be written and run in the tests tab in Postman, which is a NodeJS runtime environment for collections.

Because of the declarative nature of GraphQL, it is possible to generate sample test cases for GraphQL APIs on postman collections. It doesn't have to be anything fancy, it could be just very basic data validation checks for s start.

I am not familiar with what Escape provides, but we could also have a few security test cases that are auto-generated and can be run on the fly.

@nohehf
Copy link
Member

nohehf commented Sep 22, 2022

That's a cool idea, tho apart from just creating the test structure and maybe asserting the data types and testing a few limit cases (like wrong input and so on) I don't believe that we could really generate useful tests. And sadly including Escape like tests (even small ones) would be really hard. I'll let the issue open for now but I don't think is a priority for now, tho any suggestions are welcomed. :)

@nohehf nohehf added enhancement New feature or request p4 lowest priority labels Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p4 lowest priority
Projects
None yet
Development

No branches or pull requests

2 participants