Include dynamic paths in FitNesse

假如想象 提交于 2019-12-11 04:39:15

问题


Is there a way to include dynamic paths in FitNesse ?

Assuming I have the following structure

Credentials
  - Local
    - Customer
    - Admin
  - Staging
    - Customer
    - Admin
TestLogin +

In my TestLogin page I would like to something like

!define PLATFORM (Local)
!include .Credentials.${PLATFORM}.Customer
.... 
My Test Tables

I've also (unsuccessfully) tried defining the path:

!define PATH (.Credentials.${PLATFORM}.Customer)
!include ${PATH}

Edit The accepted answer, strictly speaking, doesn't answer the question (seems it's not possible) but provides a good alternative.


回答1:


Could it be that your trying to achieve something like: the example of why one would want symbolic links in the user guide?

Would it be acceptable to switch the 'axes' of your reuse (i.e. create a single suite containing TestLogin and use a symbolic link to include this in the hierarchy for each environment where each hierarchy defines some variables (used in TestLogin) that are specific to that environment)?




回答2:


Have you tried

!define PLATFORM {!include -c <SampleRoot.Credentials.Local.Customer }
${PLATFORM}
.... 
My Test Tables

? (note the extra space at the end of the !define) Depending on the Fitnesse version this might or might not work :) I'm using v20150814.



来源:https://stackoverflow.com/questions/37114193/include-dynamic-paths-in-fitnesse

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!