Qampanion Logo
Qampanion

Writing tests

A project holds test cases. A test case holds steps. A step holds actions.

Test cases

A test case is the core entity of a project. It is a full E2E test that consists of a list of steps. A single project can contain any number of test cases and is not tied to a specific platform or application.

Test cases within the same project can be executed on different:

  • platforms
  • devices
  • applications

⚠️ If a project contains test cases for different platforms, manual action is required when switching between them. The selected device and application used during test design are not bound to the test case or the project.

Create a test case

On the project page, in the left sidebar, click the [ + ] button and enter the test case name.

After creation, you can:

  • open the test case settings
  • start creating the first steps

Steps

A Step is an entity inside a test case that represents one or more actions within a single application screen. A step is strictly bound to a test case, but it can be reused.

Four step types are supported:

  • default
  • linked
  • network request
  • script

Default step

A step that contains a set of actions on a screen.

The following actions are supported:

  • tap
  • swipe
  • text input
  • wait (no interaction)

Linked step

A link step executes the action flow defined in another step.

It is used to reuse logic, reduce duplication, and speed up new test case creation.

Network request step

A step that sends an HTTP request to a specified URL and validates the response.

Supported HTTP methods: GET, POST, PUT, DELETE, PATCH.

Configurable options:

  • URL — target endpoint
  • Method — HTTP method
  • Headers — request headers as a JSON string
  • Body — request body as a JSON string
  • Expected Status Code — the HTTP status code the response must match
  • Response Parameters — a list of response keys to validate or save to environment variables

Response Parameters support three comparison types:

  • none — no validation; the value can still be saved to an environment variable
  • equal — checks that the response value exactly matches the expected value
  • exists — checks that the key is present in the response

Keys support dot-notation for nested objects (e.g. user.id) and bracket-notation for arrays (e.g. items[0].name).

If a response parameter has an environment key set, the actual response value for that key is saved to the project environment after execution. This value can then be referenced in subsequent steps using $key syntax.

Script step

A step that executes a user-provided bash script on the Mac where Qampanion is running.

Configurable options:

  • Description — step name shown in the test case list
  • Required — if disabled, a script failure does not fail the test case
  • Script — bash script content

During execution Qampanion:

  1. Replaces $KEY placeholders with values from project environment variables.
  2. Runs the script through /bin/bash using stdin.
  3. Marks the step as passed if the script exits successfully (exit code 0).
  4. Marks the step as failed (or skipped if not required) if the script exits with a non-zero code or cannot be executed.

Required option

Each step has a Required setting. It is enabled by default. It means that the step blocks the test case result.

⚠️ If a step is not blocking, its result does not affect the overall test case outcome, regardless of its status.

This setting is recommended for optional or conditional screens (for example, pop-up or system notification).

Expected result and assert

Most test cases require validation of intermediate and final application states. To simplify and speed up test creation, a regular Step type is used for expected results and assertions.

⚠️ The usage examples below are based on the Qampanion execution algorithm. See Snapshot comparison for details.

Step without actions (Expected Result, Assert)

If a step contains no actions, it runs in screenshot comparison mode only.

Such a step can be used as:

  • an expected result
  • a final assert

Step without screenshot, but with actions (Expectation, dynamic screens)

If a step contains actions, but no screenshot, screen comparison is not performed.

Such a step can be used for:

  • waiting for application loading
  • working with dynamic screens (for example, browser or webview screens)

⚠️ In this mode, only wait and text input actions are available.

Actions

There are 4 action types available in the application. A step has no limits on the number, order, or uniqueness of actions.

Tap

A quick press at a specific point on the screen.

Swipe

A press followed by cursor movement.

⚠️ The initial touch is treated as a tap. Use swipe carefully on screens with interactive elements.

Type

Enters the text without using the system keyboard. This action can be used without an expected screenshot.

⚠️ It is recommended to disable the system keyboard on the device.

Expectation

Pauses test case execution for a specified time (Delay). This action can be used without an expected screenshot.

Test plans

A Test Plan is used to simplify launch of multiple test cases. Qampanion provides test plans as configurable sets of test cases to run full application flows. Test plans can be configured individually, allowing you to run tests for a specific feature, device, or the entire project.

⚠️ When running a test plan across different platforms, you must manually switch the device in the application header.

Create a test plan

  1. On the project page, open the Test plan section.
  2. Click [ + ], enter a name, and open the created plan.
  3. Use the checkboxes to select which test cases are included in the test plan.