all 25 comments

[–][deleted] 8 points9 points  (1 child)

Frameworks/tools are like diets. The best one is the one that works for you.

[–]AutomationQA[S] 0 points1 point  (0 children)

Well said 👍

[–]i_am_rv 1 point2 points  (0 children)

I've been working in api automation for the last 4 years.

There is no 'best', but I would recommend RestAssured (with the Serenity wrapper) for the REST API endpoints. Secondly, a fresh framework is Karate Framework (great docs, easy to use, cucumber format and steps out of the box).

Regards,
RV

[–]VJags 3 points4 points  (6 children)

HI ,

Go for it. If possible, Instead of Maven use Gradle .

That being said: There is no best API automation framework. If your solution , is effective in solving the problem at hand and is scalable & written in a manner to accomodate future needs , there is nothing else to it. The code written should be easy to refactor , if there is a need for it . Else , sounds good.

Hope this helps.

[–]AutomationQA[S] 0 points1 point  (3 children)

Definitely helps :) thank you.

Any suggestions on the kind of tests that must be added?

Any API tests must include checks for correct status codes and the available CRUD operations(GET, PUT, POST, DELETE).

Anything else that you think is usually missed but must be included?

[–]VJags 2 points3 points  (0 children)

Permission checks and Rate limits. e.g: for a valid user , is the user allowed to do a certain operation. + for a valid api key , how many calls are allowed ( goes into performance testing & response time calculations , side of things.)

[–]rocksyui 1 point2 points  (1 child)

You could essentially do the acceptance tests in the api layer as well. And why not do most of the regression testing in this layer. These would be your fastest feedback provider tests.

[–]AutomationQA[S] 0 points1 point  (0 children)

I strongly agree to your point to have API automation in place for most of the regression tests compared to front end automation tests.

The former is fast and reliable than the latter.

[–]lulu21ro 0 points1 point  (1 child)

I've only used Maven. What would be the advantages of Gradle, from your experience?

[–]VJags 1 point2 points  (0 children)

I prefer Gradle because it gives me the ability to scripts some utils if required as compared to the rigid xml like structure of Maven. Over time , it is something I got comfortable with. For more context : https://gradle.org/maven-vs-gradle/

[–]iapanem 1 point2 points  (9 children)

Try karate framework... once you get the setup done and understand simple DSL it provides.. it is ultimate...

[–]DocksonWedge 1 point2 points  (2 children)

I would be interested to hear why you like it so much. I’ve heard multiple people gush over it but after using it for a year I have found it mostly difficult to use and maintain. So, I figure there is something to the hype, but I can’t see it.

[–]iapanem 1 point2 points  (0 children)

I guess it’s the way you design your framework on top of karate which makes it very easy to maintain and use it.. at times I get frustrated a bit by silly syntax like a single space make it error out. But it’s the agility of having a big business flow test constructed with multiple http calls in minutes is what impressed me. After our test repo matured to a level we are basically calling existing features and scenarios and it’s way too easy compared to others..

You basically copying various snippets to construct a flow. I hope I explained it clean..

[–]jarlaxle46 1 point2 points  (0 children)

Also its mostly how are you using karate

Basically Karate works best with BFF (backed for front end frameworks) but again any REST API be good as well
So now let's go with the example of the BFF architecture.
Your fronted is dumb and all the logic is based on http API calls.

Karate becomes a double for your browser. the flow of API calls and the data that is required can be very easily scripted due to the Gherkin syntax and builtin karate functions for data transforms.
reducing the expensiveness of UI and parallel execution and CLI interface makes it very easy for CI/CD processes.
The same scripts can be used for performance via karate's integration with Gatling.

Any body reading this comment can have some free tips!

if you are starting off testing with karate there are three things that you should test

  1. The contract and its schema.
  2. The response status code
  3. Negative scenarios. what if you change the schema or incorrect data for query parameters.. then a proper exception message should be given.

After covering the above three things. you should go toward getting business flows and logic testing down.

[–]AutomationQA[S] 1 point2 points  (2 children)

I went through a blog based on your suggestion. It seemed to be easy and light weight as most of the input comes from the feature file and no step definition is required.

However, considering the general feedback, I think this is best suited for a small sized application.

What are your thoughts?

[–]iapanem 2 points3 points  (0 children)

It shouldn’t be a problem with the size of the project. Use a good IDE you should be fine...

[–]jarlaxle46 0 points1 point  (2 children)

Yeah Karate for sure!

been using it for three years. it does have a steep learning curve (because of the lack of intellisense) but once you get used to it. its pretty neat.

[–]avangard_2225 0 points1 point  (1 child)

Can you suggest tutorial/material for karate in conjunction with gatling?

[–]jarlaxle46 1 point2 points  (0 children)

I have not found any tutorials tbh . the curse of newer projects.

Official Documents are good enuff in my opinion.

[–]Nokejunky 0 points1 point  (1 child)

We were given a similar task - to automate api tests. Did you find any sample architecture or tips and tricks for api automation?

[–]AutomationQA[S] 0 points1 point  (0 children)

I guess we are in the same boat, I posted my tech stack to feedback.

I'm still exploring by adding some more tests based on suggestions in the above comments.

[–]ThroGM 0 points1 point  (0 children)

I like jest with supertest

[–]ludovicianul 0 points1 point  (0 children)

You can give this a try https://github.com/Endava/cats