Managing Test Case

Overview

Test cases are the cornerstone of the Testany Platform, enabling users to define specific scenarios for testing their applications. Every user, regardless of their role, can register and manage their own test cases. By default, only the owner of a test case can update or delete it. Global Admins also have the ability to edit and delete any test case. Other users can only view it. If needed, the owner or a Global Admin can transfer ownership to another user (see Transfer Ownership below).

Note: The voice in this video is AI-generated, not original.

Understanding a Qualified Test Case

A qualified test case should meet the following criteria:

  1. Clear Objective: It should have a well-defined purpose and target a specific aspect of the application.
  2. Reproducibility: It must be consistent in its execution, producing the same results under the same conditions.
  3. Independence: It should be self-contained, not relying on other test cases to function.
  4. Measurable Outcome: The results should be quantifiable and measurable to determine success or failure.
  5. Compliance with Platform Standards: It must adhere to the specific guidelines and formats defined by the Testany Platform.

Test case on Testany Platform

Test frameworks the platform supports

A key feature of the Testany Platform is its support for multiple testing frameworks, and the ability to assemble test cases from different testing frameworks within a single test pipeline. Currently, the platform supports the following test executors: Postman, Playwright, Python Unit Test, PyRes, and JMeter. Maven and Gradle executors are no longer supported.

Understanding the Concepts of Test Case on Testany Platform

Definition

In our product, a "Test Case Package" refers to a bundled unit of a Test Case that encompasses both the Test Case Meta and Test Case Code. The Test Case Meta provides important context and information about the test case such as author, status, priority, version, and other necessary parameters. The Test Case Code is the executable script that outlines the steps for the test. By packaging the metadata and code together, users can register and manage tests cases more effectively on Testany Platform, and adjust parameters according to different testing scenarios.

1. Test Case Code File

The Test Case Code File contains the actual code that defines the test. It can vary depending on the test framework chosen by the creator.

Key Features:

  • Framework Dependent: The file type and structure may vary based on the selected test framework.
  • Logic Definition: Contains the step-by-step instructions for executing the test.
  • Language Support: Written in the supported programming language(s) of the chosen framework.

2. Test Case Package File

The Test Case Package File is a zip file that encapsulates the Test Case Code File.

Key Features:

  • Zip Format: Bundled as a zip file.
  • Includes Code File(s): Combines the code file(s) into a single package.
  • Portability: Enables easy sharing and registration of the test case within the platform.
  • Integrity: Ensures that the code and meta files are consistently linked and managed as a unified entity.

Understanding the Concepts of Case Visibility on Testany Platform

In the Testany platform, Case Visibility refers to the level of access control applied to a Case, determining who can view and interact with it. There are two types of Case Visibility: Global Visibility and Workspace-Restricted Visibility.

  • Global Visibility: Cases are accessible to all active users within the tenant.
  • Workspace-Restricted Visibility: Cases are only accessible to members of the workspace(s) they are assigned to.

To further illustrate "Workspace-Restricted Visibility," here is an example:

A user has member permissions for the workspaces: WKS, ABC, FTT, and admin permissions for the workspaces: ACT, CPE.

  • Case 1 is associated with workspaces: ACT, WKS, FTT.
  • Case 2 is associated with workspaces: FTT, ABD.
  • Case 3 is associated with workspaces: ABD, CPE.
  • Case 4 is associated with workspaces: ABD, LBI.

In this scenario:

  • The user can see Case 1 because their workspace member permissions (WKS, FTT) overlap with the Case's associated workspaces (WKS, FTT).
  • The user can see Case 2 because their workspace member permissions (FTT) overlap with the Case's associated workspaces (FTT).
  • The user cannot see Case 3 because their workspace member permissions does NOT overlap with the Case's associated workspaces (ABD, CPE).
  • The user cannot see Case 4 because there is no overlap between their workspace permissions and the Case's associated workspaces (ABD, LBI).

Register Test Case

Step-by-Step Guide

1. Login to Testany Platform

Login and click "Test case library" button in the top bar.

2. Click "Register Test Case" button

image-20250423-083952.png

3. Fill the form

After the "Register a new Test Case" pop-up appears, please fill out the form step-by-step:

3-1: Name: The name is an important attribute of a test case and will be frequently used in the Testany Platform. To enhance effectiveness and convenience for you and your colleagues, please ensure the name's correctness, completeness, and conciseness.

image-20250120-031138.png

3-2: Description: You can describe your test case in more detail in the Description, making it easier for other users to utilize it. Listing the elements like the test object, preconditions, input data, execution steps, and expected results in the Description will greatly facilitate other users.

image-20250120-031223.png

3-3: Select Runtime: You can select a Runtime for the test case to be executed.

image-20250120-031418.png

3-4: Make Private?: You can set the case as global visible or restricted to workspaces.

3-4-1: Global Visible: keep "Make Private?" as No

image-20250120-033148.png

3-4-2: Workspace Restricted Visibility: set "Make Private?" as Yes. Then, utilize the dropdown list to select the workspaces with which you want to share restricted cases.

image-20250120-032610.png

4. Click "Register & Next" button

Click "Register & Next" button at the bottom right corner of the pop up to register the case. Then, you'll be redirected to the case detail page.

ℹ️

At this point, the mandatory fields required to run a case are still incomplete. You will need to continue editing the case before a successful dry run can be performed.

Edit Test Case

ℹ️

Before you start, please read the following specifications for the Test Case Package file carefully and adhere to them strictly to ensure that your test case can be registered successfully.

Specification of Test Case Package file

  1. The file must have a .zip extension.

  2. The zip file must contain your test case code file(s).

    1. at least one .json file (Postman collection file) if you choose Postman executor
    2. at least one .py file if you choose PyRes or Python executor
    3. at least one .jmx file if you choose JMeter executor
    4. at least one .js or .ts file if you choose Playwright executor
  3. If you have multiple files for your test case, the file amount must not exceed 100. (Postman can only support one .json collection file)

  4. The entire test case package .zip file size must not exceed 1MB.

  5. A single test case can only have one environment. If you have a test case which is able to test multiple environments (by adjust environment variables), you need to register them to multiple test cases on Testany Platform.

Step-by-Step Guide

ℹ️

Here are some limitations regarding the editing of a case:

  • Only the owner or a Global Admin has the authority to make edits.
  • The test case key is immutable and cannot be altered under any circumstances.
  • The runtime of the test case cannot be changed.
1. Navigate to the case detail page
2. Fill the required fields
ℹ️

When performing in-line edits, all your changes will be automatically saved after you click the confirm button (✅).

2-1: Test Executor: you can choose the executor for your test case. After selecting the framework, you must provide either a Path or a Command depending on the executor type:

ExecutorInput TypeWhat to FillExample
PostmanPathRelative path to the .json collection filecollection.json
JMeterPathRelative path to the .jmx filetest-plan.jmx
PlaywrightPathRelative path to the test .js or .ts fileplaywright/tests/example.spec.ts
PythonCommandFull execution commandpython -m pytest test_api.py
PyResCommandFull execution commandpython -m pytest test_api.py
ℹ️

Path vs Command:

  • Path: The relative path to the test file inside your .zip package. The platform will use the appropriate runner for the framework.
  • Command: The complete shell command to execute your test. You have full control over how the test is run.

image-20250423-074836.png

2-2: Definition file: This is where you can upload your test case code file(s). Please ensure that the file(s) are contained within a .zip archive.

image-20250423-074916.png

2-3: Environments: This is an important attribute of a test case, describing the environment(s) of the service being tested by the test case. On the Testany Platform, each test case can correspond to multiple Environments.

image-20250423-075136.png

ℹ️
  • Must be 2-80 chars long
  • First char must be a letter or number.
  • Last char must not be a space.
  • Only uppercase letters, numbers, hyphen, underscore, dot and space are allowed.

2-4: Environment variables: you can fill in other environment variables required to run the test case. This section now supports three types in one place:

  • Normal: regular key/value environment variables.
  • Relay: variables used for pipeline relay orchestration.
  • Secret: references to workspace credentials instead of raw secret values.

If a parameter needs to be temporarily changed during a certain execution, you can use an appropriate method to turn it into an environment variable and fill it in here.

image-20250423-075525.png

ℹ️
  • More than 16 environment variable sets may cause misbehaving.
  • Key must be within 80 characters.
  • Key must consist solely of uppercase letters, digits, and underscore (POSIX.1-2017).
  • Key must start with an uppercase letter (A-Z). It must NOT start with an underscore or a digit.
  • Keys (name) must be unique within the same test case.
  • For Normal and Relay, both key and value must not be empty or blank.
  • For Normal and Relay, the value must be no longer than 1000 characters.
  • For Secret, you do not enter the raw secret value. You continue by selecting Workspace, Credential Safe, and Credential.
  • If you need to represent an "empty value", use - explicitly.

If you have an environment that you wish to share in your case, you can specify the relay's name and value within the code. For guidance, please refer to the sample code in the section Add code to your test script. After defining the relay, make sure to expose the relay name as a relay environment variable by clicking the relay icon. This will enable its use during pipeline orchestration.

image-20250423-075608.png

📝

If your workspace admin has already created the credential you need, add it as a Secret row directly inside Environment variables. The older standalone "Secure key reference / Credential Binding" area is no longer the recommended authoring model. See Protect the credentials used in testing for the full workflow.

Read Test Case

You can view the test cases in the Test Case Library by card, list or directory views, as illustrated in the picture below. If you're looking to locate a specific test case quickly, simply utilize the search boxes located in the top right corner of the page.

image-20250423-081948.png

In the case of a relay, you will notice a relay icon located in the top right corner of the case card when viewing in card format. Alternatively, in list view, the icon will be found on the leftmost side of the row corresponding to the case.

You may click the test case to view its detail information. There're several key elements in this page:

  1. Test case key, please note the key won't (and can't) be changed in any circumstances.
  2. Owner
  3. Visibility
  4. Environments
  5. Labels
  6. Version
  7. Runtime
  8. Meta (including environment_variables, executor and path/command)
  9. Output

image-20250423-081747.png

When a relay-related environment variable is defined in a case, as illustrated above, you will see the blue relay icon corresponding to that specific environment in the 'Type' column.

Dry Run Test Case

If a case has not been executed since its last modification, you will see the following indicators:

  1. A message bar located beneath the case name serves as a reminder for you and other users who have access to this case, indicating that a successful dry run has not yet been completed.
  2. The "DryRun" button is activated, signaling that as the case owner, you can revisit this page at any time and click it to perform the Dry Run.
  3. The output indicates that a successful dry run for this case has not been completed yet.

image-20250423-083110.png

By clicking "Dry Run" button, the platform will promptly perform a dry run to verify whether the test case is qualified and compatible. Following this, you will be directed to the dry run page of the test case, where you can review the displayed information to ensure it aligns with your expectations.

image-20250423-083400.png

ℹ️

The "Dry Run" button will be disabled if any required fields are missing.

image-20250423-083544.png

Transfer Ownership

If you need to hand over a test case to another user, the current owner or a Global Admin can transfer ownership.

  1. Navigate to the case detail page.
  2. In the Details panel on the right side, find the Owned by field and click on the current owner's name.
  3. A search box will appear. Type to search for the new owner, then select them from the list.
  4. Click Confirm to complete the transfer.
ℹ️

After the transfer, the new owner will have full control over the test case (edit, delete, dry run), and the previous owner will lose edit and delete permissions (unless they are a Global Admin).

Delete Test Case

  1. Navigate to case detail page

  2. As case owner, click "Delete" button at the top right of the case

ℹ️
  • If a case is assembled to one or more pipeline(s), you will receive a 409 error and the deletion is not allowed. To successfully delete the case, please ensure that it is removed from all associated pipeline(s) first.
  • If a case is imported from git, it can't be manually deleted. For more detail information, please refer to the document Bulk Manage Test Cases - 3.5 Bulk Delete.

Test Case Packaging FAQ

Q1: What's the difference between "Path" and "Command"?

ItemUsed ByWhat It IsExample
PathPostman, JMeter, PlaywrightRelative path to the test file inside your .zipcollection.json or tests/example.spec.ts
CommandPython, PyResComplete shell command to run your testpython -m pytest test_api.py

Q2: Will dependencies in requirements.txt be automatically installed?

Yes. For Python/PyRes executors, Testany automatically runs pip install -r requirements.txt before executing your test if the file exists in your package.

Q3: How do I package a multi-file Python test?

my-test.zip
├── tests/
│   ├── __init__.py
│   ├── test_login.py
│   └── test_order.py
├── utils/
│   └── helpers.py
└── requirements.txt

Command: python -m pytest tests/

Q4: Why does Postman only support a single .json file?

The Postman executor only supports one collection file. If you need environment variables, configure them in the Environment Variables section on the test case detail page instead of using a separate environment file.

Q5: What if my .zip file exceeds 1MB?

  • Remove unnecessary files (.git, __pycache__, node_modules, etc.)
  • Don't include large test data files; use environment variables instead
  • If you genuinely need larger files, contact Testany support

Q6: My DryRun failed with "File not found". What should I check?

  1. Check your Path/Command: Ensure it matches the actual file location inside your .zip
  2. Check folder structure: If your test file is in a subdirectory, include the path (e.g., tests/test_api.py not just test_api.py)
  3. Check file extension: Ensure the correct extension for your executor (.py for Python, .json for Postman, etc.)

×

Still have questions?

Our team is here to help. Get in touch and we'll get back to you as soon as possible.