unclebob / fitnesse

FitNesse -- The Acceptance Test Wiki
fitnesse.org
Other
2.04k stars 713 forks source link

Use fixture result params outside fixture tables #411

Closed denisko closed 10 years ago

denisko commented 10 years ago

Hi guys,

I'd like to be able to use the results from fixtures outside a fixture table, e.g.:

|script|echo fixture |
|$res= |echo|${=1+1=}|
|show  |echo|$res    |

!-!-!define myVar $res

In the last line the value of $res should be printed to the output, just like it is printed inside the fixture table.

Current results:

|script|echo fixture|
|$res<-[2]  |echo|2|
|show|echo|$res->[2]|2|

!define myVar $res

In the last line, I'd like $res to be replaced with 2.

Do you have any hints on how to implement this ?

I'm using Fitnesse 2014-02-01 on multiple platforms, mainly on Mac OS/X

jediwhale commented 10 years ago

You can't use fixture results in a !define because the !define is evaluated before the fixture is executed. The wiki page with all the wiki markup, like !define and the table cells are rendered into html, the html is then parsed by the test engine, either slim or fit and then fixtures are executed by the test engine and the resulting html is displayed.

On 2014-02-25 03:23, Denis Koelewijn wrote:

Hi guys,

I'd like to be able to use the results from fixtures outside a fixture table, e.g.:

|script|echo fixture |

|$res= |echo|${=1+1=}| |show |echo|$res |

!-!-!define myVar $res

In the last line the value of $res should be printed to the output, just like it is printed inside the fixture table.

Do you have any hints on how to implement this ?

I'm using Fitnesse 2014-02-01 on multiple platforms, mainly on Mac OS/X

— Reply to this email directly or view it on GitHub https://github.com/unclebob/fitnesse/issues/411.

Cheers, Mike Stockdale

/fit/Sharp http://fitsharp.github.com Syterra Software Inc. http://www.syterra.com

denisko commented 10 years ago

Right, thanks for the explanation. Then I need to figure out a different solution.