BYU Web Service Manual
HomeToolsWeb Service manual Edit Page

Runscope

You may remember a little about RunScope: RunScope. It is a little bit like Postman, except it can be used to test your code continuously.

This is how you can test the whole API at one time. This is called integration testing.

Go to https://www.runscope.com/

Click the down arrow in the bucket section and look up the favorite color bucket. Click on it.

Then click “Create Test” and “Import test”.

Then select “Swagger 2.0” and upload your swagger file.

Now, it’s not going to come through perfectly. Click on the eye-ball in the top left hand corner to return to the main page. You might have to re-navigate to the favorite-color-tutorial bucket.

You may notice that you have two tests.

That won’t do, so click on the one with just a forward slash, click more and then delete it.

Then click to edit the other one.

Let’s start by editing the environment.

Replace the variables with what they should be, using the URL from WSO2. Add the BYU-ID and favorite color you are going to pass.

Don’t forget to save. Then fix add the authentication in header.

Then, set your location. It doesn’t really make any difference which you pick, but let’s use Virginia.

Sweet! Save it and your environment is ready to go!

Go back to the Editor and modify the PUT method so it will work.

Make sure your “/”s are right. When the swagger imports the test they tend to come through weird. Be very careful with this part.

Do the same thing for the DELETE method:

Change to blank method into a POST.

Then fix up the GET request.

Now, if we try and PUT and DELETE something that doesn’t exist yet, we will have problems. So we can copy and move the requests around to make them more useful.

Click run and Save. If it passes, then everything is working!

Well, kind of. Let’s make the test a little better.

Click on the PUT method and select “Assertions”. Change the tests to be more specific.

You can do this for the other requests too, if you want.

Now navigate back to main page and click the schedule button.

Then set it up to run every minute.

Once you are sure it works, change it to run every day.

If it works, then everything is set up! When you are done with the tutorial, make sure to stop it from running every day.

One thing to point out before we move on is that you can set up RunScope to notify you with Slack or Email if your API fails.

Contributing Source Issue Tracker