Integration testing Articles / Blogs / Perficient https://blogs.perficient.com/tag/integration-testing/ Expert Digital Insights Thu, 16 Jan 2025 12:17:31 +0000 en-US hourly 1 https://blogs.perficient.com/files/favicon-194x194-1-150x150.png Integration testing Articles / Blogs / Perficient https://blogs.perficient.com/tag/integration-testing/ 32 32 30508587 Newman Tool and Performance Testing in Postman https://blogs.perficient.com/2025/01/16/newman-tool-and-performance-testing-in-postman/ https://blogs.perficient.com/2025/01/16/newman-tool-and-performance-testing-in-postman/#respond Thu, 16 Jan 2025 12:13:41 +0000 https://blogs.perficient.com/?p=375112

Postman is an application programming interface (API) testing tool for designing, testing, and changing existing APIs. It has almost every capability a developer may need to test any API included in Postman.

Postman simplifies the testing process for both REST APIs and SOAP web services with its robust features and intuitive interface. Whether you’re developing a new API or testing an existing one, Postman provides the tools you need to ensure your services are functioning as intended.

  • Using Postman to test the APIs offers a wide range of benefits that eventually help in the overall testing of the application. Postman’s interface is very user-friendly, which allows users to easily create and manage requests without extensive coding knowledge, making it accessible to both developers and testers.
  • Postman supports multiple protocols such as HTTP, SOAP, GraphQL, and WebSocket APIs, which ensures a versatile testing set-up for a wide range of services.
  • To automate the process of validating the API Responses under various scenarios, users can write tests in JavaScript to ensure that the API behavior is as expected.
  • Postman offers an environment management feature that enables the user to set up different environments with environment-specific variables, which makes switching between development, staging, and production settings possible without changing requests manually.
  • Postman provides options for creating collection and organization, which makes it easier to manage requests, group tests, and maintain documentation.
  • Postman supports team collaboration, which allows multiple users to work on the same collections, share requests, and provide feedback in real-time.

Newman In Postman

Newman is a command-line runner that is used to perform commands and check Postman’s response. The Newman can be used to initiate requests in a Postman Collection in addition to the Collection Runner.

Newman is proficient with GitHub and the NPM registry. Additionally, Jenkin and other continuous integration technologies can be linked to it. If every request is fulfilled correctly, Newman produces code.

In the case of errors, code 1 is generated. Newman uses the npm package management, which is built on the Node.js platform.

How to install Newman

Step 1: Ensure that your system has Node.js downloaded and installed. If not, then download and install Node.js.

Step 2: Run the following command in your cli: npm install -g newman

How to use Newman: 

Step 1: Export the Postman collection and save it to your local device.

Step 2: Click on the eye icon in the top right corner of the Postman application.

Step 3: The “MANAGE ENVIRONMENTS” window will open. Provide a variable URL for the VARIABLE field and for INITIAL VALUE. Click on the Download as JSON button. Then, choose a location and save.

Step 4: Export the Environment to the same path where the Collection is available.

Step 5: In the command line, move from the current directory to the direction where the Collection and Environment have been saved.

Step 6: Run the command − newman run <“name of file”>. Please note that the name of the file should be in quotes.

Helpful CLI Commands to Use Newman

-h, --helpGives information about the options available
-v, --versionTo check the version
-e, --environment [file URL]Specify the file path or URL of environment variables.
-g, --globals [file URL]Specify the file path or URL of global variables.
-d, --iteration-data [file]Specify the file path or URL of a data file (JSON or CSV) to use for iteration data.
-n, --iteration-count [number]Specify the number of times for the collection to run. Use with the iteration data file.
--folder [folder Name]Specify a folder to run requests from. You can specify more than one folder by using this option multiple times, specifying one folder for each time the option is used.
--working-dir [path]Set the path of the working directory to use while reading files with relative paths. Defaults to the current directory.
--no-insecure-file-readPrevents reading of files located outside of the working directory.
--export-environment [path]The path to the file where Newman will output the final environment variables file before completing a run
--export-globals [path]The path to the file where Newman will output the final global variables file before completing a run.
--export-collection [path]The path to the file where Newman will output the final collection file before completing a run.
--postman-api-key [api-key]The Postman API Key used to load resources using the Postman API.
--delay-request [number]Specify a delay (in milliseconds) between requests.
--timeout [number]Specify the time (in milliseconds) to wait for the entire collection run to complete execution.
--timeout-request [number]Specify the time (in milliseconds) to wait for requests to return a response.
--timeout-script [number]Specify the time (in milliseconds) to wait for scripts to complete execution.
--ssl-client-cert [path]The path to the public client certificate file. Use this option to make authenticated requests.
-k, --insecureTurn off SSL verification checks and allow self-signed SSL certificates.
--ssl-extra-ca-certs Specify additionally trusted CA certificates (PEM)

Picture2

 

Picture3 Min

Picture4

Performance Testing in Postman

API performance testing involves mimicking actual traffic and watching how your API behaves. It is a procedure that evaluates how well the API performs regarding availability, throughput, and response time under the simulated load.

Testing the performance of APIs can help us in:

  • Test that the API can manage the anticipated load and observe how it reacts to load variations.
  • To ensure a better user experience, optimize and enhance the API’s performance.
  • Performance testing also aids in identifying the system’s scalability and fixing bottlenecks, delays, and failures.

How to Use Postman for API Performance Testing

Step 1: Select the Postman Collection for Performance testing.

Step 2: Click on the 3 dots beside the Collection.

Step 3:  Click on the “Run Collection” option.

Step 4:  Click on the “Performance” option

Step 5: Set up the Performance test (Load Profile, Virtual User, Test Duration).

Step 6: Click on the Run button.

After completion of the Run, we can also download a report in a.pdf format, which states how our collection ran.

A strong and adaptable method for ensuring your APIs fulfill functionality and performance requirements is to use Newman with Postman alongside performance testing. You may automate your tests and provide comprehensive reports that offer insightful information about the functionality of your API by utilizing Newman’s command-line features.

This combination facilitates faster detection and resolution of performance issues by streamlining the testing process and improving team collaboration. Using Newman with Postman will enhance your testing procedures and raise the general quality of your applications as you continue improving your API testing techniques.

Use these resources to develop dependable, strong APIs that can handle the demands of practical use, ensuring a flawless user experience.

]]>
https://blogs.perficient.com/2025/01/16/newman-tool-and-performance-testing-in-postman/feed/ 0 375112
Conducting UAT for Your Website https://blogs.perficient.com/2024/12/31/conducting-uat-for-your-website/ https://blogs.perficient.com/2024/12/31/conducting-uat-for-your-website/#respond Tue, 31 Dec 2024 22:58:03 +0000 https://blogs.perficient.com/?p=374861

As project managers for website implementations, we oversee the user acceptance testing process (UAT) to ensure the development lifecycle is successful. Conducting UAT for your website is a critical phase in your project. For many project managers, this process can feel daunting because they must figure out all the areas that need testing and determine how extensively to test them. Additionally, they often find it challenging to identify the systems, customers, and internal resources that should participate in this testing. If you’re wondering how to start planning, I’ll share the steps I follow to get started.

  • Identify All Systems Impacted

    Determine all systems impacted by your project. Even if these systems or integrations are not changing due to your project, you will still need to validate that data is updating accurately and within the expected timeframe.

Some of these systems are but not limited to:

      • PIMs (Product Information Manager)
      • DAMs (Digital Asset Management)
      • CRMs (Customer Relationship Management)
      • OMSs (Order Management Systems)
      • Analytics Tools (GA4 and GTM)
      • Marketing Platforms
      • Payment Gateways
      • 3Rd Party Search Tools
      • Accessibility Tools
  • Document Test Cases

    After you identify the impacted systems, contact the product owners or subject matter experts for those systems to assist you in writing test cases. You can involve anyone in the process of writing test cases, including business analysts, product owners, subject matter experts, quality control engineers, and others. Start this process by outlining a step-by-step description of what the user should experience and what the end result should be. If any integrations change, the business analyst or project manager must answer questions as you write test cases, since the expected results might shift due to the project.

    Pro-Tip – Write out the step-by-step approach in a document stored in a shared repository. This could be a spreadsheet on a shared drive that multiple people can access. This setup will allow team members to update the document with test cases, rather than having different versions floating around in everyone’s inboxes. It may also be easier to have separate documents for each system or major functionality you are testing. Users testing only one system or major functionality might feel confused when they look at test cases for areas they aren’t familiar with. Separating everything will help reduce this confusion.

  • Begin Testing

    Once you’ve received approval to begin testing, have the tester refer to the document with the test cases. As they go through each step, they can mark it as passed or failed. If they fail a step, they should provide a comment explaining why and include a screenshot if necessary.

  • Prioritize Feedback

    After testing is complete, review the feedback in the test case documents and set a priority for each of the failed test cases with your team’s input. These priorities can be classified as critical, high, medium, or low. Critical and high priorities indicate key steps that are showstoppers for launching the project. Assign these when key functionality severely impacts the customer or business experience and prevents users from completing their intended goals, such as placing an order or viewing incorrect information. You can assign low priority to cosmetic issues that do not hinder user engagement on your website.

  • Collect Estimates

    Make sure to collect estimates from your team regarding the level of effort required to address the feedback from UAT. This is important for tracking the timeline and budget for your launch. Once you’ve received the estimates, you can assign estimated completion dates based on the level of effort and available resources.

  • Retest

    As you resolve and review feedback from retesting, continue to prioritize it and collect estimates.

  • Involve Customer Service Representatives

    Once you feel your site is in a great place, invite customer service representatives or anyone in your organization who interacts with customers to test it. This will allow them to familiarize themselves with the changes and test what they interact with. If you are a B2B company, it might be beneficial to get feedback from a customer you work with consistently while you are conducting UAT for your website.

