This increasingly becomes annoying as it hampers productivity. So we need to type in fragments all over again for all requests. In Insomnia, like Postman, they have no object-oriented-approach to reuse fragments. We are testing GraphQL requests for new features or refactors using Insomnia. “Writing queries to use in Postman or Insomnia will be a painful process”Īfter using karate for GraphQL test automation for some time, we faced another problem (although it is unrelated with karate). When we are about to write new tests with existing fragments, we can just call the existing fragments instead of writing all required fragments from scratch. So far it is quite useful for us too in terms of making writing tests a simpler task. Karate really comes in handy as it can easily make javascript calls out of the box.īy achieving this setup, we managed to avoid the dangerous part of hard coding fragments to each GraphQL requests. We declare them in their own specific javascript files. We achieve our goal by separating fragments and queries. We decided that we must design the usage of fragments and queries on our karate tests to be as modular as possible. “If a fragment is changed, we need to find and replace each fragment on each query” Writing queries to use in Postman or Insomnia will be a painful process.If a fragment is changed, we need to find and replace each fragment on each query.We need to write each fragment again and again for each query. AFAIK this is the standard way of doing things in tools like Postman or Insomnia.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |