You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Xray Document Generator无法获取嵌套调用测试用例步骤的问题咨询

Troubleshooting Xray Document Generator's Nested Test Case Step Details Issue

Hey there, let's tackle this nested test case step issue with Xray Document Generator. I've seen similar scenarios where modular test steps don't pull through details as expected, even after checking the official docs. Here are some targeted fixes to try:

1. Verify the Document Template Configuration

  • Make sure your template is explicitly set to expand modular test steps. In the Xray Document Generator template editor:
    • Locate the section for test steps (usually under Test > Steps)
    • Check if there's a loop or conditional that handles ModularTestStep type entries
    • Ensure you're referencing the nested test case's fields correctly, like:
      ${modularTestStep.testCase.description} for the nested test case description
      ${modularTestStep.testCase.steps} to pull in its individual steps
  • If your template only checks for regular TestStep entries, it'll skip over modular steps entirely or just show their type.

2. Check Nested Test Case Permissions & Visibility

  • Confirm that the user account running the document generation has view access to all nested test cases. Xray won't pull details for test cases the generating user can't see, even if the parent test case links to them.
  • Double-check that nested test cases are in a status that allows them to be included in exports (some instances restrict draft/unapproved test cases from document generation).

3. Adjust the Export Scope

  • When initiating the document generation, ensure you've selected the "Include linked test cases" or similar option (labeling varies slightly by Xray version). This tells the generator to traverse and pull details from all nested modular steps, not just the parent test case.
  • If you're generating from a test plan, make sure all nested test cases are associated with the same plan, or that the export scope is set to include related test cases across plans.

4. Validate the Modular Step Linking

  • Go back to your parent test case's step 4: confirm that the modular step is directly linked to a specific test case (not just a placeholder or broken link). Sometimes the link might appear correct but is actually pointing to a deleted or invalid test case ID.
  • Try re-creating the modular step in the parent test case to rule out any corruption in the link.

5. Custom Template Tweak (If Defaults Fail)

If the official template isn't working, you can modify it to explicitly handle modular steps. Here's a snippet you can add to your test steps section:

#foreach ($step in $test.steps)
  ## Regular Test Step
  #if ($step.type == "TestStep")
  - Step ${step.id}: ${step.action}
    * Expected Result: ${step.result}
  #end

  ## Modular Test Step (Nested Test Case)
  #if ($step.type == "ModularTestStep")
  - Step ${step.id}: *Modular Step - Calls Test Case: ${step.testCase.key}*
    * Nested Test Case Description: ${step.testCase.description}
    ### Nested Test Steps:
    #foreach ($nestedStep in $step.testCase.steps)
    - Nested Step ${nestedStep.id}: ${nestedStep.action}
      * Expected Result: ${nestedStep.result}
    #end
  #end
#end

This loop checks each step type, and for modular steps, it pulls in the nested test case's description and its own steps recursively.


内容的提问来源于stack exchange,提问作者isapansoni

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 16:35:13