Include dynamic paths in FitNesse

2019-08-12 05:37发布

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.

标签: fitnesse
2条回答
叼着烟拽天下
2楼-- · 2019-08-12 06:16

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)?

查看更多
地球回转人心会变
3楼-- · 2019-08-12 06:23

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.

查看更多
登录 后发表回答