Home / Companies / Postman / Blog / September 2015

September 2015 Summaries

3 posts from Postman

Filter
Month: Year:
Post Summaries Back to Blog
The author discusses the creation of a lightweight behavior-driven testing framework named "describe-it" for use within Postman, inspired by popular frameworks like Mocha and Jasmine. This tiny, 0.7kb minified script allows users to write organized tests with isolated assertions, enhancing the testing of API responses by mimicking the specification style of behavior-driven development (BDD). The framework includes functions such as `describe`, `it`, `beforeEach`, `afterEach`, and `expect`, which perform various testing and assertion tasks similar to those in Mocha and Jasmine. Users can save the script as a global variable within Postman, enabling reuse across multiple requests without manual addition, and integrate it into test scripts by evaluating the global variable. The author provides an example of using the framework to check for a 200 status code and HTML content type in API responses, demonstrating its functionality through nested describe blocks and sequential test execution, even in the presence of runtime errors.
Sep 29, 2015 942 words in the original blog post.
APIs play a crucial role in breaking down information silos and enhancing organizational productivity, yet their potential is often underutilized due to issues such as lack of documentation and integration challenges. Postman offers tools that facilitate the quick building of API integrations by allowing the import of curl commands, capturing HTTP requests, and supporting multiple response formats like JSON and XML. Through a practical example, the process of building a Slack bot is illustrated, showcasing the use of Postman to retrieve and format data from the Chrome Web Store reviews via a JSONP API and post them to a Slack channel using Slack's webhook API. The integration process is simplified by Postman's scripting environment, which supports chaining requests and running automated tests to ensure API calls function as expected. Additionally, the Postman Collection Runner and Newman enable running these integrations periodically, offering flexibility in deployment and security. The example highlights how once an integration is established, subsequent ones become quicker, showcasing Postman's capability to streamline API integration efforts effectively.
Sep 25, 2015 1,103 words in the original blog post.
Continuous Integration (CI) is a practice that many development teams strive for, involving the frequent integration of code into a shared repository, followed by automated builds and tests. However, many teams struggle with the testing aspect, particularly in API development. Postman, traditionally a REST client, offers a solution with its testing sandbox that allows developers to write and execute JavaScript-based tests for APIs. To integrate these tests into a CI workflow, Postman can be used in conjunction with Newman, a command-line tool that runs Postman Collections, and Jenkins, a popular CI server. The text describes how to set up a CI environment using Jenkins and Newman on Ubuntu, detailing the installation of Jenkins, NodeJS, npm, and Newman. It outlines how to create a Jenkins project that runs a Postman Collection via Newman, checks for test failures, and schedules builds to run every 30 minutes. This integration not only enhances the CI process by ensuring regular testing but also provides flexibility and customization options for developers, with further resources available for more dynamic configurations.
Sep 03, 2015 881 words in the original blog post.