TEST-INFRA: [test-data-quality] Use Scenario Outlines for data-driven tests #3624

Open
opened 2026-04-05 20:54:03 +00:00 by freemo · 0 comments
Owner

Background and Context

Many of our Behave feature files use hardcoded values and duplicated scenario logic to test different data inputs. This makes the tests brittle, difficult to maintain, and less readable. Scenario Outlines are a Gherkin feature that allows the same scenario to be run multiple times with different data, reducing duplication and improving test clarity.

Current Behavior

Scenarios in the features/ directory use hardcoded values and repeat scenario logic to cover different data inputs. There is no use of Scenario Outline + Examples tables for data-driven parameterization.

Expected Behavior

Data-driven scenarios are expressed as Scenario Outlines with Examples tables, eliminating duplicated scenario logic and making it easy to add new test cases by adding rows to the table.

Acceptance Criteria

  • All scenarios in features/ that test multiple data inputs via duplication are refactored to use Scenario Outlines.
  • Step definitions are updated to use variables from Examples tables.
  • All tests continue to pass after refactoring.
  • Test readability and maintainability are measurably improved.

Supporting Information

Metadata

  • Branch: test/scenario-outlines-data-driven
  • Commit Message: test(features): refactor data-driven scenarios to use Scenario Outlines
  • Milestone: (backlog — see note below)
  • Parent Epic: #3374

Subtasks

  • Audit all features/ files and identify scenarios with hardcoded duplicate data inputs
  • Refactor each identified scenario into a Scenario Outline with an Examples table
  • Update step definitions to accept variables from Examples tables
  • Verify all Behave tests pass after refactoring (nox -e unit_tests)
  • Verify coverage >= 97% via nox -e coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

Backlog note: This issue was discovered during autonomous operation
on milestone v3.6.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Automated by CleverAgents Bot
Supervisor: Test Infrastructure | Agent: ca-new-issue-creator

## Background and Context Many of our Behave feature files use hardcoded values and duplicated scenario logic to test different data inputs. This makes the tests brittle, difficult to maintain, and less readable. `Scenario Outlines` are a Gherkin feature that allows the same scenario to be run multiple times with different data, reducing duplication and improving test clarity. ## Current Behavior Scenarios in the `features/` directory use hardcoded values and repeat scenario logic to cover different data inputs. There is no use of `Scenario Outline` + `Examples` tables for data-driven parameterization. ## Expected Behavior Data-driven scenarios are expressed as `Scenario Outlines` with `Examples` tables, eliminating duplicated scenario logic and making it easy to add new test cases by adding rows to the table. ## Acceptance Criteria - All scenarios in `features/` that test multiple data inputs via duplication are refactored to use `Scenario Outlines`. - Step definitions are updated to use variables from `Examples` tables. - All tests continue to pass after refactoring. - Test readability and maintainability are measurably improved. ## Supporting Information - Related issues: #3581 (plan persistence BDD scenarios), #3587 (resource repository tests), #3575 (database integration tests) - Gherkin `Scenario Outline` docs: https://cucumber.io/docs/gherkin/reference/#scenario-outline ## Metadata - **Branch**: `test/scenario-outlines-data-driven` - **Commit Message**: `test(features): refactor data-driven scenarios to use Scenario Outlines` - **Milestone**: *(backlog — see note below)* - **Parent Epic**: #3374 ## Subtasks - [ ] Audit all `features/` files and identify scenarios with hardcoded duplicate data inputs - [ ] Refactor each identified scenario into a `Scenario Outline` with an `Examples` table - [ ] Update step definitions to accept variables from `Examples` tables - [ ] Verify all Behave tests pass after refactoring (`nox -e unit_tests`) - [ ] Verify coverage >= 97% via `nox -e coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- **Automated by CleverAgents Bot** Supervisor: Test Infrastructure | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-05 20:54:48 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#3624
No description provided.