Install and Config Karate Plugin

Okay, so let's go ahead and install the Visual Studio code plugin. What I'm going to do is I'm just going to go over to extensions here. What I just need to search for is Karate. And we can see this extension at the top here. Make sure that you choose the one from Karate Labs. That's the official Karate extension. All I need to do is hit install on here. Wait for a few seconds, then that plugin should be downloaded and installed for us. And that's all that you need to do in order to install that. If I close that down, if I go back over now to my user's feature file, we can see here now that the feature file is color-coded a lot better. And so it's a lot easier for us to now understand and to talk through.

Again, these are just a couple of the example tests that ship with Karate, we don't need to worry about these too much because we're going to be writing our own tests from scratch. But it just shows the basically the language that we use in order to write API tests. There are just a couple of really simple API tests installed in here for us to have a look at. But again, we don't need to worry about these because we're going to be writing these out from scratch. But we can just see some of the languages that you use here to write Karate tests when we use given when then and this is just making basically simple API calls to this endpoint, checking the HTTP status, and doing some other assertions as well.

Now, if you want to run these tests in the Karate plugin, we can actually click run here. But in order to run tests with Karate plugin, we do actually need to upgrade to a paid subscription now. I just hit on the Help page over here. Just give us some instructions on how to sign in to the Visual Studio code plugin and it breaks down some of the different pricing levels between the Plus and the Pro subscriptions. So we can see here the Plus subscription is $12, and the Pro is $64 a month.

It's important to note at this point that we can still run Karate tests without a paid subscription because Karate is open-source, it's still free to use. It just means that we won't be able to run tests through the plugin. We'll have to run tests in a different way. But don't worry, we'll be showing you how to do that in this course. Just to stress them. You don't need to upgrade to any of these paid subscriptions, they're just here to offer you extra functionality and help with writing your Karate tests if that's what you need. But for this course, we're not going to need to upgrade to any paid subscription. Let's head back over to our code base. What I'm actually going to do is I'm just going to delete this user's folder and the two files in it just because I want us to write tests ourselves completely from scratch against our own API. So if we just delete the user's folder and now do all that we've got are these files here like so. Okay, that's just good.

So now we're ready to start writing our very own Karate tests and will start doing that in the next video. 

Comments are closed.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}