简体   繁体   English

运行存储在变量中的FitNesse测试

[英]Running FitNesse tests stored in variable

I'm trying to get FitNesse (slim tests running via fitSharp) to process tables stored in a variable. 我正在尝试让FitNesse(通过fitSharp运行的苗条测试)来处理存储在变量中的表。 Both approach A & B below render the same on the page, but only approach B will run. 下面的两种方法A和B在页面上都呈现相同的内容,但是只有方法B可以运行。

Approach A 方法A

!define test (
| Table:myTest | someValue |
)
${test}

Approach B 方法B

| Table:myTest | someValue |

This example is rather superficial, but in my tests I'm looking to vary some parameters and reexecute the same test (without a lot of copy and paste). 这个示例是肤浅的,但是在我的测试中,我希望更改一些参数并重新执行相同的测试(无需大量复制和粘贴)。

Adding additional details requested; 添加要求的其他详细信息;

Approach A renders this to page when saving; 方法A在保存时将其呈现到页面上;

  <br><span class="meta">variable defined: test= | Table:myTest | someValue | </span> <br><br><table> <tbody><tr class="slimRowTitle"> <td>Table:myTest</td> <td>someValue</td> </tr> </tbody></table> <br> 

...but when running the test the page doesn't seem to process the table and shows just the variable definition ...但是在运行测试时,页面似乎无法处理表格,而仅显示变量定义

 <br><span class="meta">variable defined: test= | Table:myTest | someValue | </span> <br><br><br></div> 

Try creating a separate page with the test table. 尝试使用测试表创建一个单独的页面。

In your real test page you can include this page multiple times, after assigning values to the variables. 在为变量分配值之后,您可以在实际测试页面中多次包含此页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM