Skip to content

Cases Commands

Test cases are individual test scenarios in Qualflare, each belonging to a test suite and containing a sequence of steps to execute. The cases commands let you list, inspect, and retrieve steps for test cases from the command line.

qf cases list

List test cases within a specific suite. The --suite flag is required. Results are output as pretty-printed JSON to stdout.

Syntax

bash
qf cases list --suite <seq> [flags]

Flags

FlagTypeDefaultDescription
--suiteintRequired. Suite sequence number to list cases from
--querystring""Filter cases by title or description
--statestring""Filter by one or more states, comma-separated: passed, failed, skipped, error, pending
--prioritystring""Filter by one or more priorities, comma-separated: low, medium, high, critical
--pageint0Page number for paginated results
--sort-bystring""Field to sort results by (e.g., title, priority, createdAt)
--sort-descboolfalseSort in descending order
--api-keystring""API key for authentication. Overrides QF_API_KEY environment variable.

Examples

bash
# List all cases in suite #5
qf cases list --suite 5

# Search for cases by title
qf cases list --suite 5 --query "login"

# Filter by a single state
qf cases list --suite 5 --state failed

# Filter by multiple states
qf cases list --suite 5 --state passed,failed

# Filter by priority
qf cases list --suite 5 --priority high,critical

# Combine state and priority filters
qf cases list --suite 5 --state failed --priority critical

# Sort by priority, highest first
qf cases list --suite 5 --sort-by priority --sort-desc

# Paginate through results
qf cases list --suite 5 --page 2

Example Output

json
{
  "cases": [
    {
      "seq": 101,
      "title": "User can log in with valid credentials",
      "state": "active",
      "priority": "critical",
      "suiteSeq": 5,
      "stepCount": 6,
      "createdAt": "2026-03-10T09:00:00Z"
    },
    {
      "seq": 102,
      "title": "User sees error on invalid password",
      "state": "draft",
      "priority": "high",
      "suiteSeq": 5,
      "stepCount": 4,
      "createdAt": "2026-03-10T09:05:00Z"
    }
  ],
  "total": 2
}

qf case get

Retrieve full details for a single test case by its sequence number.

Syntax

bash
qf case get <seq>

Arguments

ArgumentDescription
seqThe case's sequence number (visible in the Qualflare UI and cases list output)

Flags

FlagTypeDefaultDescription
--api-keystring""API key for authentication. Overrides QF_API_KEY environment variable.

Examples

bash
# Get details for case #101
qf case get 101

Example Output

json
{
  "seq": 101,
  "title": "User can log in with valid credentials",
  "description": "Verifies that a registered user can authenticate using their email and password.",
  "state": "passed",
  "priority": "critical",
  "suiteSeq": 5,
  "stepCount": 6,
  "createdAt": "2026-03-10T09:00:00Z",
  "updatedAt": "2026-03-22T11:30:00Z"
}

qf case steps

Retrieve the ordered list of steps for a specific test case.

Syntax

bash
qf case steps <seq>

Arguments

ArgumentDescription
seqThe case's sequence number

Flags

FlagTypeDefaultDescription
--api-keystring""API key for authentication. Overrides QF_API_KEY environment variable.

Examples

bash
# Get steps for case #101
qf case steps 101

Example Output

json
[
  {
    "seq": 1,
    "action": "Navigate to the login page",
    "expected": "Login form is displayed"
  },
  {
    "seq": 2,
    "action": "Enter a valid email address in the email field",
    "expected": "Email field is populated"
  },
  {
    "seq": 3,
    "action": "Enter the correct password in the password field",
    "expected": "Password field shows masked input"
  },
  {
    "seq": 4,
    "action": "Click the Sign In button",
    "expected": "User is redirected to the dashboard"
  }
]

Working with JSON Output

All cases commands output pretty-printed JSON, making them easy to pipe into jq for filtering and transformation.

bash
# Count cases in suite #5
qf cases list --suite 5 | jq '.cases | length'

# Extract just titles and states
qf cases list --suite 5 | jq '.cases[] | {seq, title, state}'

# Get all critical cases
qf cases list --suite 5 --priority critical | jq '[.cases[].title]'

# Group cases by priority (count per priority)
qf cases list --suite 5 | jq '.cases | group_by(.priority) | map({priority: .[0].priority, count: length})'

# Get just the action text from each step
qf case steps 101 | jq '.[].action'

# Find cases with more than 5 steps
qf cases list --suite 5 | jq '[.cases[] | select(.stepCount > 5)]'

See Also