0

was wondering if it is possible to allow global variables like ${PAGE_NAME} be a part of an include?

We have different teams using different feature environments (and more environments coming up) which uses symlinks and includes to environment setup pages. At the moment we're copying everytime the literal path. It is less error prone when we can use the global variables FitNesse has to offer.

For example a simple setup:

root
   .Env
      .FEAT1  --> connection details to setup/connect env 1.
      .FEAT2  --> connection details to setup/connect env 2.
      .FEAT300  --> connection details to setup/connect env 300.
   .Team1
      .FEAT2 --> uses !include -seamless .Env.FEAT2 and uses a symlink to suiteX
   .Team10
      .FEAT300  --> uses !include -seamless .Env.FEAT300 and uses symlinks to suiteX, suiteB and suiteC
etc

When using include -seamless .Env.${PAGE_NAME} it does not load the include. Preferably we want to use the variables FitNesse offers, but I'm sure we are doing something wrong or using the wrong syntax.

Any suggestions on how to use the global variables in a way we try to achieve?

I tried an other solution by defining the whole include into a variable, but that has unfortunately the same result:

!define includes {!include -seamless .Env.${PAGE_NAME} }

$includes

Writing down the global var itself resolves as expected.

Gertray
  • 25
  • 7
  • I'm not sure I follow the need for the level below the team pages. Does a team use multiple environments, or are there environments shared between teams? To me having to create a page 'FEAT2' below 'Team1' seems extra work and no less work than (at that level) making an include which incorporates the environment and having the symlinks there. I haven't tried to use global variables, but when environments are shared between teams, could you not have team pages directly below the environment page (and possibly a team page linking to the team page per environment)? – Fried Hoeben Jun 04 '21 at 15:41
  • I get your point, but I tried to simplify things in my example. It's way more complicated, but to answer your questions; A team uses multiple environments but can also be shared in between each other. We have limited resources for SUT 1, and unlimited resources (containers) for SUT 2. There are tests that can run independant from each other and we have tests which are dependant. But that's why my question was on if global variables can be used in testpages in the need we want. Refactoring to your suggestion is possible but that is not something we are looking for at the moment. – Gertray Jun 07 '21 at 12:16

0 Answers0