unclebob / fitnesse

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

Enhance SLiM "Library" fixture to allow constructor arguments #591

Closed darthvadrismydad closed 9 years ago

darthvadrismydad commented 9 years ago

In my tests, there are certain instances where I'd like to take advantage of the Library feature that FitNesse has, but not being able to introduce constructor arguments causes me to have to break some of the patterns that we have established.

amolenaar commented 9 years ago

Hi, can you give an example?

darthvadrismydad commented 9 years ago

Sure, we have a custom database fixture that can take arguments such as environment (QA, DEV), and Database Type (Oracle, MySQL, Microsoft SQL). It is quite inefficient for us to create/destory an instance of this fixture every time it is used, and we can't switch to another fixture without doing exactly that. However, there is never a need to switch environment & database types during the test. So using the library table seemed like a good way to mitigate the cost of opening/closing database connections.

The sample wiki page table (wanted future state): |library| |database fixture|QA|MySQL|

Using Library as it exists today: |library| |database fixture|

|script| |set environment|QA| |set database|MySQL|

six42 commented 9 years ago

Hi @InspiredIdealist

have a look at the pull request I created if this solves your problem.

darthvadrismydad commented 9 years ago

There are no code changes in the commit you are referencing... This does not resolve my problem.

darthvadrismydad commented 9 years ago

Please re-open this issue, it is still not addressed.

six42 commented 9 years ago

Did you tried it:

|script| |database fixture|QA|MySQL| |$df= |get fixture |

|library| |$db |

What was the result?

darthvadrismydad commented 9 years ago

@six42, I've been playing around with the page you created, and it looks to me like FitNesse already supports what I'm looking for, at least for the most part. It is starting to look like the fitSharp runner that I'm using may not support library constructor arguments... I run C# tests, not Java. So I have to use the fitSharp runner.