To allow Github to find the workflow file, the file needs to be in the. If the Postman tests fails, we want the build to fail. We want a workflow that will run our Postman tests whenever code is pushed. That's because we haven't created a workflow yet. If you push that change to Github, BOOM, you will see no workflow has run: To do that you just need to use Postman to export the collection as a json file, and then add that file to your repo just like you would any other file. What repo you say? Well I guess I haven't mentioned that yet, but we're going to store our Postman collection is a Github repo. Once I have my Postman test complete and have confirmed the test passes when it should and fails when it should, I will add it to my code repo. FYI, I used to generate the expected schema. I'm kind of glossing over this cool little Postman test that is validating the schema, but if you've never used Postman for schema validation it's definitely worth some more research. The test for my Postman request looks like this: My first test is just going to do a GET request to verify that I get a response with status code of 200, and validate the schema of the response. If you don't you can check out my previous post to get started, and of course there are many other fine resources available to get you started. I'll assume you have familiarity with Postman. You should now be about the hit that endpoint at Once we get some data back, we can create some Postman tests. Enter fullscreen mode Exit fullscreen mode
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |