Skip to content

Add Get and Update Test Execution Steps Tools to Zephyr#363

Open
sudheshbmsce wants to merge 2 commits intoSmartBear:mainfrom
sudheshbmsce:feat/zephyr-test-execution-steps
Open

Add Get and Update Test Execution Steps Tools to Zephyr#363
sudheshbmsce wants to merge 2 commits intoSmartBear:mainfrom
sudheshbmsce:feat/zephyr-test-execution-steps

Conversation

@sudheshbmsce
Copy link

Goal

Add two missing MCP tools for Zephyr test execution steps, enabling AI agents to read and update individual step results during a test execution run.

Design

The Zephyr Scale API already had two untapped endpoints — GET /testexecutions/{id}/teststeps and PUT /testexecutions/{id}/teststeps — with full Zod schemas already defined in rest-api-schemas.ts. Two new tool classes were implemented following the exact same pattern as all other Zephyr tools (GetTestExecution, UpdateTestExecution, etc.) and registered in ZephyrClient.

A schema fix was also applied to GetTestCaseTestSteps200Response: the testData, reflectRef, and testCase fields were changed from .optional() to .nullish() because the real Zephyr API returns null (not undefined) for these fields, causing output validation failures.

Changeset

  • New: src/zephyr/tool/test-execution/get-test-execution-steps.tszephyr_get_test_execution_steps tool (read-only, paginated, supports testDataRowNumber filter)
  • New: src/zephyr/tool/test-execution/update-test-execution-steps.tszephyr_update_test_execution_steps tool (idempotent PUT, records actualResult and statusName per step)
  • Modified: src/zephyr/client.ts — registered both new tools
  • Fixed: src/zephyr/common/rest-api-schemas.tsGetTestCaseTestSteps200Response testData/reflectRef/testCase accept null
  • New: Unit tests for both tools (14 tests)

Testing

  • 14 unit tests added and passing (npm run test:run)
  • Validated live against Zephyr Scale API (test case QE-T33108, 10 steps returned correctly after schema fix)

- Add GetTestExecutionSteps tool (GET /testexecutions/{id}/teststeps)
- Add UpdateTestExecutionSteps tool (PUT /testexecutions/{id}/teststeps)
- Register both tools in ZephyrClient
- Fix GetTestCaseTestSteps200Response schema: testData, reflectRef, and
  testCase fields now use .nullish() to accept null values from the API
- Add unit tests for both new tools (14 tests total)

Made-with: Cursor
@sudheshbmsce sudheshbmsce force-pushed the feat/zephyr-test-execution-steps branch from 419ccce to 135bfc0 Compare March 9, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants