TestStack / TestStack.BDDfy

BDDfy is the simplest BDD framework EVER!
MIT License
419 stars 84 forks source link

able to alter title #276

Closed paulschup closed 5 years ago

paulschup commented 5 years ago

set title after execution of steps . non static values like a runtime method will return the wring value which is't set during information collection. because the steps will alter the value.

also fixed and added tests

mwhelan commented 5 years ago

Hi @paulschup , let me know when you feel this feature is ready and I will take a look. If you could tell me a little bit more background about what you are trying to do and how this helps it would be useful context. Thanks.

paulschup commented 5 years ago

Hi @paulschup , let me know when you feel this feature is ready and I will take a look. If you could tell me a little bit more background about what you are trying to do and how this helps it would be useful context. Thanks.

it's ready - I use the fluentscanner in my projects. There i use objects as input parameters in my test. To make this readable. I want to extract these objects and create nice text. Overiding the tostring method is not an option. I can do this using reflection. Putting this method in the general bddfy projec is not very usefull I think. But with this alteration it is possible to override the title and acces any parameters used in this method. I also altered the lokation where the data is collected. This necessaty can be seen in the test I added. It had a test where a previous step altered the outcom of a later step. during the information collection this wasn't altered yet thus when the title inormation was collected this value was empty. Now I collected the title information previous to the execution of the specific step, because then the information is correct.

mwhelan commented 5 years ago

Hi @paulschup I'm sorry I haven't had a chance to look at your pr this week as I hoped. I've had a really busy week. I will try to take a look at it next week.