Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Test Case ID

Test Objective

Test Steps

Expected Outcome

Test Type

HITL-001

Validate basic HITLOperator functionality with single option selection

1. Create DAG with

HITLOperator<br/>2

HITLOperator.
2. Set subject="Choose option", options="option1", "option2"

<br/>3


3. Trigger DAG and wait for human

input<br/>4

input
4. Select "option1" from

UI<br/>5

UI
5. Verify task completion

Task completes successfully, XCom contains chosen_options="option1", params_input={}

Positive

HITL-002

Validate HITLOperator with multiple option selection

1. Create HITLOperator with multiple=

True<br/>2

True
2. Set options="opt1", "opt2", "opt3"

<br/>3

3. Trigger DAG and select multiple options "opt1", "opt3"

<br/>4

4. Verify task completion

Task completes successfully, XCom contains chosen_options="opt1", "opt3"

Positive

HITL-003

Validate HITLOperator with default values when no input is provided

1. Create HITLOperator with defaults="option1"

<br/>2


2. Set execution_timeout=30

seconds<br/>3

seconds
3. Trigger DAG and wait for

timeout<br/>4

timeout

4. Verify default is used

Task completes with timeout, defaults are applied, chosen_options="option1"

Positive

HITL-004

Validate HITLOperator fails with invalid defaults

1. Create HITLOperator with options="opt1", "opt2"

<br/>2

2. Set defaults="invalid_option"

<br/>3

3. Attempt to initialize operator

ValueError raised: 'defaults should be a subset of options'

Negative

HITL-005

Validate HITLOperator fails with multiple defaults when multiple=False

1. Create HITLOperator with multiple=

False<br/>2

False

2. Set defaults="opt1", "opt2"

<br/>3



3. Attempt to initialize operator

ValueError raised: 'More than one defaults given when "multiple" is set to False'

Negative

HITL-006

Validate ApprovalOperator with approval selection

1. Create ApprovalOperator with subject="Approve this task"

<br/>2


2. Trigger

DAG<br/>3

DAG

3. Select "Approve"

option<br/>4

option

4. Verify downstream tasks execute

Task completes successfully, downstream tasks are executed, no tasks skipped

Positive

HITL-007

Validate ApprovalOperator with rejection and skip downstream

1. Create ApprovalOperator with downstream

tasks<br/>2

tasks

2. Trigger

DAG<br/>3

DAG

3. Select "Reject"

option<br/>4

option

4. Verify downstream task skipping

Task completes successfully, all downstream tasks are skipped

Positive

HITL-008

Validate ApprovalOperator

fails when options parameter is provided

with rejection and skip downstream

1. Attempt to create ApprovalOperator with options="custom"

<br/>2

2. Initialize operator

ValueError raised: 'Passing options to ApprovalOperator is not allowed'

Negative

HITL-009

Validate ApprovalOperator fails when multiple parameter is provided

1. Attempt to create ApprovalOperator with multiple=

True<br/>2

True

2. Initialize operator

ValueError raised: 'Passing multiple to ApprovalOperator is not allowed'

Negative

HITL-011

Validate HITLEntryOperator with default OK option

1. Create HITLEntryOperator without specifying

options<br/>2

options

2. Trigger

DAG<br/>3

DAG

3. Verify default options and defaults are set

Operator initialized with options="OK", defaults="OK"

Positive

HITL-012

Validate HITLBranchOperator with valid branch selection

1. Create HITLBranchOperator with options="task_1", "task_2"

<br/>2

2. Create corresponding downstream

tasks<br/>3

tasks

3. Trigger DAG and select "task_1"

<br/>4

4. Verify branching behavior

Only task_1 executes, task_2 is skipped via branch logic

Positive

HITL-013

Validate HITLOperator with execution timeout

1. Create HITLOperator with execution_timeout=timedelta(minutes=1)

<br/>2


2. Trigger

DAG<br/>3

DAG

3. Wait for timeout without providing

input<br/>4

input

4. Verify timeout handling

HITLTimeoutError is raised, task fails due to timeout

Edge

HITL-014

Validate HITLOperator template field rendering

1. Create HITLOperator with subject="{{ ds }}", body="{{ task_instance.task_id }}"

<br/>2


2. Trigger

DAG<br/>3

DAG
3. Verify templated values in UI

Subject shows execution date, body shows task ID

Positive

HITL-017

Validate HITLOperator trigger event error handling

1. Create

HITLOperator<br/>2

HITLOperator
2. Simulate trigger event with error (non-timeout)

<br/>3

3. Process the error event

HITLTriggerEventError is raised

Negative

HITL-018

Validate HITLOperator XCom output structure

1. Create HITLOperator and complete

successfully<br/>2

successfully
2. Check XCom output

structure<br/>3

structure
3. Verify data types and format

XCom contains HITLTriggerEventSuccessPayload with chosen_options (list) and params_input (dict)

Positive

HITL-019

Validate ApprovalOperator with ignore_downstream_trigger_rules=True

1. Create ApprovalOperator with ignore_downstream_trigger_rules=

True<br/>2

True

2. Set up complex downstream task

dependencies<br/>3

dependencies

3. Select "Reject" and verify skipping behavior

All flat downstream relatives are skipped, not just direct relatives

Positive

HITL-020

Validate ApprovalOperator with no downstream tasks

1. Create ApprovalOperator as final task in

DAG<br/>2

DAG

2. Select "Reject" option<br/

>3

>
3. Verify completion

Task completes successfully, log shows "No downstream tasks; nothing to do."

Edge

HITL-021

Validate HITLOperator serialized_params property

1. Create HITLOperator with ParamsDict

params<br/>2

params

2. Access serialized_params

property<br/>3

property

3. Verify output format

Returns dict representation of ParamsDict.dump()

Positive

HITL-022

Validate HITLOperator with complex markdown body

1. Create HITLOperator with body containing

markdown<br/>2

markdown

2. Include lists, bold text, code

blocks<br/>3

blocks
3. Trigger DAG and verify rendering

Markdown is properly rendered in UI for human review

Positive

HITL-023

Validate HITL functionality requires Airflow 3.1+

1. Test import of HITL operators in pre-3.1

environment<br/>2

environment
2. Attempt to use operators

AirflowOptionalProviderFeatureException raised: "Human in the loop functionality needs Airflow 3.1+"

Negative

HITL-024

Validate HITLOperator with empty body parameter

1. Create HITLOperator with body=

None<br/>2

None

2. Trigger

DAG<br/>3

DAG
3. Verify task execution and UI display

Task executes successfully, no body text displayed in UI

Edge

HITL-025

Validate concurrent HITL tasks in same DAG

1. Create DAG with multiple parallel

HITLOperators<br/>2

HITLOperators

2. Trigger

DAG<br/>3

DAG

3. Respond to each HITL task

independently<br/>4

independently

4. Verify all complete successfully

All HITL tasks complete independently, no interference between tasks

Positive