fitnesse 中的模板库

TemplateLibrary in fitnesse

我对TemplateLibrary有点困惑。我理解它本质上是重用样板代码。我不明白的是,fitnesse 如何决定将哪些页面包含在下拉列表中。 如果我们查看以下内容:

所有突出显示的都显示在下拉列表中。说的都是兄弟叔叔(可能是我不懂兄弟叔叔的概念)-

These pages act as a marker to find templates to show as available for insertion when editing a page. All children of a TemplateLibrary will be shown in the drop-down list of templates available for insertion. Unlike the other special pages, all brother and uncle TemplateLibrary pages are included. The oldest (grandest uncle) is included first. The brother, if it exists, is included last. This allows younger TemplateLibrary pages to override older ones

http://www.fitnesse.org/FitNesse.UserGuide.WritingAcceptanceTests.SpecialPages

长话短说 - 如何决定哪些内容包含在下拉列表中?

我相信 TemplateLibrary 的所有直接子项都包含在下拉列表中,正如您突出显示的那样。

但是在页面层次结构中可能有多个名为 TemplateLibrary 的页面。您显示的页面位于整个 wiki 的根目录,但您可以添加其他页面(通过添加页面并为其指定特殊名称 'TemplateLibrary')。 兄弟叔叔们的话题是wiki中哪些页面与哪些模板库页面相关(类似于Slim处理ScenarioLibrary页面的方式)。换句话说:哪些页面的子页面被视为模板。

例如,给定以下层次结构:

+ TemplateLibrary
++ Template1
+ WebTests
++ HomePageTest
+ SoapTests
++ TemplateLibrary
+++ Template2
++ Service1Tests
+++ TemplateLibrary
++++ Template3
+++ MyService1Test

当您在根级别或在 WebTests 下添加页面时,Template1 可用。当您在 SoapTests 下添加页面时,Template1 和 Template2 可用。当您在 Service1Tests 下添加页面时,Template1、Template2 和 Template3 可用。

如果 Service1Tests 下的 TemplateLibrary 有一个名为 Template1 的子项,那么为 Service1Tests 下的新页面选择 Template1 将使用该页面,而不是根级别的页面。