Have any other tips or ideas on how to approach conducting UAT for your website? Feel free to leave a comment! Make sure to checkout additional blogs on website project management such as Website Project Management Tips.

]]>
https://blogs.perficient.com/2024/12/31/conducting-uat-for-your-website/feed/ 0 374861
Testing Redux: Strategies and Tools https://blogs.perficient.com/2024/12/11/testing-redux-strategies-and-tools/ https://blogs.perficient.com/2024/12/11/testing-redux-strategies-and-tools/#respond Wed, 11 Dec 2024 12:54:11 +0000 https://blogs.perficient.com/?p=352279

Introduction

Redux, a JavaScript application’s predictable state container, has emerged as a key component for React application state management. To make sure that your state management functions as intended, it is essential to test your Redux code. We’ll look at methods and resources for testing Redux apps in this extensive article.

 

Why Test Redux?

Testing is an integral part of the development process, and Redux is no exception. Here are some reasons why testing Redux is essential:

  1. Predictable State: Ensures that your state transitions are predictable and follow the logic you’ve defined.
  2. Refactoring Safety: Allows you to refactor your code with confidence, knowing that your tests will catch regressions.
  3. Collaboration: Makes collaboration easier by providing a safety net for changes made by different developers.
  4. Documentation: Acts as living documentation, showcasing how different parts of your application interact with the state.

 

Strategies for Testing Redux

  1. Action Creators Testing

Action creators are functions that return actions. Testing them involves checking if the correct action is returned.

// Example Jest Test for Action Creators

test('action to add a todo', () => {

  const text = 'Finish documentation';

  const expectedAction = {

    type: 'ADD_TODO',

    payload: text,

  };

  expect(addTodo(text)).toEqual(expectedAction);

});

 

  1. Reducers Testing

Reducers are functions that specify how the application’s state changes in response to an action. Test that the reducer produces the correct state after receiving an action.

// Example Jest Test for Reducers

test('should handle ADD_TODO', () => {

  const prevState = [{ text: 'Use Redux', completed: false }];

  const action = {

    type: 'ADD_TODO',

    payload: 'Run the tests',

  };

  const newState = todos(prevState, action);

  expect(newState).toEqual([

    { text: 'Use Redux', completed: false },

    { text: 'Run the tests', completed: false },

  ]);

});

 

  1. Selectors Testing

Selectors are functions that take the Redux state and return some data for the component. Test that your selectors return the correct slices of the state.

// Example Jest Test for Selectors
test('select only completed todos', () => {

  const state = {

    todos: [

      { text: 'Use Redux', completed: false },

      { text: 'Run the tests', completed: true },

    ],

  };

  const expectedSelectedTodos = [{ text: 'Run the tests', completed: true }];

  expect(selectCompletedTodos(state)).toEqual(expectedSelectedTodos);

});

 

Tools for Testing Redux

  1. Jest

Jest is a popular JavaScript testing framework that works seamlessly with Redux. It provides a simple and intuitive way to write unit tests for your actions, reducers, and selectors.

  1. Enzyme

Enzyme is a testing utility for React that makes it easier to assert, manipulate, and traverse React components’ output. It is often used in conjunction with Jest for testing React components that interact with Redux.

  1. Redux DevTools Extension

The Redux DevTools Extension is a browser extension available for Chrome and Firefox. It allows you to inspect, monitor, and debug your Redux state changes. While not a testing tool per se, it aids in understanding and debugging your application’s state changes.

  1. nock

nock is a library for mocking HTTP requests. It can be handy when testing asynchronous actions that involve API calls.

 

Conclusion

Validating various aspects of the state management procedure is part of testing Redux apps. You can make sure that your Redux code is stable, dependable, and maintainable by utilizing tools like Jest and Enzyme in conjunction with a test-driven development (TDD) methodology. Have fun with your tests!

]]>
https://blogs.perficient.com/2024/12/11/testing-redux-strategies-and-tools/feed/ 0 352279