Testing across environments in useMango

We’re excited to introduce our new Environments feature, designed to simplify the testing process during each stage of development. With this feature, you can easily set up distinct environments for development, testing, staging, and production. Say goodbye to the hassle of modifying tests in each environment for every new feature or change – Environments in useMango will streamline this process for you.

Consider this scenario: overseeing a major upgrade for an e-commerce platform, navigating through development, testing, staging, and production environments. With useMango Environments, testing these environments becomes a breeze, ensuring efficiency, accuracy, and consistency throughout the upgrade process.

In this blog, we’ll look at how you can make the most of this feature and integrate it in your testing needs.

Getting Started

Let’s first understand what Environments and Environment Variables are in useMango™️. We’ll go over these in detail, learn how to use them in useMango™️ and utilise them in tests.

With Easy Environment Change, we’re allowing you to create a set of variables in a project, whose values are defined for each environment. This allows the tests to utilise these variables without having to define inputs for each test.

Environment Variables

Environment variables in useMango™️ serve as project wide entities that can be used in tests. These are different from Project data variables in useMango™️ in the sense Project data variables have a fixed value while environment variable values are defined by the chosen environment. We’ll talk about working with environments in subsequent sections.

A few details about environment variables:

  • Environment variables are read only when used in tests, hence they cannot be modified by the test while it is executed.
  • Environment variables and Data variables cannot be named the same.

Let’s look at how we can work with Environment Variables in useMango™️.

To see all the Environment Variables present in the Project, we open the Data tab from the sidebar and then click on the Environment tab from the pane that is opened.

Here we can see all the environment variables created for the project. We can sort through the list by Name or by Date created by using the Sort by option. We also allow filtering through the list of variables by their data type.

Currently supported data types in useMango are:

1. Text

2. Secret

3. Web Identifier

4. Mobile Identifier

5. Image Identifier

Managing Environment Variables

These operations are reflected across all environments in the project.

  1. Creating an Environment Variable
    • To create a new Environment Variable, click on the input box in the right hand side of the filters bar. Type in your desired variable name. You can now click on the Add data button and an environment variable of type Text will get created. Clicking on the arrow next to the Add data button gives you the option of selecting from the data types mentioned above.
  1. Renaming environment variables
    • Clicking on the variable name makes the name editable, type in your new name and press Tab to save the new variable name.
  1. Deleting environment variable
    • Click on the checkbox next to the environment variable that you want to delete and click on the Delete option in the bottom left of the pane and then confirming the deletion with the popup that is shown.

You can delete multiple variables by clicking on the checkbox next to them and clicking on Delete.

Using environment variables in Tests or Composite component

To use an environment variable as a step parameter of a test or a composite component, click on the step parameter where you want to use the environment variable; a list of environment variables and data variables are shown. Select the environment variable from the list or start typing in the variable name to search for it. Click on the environment variable (Environment variables are Indigo colored) to set it as the step argument.

In this case we’re setting the Start url parameter of the Launch Web Browser component

Environments

  • Environments in useMango™️ serve as value sets for the environment variables. You can assign different values to the environment variables for every environment.
  • Every project has an environment that is created at the time of project creation and is set as the default environment. If the user does not specify the environment to execute tests in, this environment is used.
  • The default environment is marked in this list by a green tickmark as seen in the example below.

The default environment cannot be deleted.

Lets take a look at how to work with environment in useMango™️.

To view all Environments in a project, we click on the Environments tab from the sidebar.

Here, we can see all environments that are in a project. We can search for environments using the search bar in the top left of the Environments pane. We can also sort the environments list by its name or by its last modified time stamp.

Creating an environment

An environment can be created by clicking on the + icon in the right corner of the search box. This will create an environment with the name, “Unnamed environment” followed by a numerical in case an environment with the name already exists.

There is no upper limit on how many environments can be created in a project, but it is advisable to keep the count low to ease management.

Renaming an environment

An environment can be renamed by first double clicking on it from the list and then clicking on the Edit icon in the environment details pane that is opened in the right hand side of the list. Enter the desired name in place of the current name and press Tab.

Deleting an environment

An environment can be deleted by selecting it from the list and clicking on the Delete icon from the the actions bar below the environments list. A dialog box is displayed to confirm the deletion of the environment.

Multiple environments can be deleted by selecting them with the checkbox next to their name and then clicking on the delete button.

Setting the value of an environment variable

  • The value of the environment variable can be set per each environment by searching for it in the environment details pane and then setting its value for the environment and pressing tab.
  • Keeping the value of an environment variable empty is allowed and will be treated as such when it is used in a test.

Setting the default environment

  • To set the default environment for a project, we log in to the useMango App Website, go to the Project settings page and set the default environment from the Environment section.

Setting of the default environment for a project can only be done by an Account Administrator for that account.

  • We see that setting of default environment is an operation that is not done often and may not be needed to be done by test user.
  • Setting the default environment affects all users/useMango instances that are using that project. Since the scope of impact is wide, we have restricted this operation to Account Administrators only.

Executing tests with Environments

Execution Environment selection

We now have the capability to run tests in a specific environment. We refer to this environment as the Execution Environment. The Execution Environment is reset to the default environment on launching useMango™️ or switching between projects.

The execution environment can be selected only from the Test Library.

  • Navigate to the Test Library and click on the Execution Environment button in the bottom of the left panel. This opens a dialog box which contains a dropdown menu that allows you to select an environment to run your tests in.
  • Once you’ve selected the environment, click on the Done button to confirm your selection.

All tests executed from the Test Library or Test Designer will now run in the newly selected environment.

Viewing test execution reports

  • In the execution report, the environment chosen to execute the test in is displayed. Clicking on the Link icon next to the name takes you to the bottom of the report where the list of environment variables that were utilised in the test are displayed.

Leave a Reply

Your email address will not be published. Required fields are marked *