This is Karate

Karate is the only open-source tool to combine API test-automation, mocks, performance-testing and even UI automation into a single, unified framework. In a talk at the GIDS Architecture Live 2020 series, Karate's creator Peter Thomas talks about the basics, the high level and his vision for Karate. Read an excerpt below and watch the full talk on-demand for free.

One of the things you should take away from this slide before I build anything, this is not Java, not JavaScript. This is not Python. It's not any language that you’re probably used to. It's inspired by some of the things that Cucumber does. Some of you who are Cucumber veterans would probably recognize the Given, When, Then stuff happening on the extreme left, but Karate’s selling point is that it supports JSON inline. It's native.

As you can see here, this is lenient JSON, this is the way that JavaScript programmers use on a daily basis, which is you don't need double quotes. You don't need quotes around the name, key value here and does a super elegant, and as you will see, I'm a big fan of JSON and the elegance of JSON as being able to support data.

I talked about the term domain specific language, and you can see an example here. In fact, I like to call out the fact that you can look at the second word on each slide. You see url; request; method; status; path, and guess what? It's totally gonna make sense to anyone who's worked in the business of HTTP or rest.

If you look at this code, there's a lot less noise. There are no semi-colons, every word has a meaning and a place and a need and all that. If you are in the business of testing and validating what's coming back from these responses from APIs or rest endpoints, you can imagine in your daily life, whatever you’ve seen, probably a lot of JSON, humongous, nested, complex payloads.

Karate’s selling point is that you can validate complex JSON in one step. At the same time, you see that #notnull right there in the center of the slide. That's a big deal because most of the time, many of the data elements that come back are dynamic. You would have #uuid, timestamps and date stamps and random values.

What Karate allows you to do, and this is what people love about Karate, is that you can validate that every data element is as expected, except the things that you put a #notnull. There are so many other options that you will see in a minute.

Okay. I'm seeing a lot of questions come in already, so what I'm going to do is I'm going to scan through them at the end. I don't want to break my flow, but I think I should be able to get to all these questions.

Last but not least, the fourth point that I've built on the slide is that you never need to test. You typically never just test one end point and then stop,  You would have to make a call, get something and then make another call using the data that you got back from the previous response.

Karate is great at that. You can keep on chaining requests and, as you can see in this simple example, you actually made two requests. One is a post and one is a get here and for the get, we actually used the ID that came back in the previous response.

Watch the full video on-demand, including all of the talks from GIDS.Architecture LIVE 2020, for free.

Like This? Register for our Newsletter to Continue the Converstion

See Highlights of
Wurreka

Hear What Attendees Say

PWC Logo

“Once again Wurreka has knocked it out of the park with interesting speakers, engaging content and challenging ideas. No jetlag fog at all, which counts for how interesting the whole thing was."

Cybersecurity Lead, PwC

Intuit Logo

“Very much looking forward to next year. I will be keeping my eye out for the date so I can make sure I lock it in my calendar"

Software Engineering Specialist, Intuit

Groupon Logo

“Best conference I have ever been to with lots of insights and information on next generation technologies and those that are the need of the hour."

Software Architect, GroupOn

Hear What Speakers & Sponsors Say

Scot Davis

“Happy to meet everyone who came from near and far. Glad to know you've discovered some great lessons here, and glad you joined us for all the discoveries great and small."

Scott Davis, Web Architect & Principal Engineer, ThoughtWorks

Oracle

“What a buzz! The events have been instrumental in bringing the whole software community together. There has been something for everyone from developers to architects to business to vendors. Thanks everyone!"

Voltaire Yap, Global Events Manager, Oracle Corp.

Venkat Subramaniam

“Wonderful set of conferences, well organized, fantastic speakers, and an amazingly interactive set of audience. Thanks for having me at the events!"

Dr. Venkat Subramaniam, Founder - Agile Developer Inc.