python - How do I handle dependencies between scenarios in Lettuce? -


i using lettuce define test cases. in many cases, it's easy write lettuce scenarios in such way can run either atomically or part of other scenarios in feature. however, find lettuce useful tool try , reason , implement more complex integration tests. in these cases, makes sense break tests scenarios, define dependency on previous scenario. way can run scenario without having explicitly define other scenarios need run. makes dependency clear in scenario definition. might this:

scenario: long scenario     given condition     given condition         ...  scenario: dependent scenario     given scenario "really long scenario" has been run     given new condition     stuff     ... 

then like:

@step('given scenario "([^"]*)" has been run') def check_scenario(step, sentence):     scenario = get_scenario(sentence) # don't know how     if not scenario.ran:         scenario.run() 

how handle situation? there gotchas i'm missing approach? taking quick through api docs , source code, didn't seem there easy way retrieve scenario it's string.

the thing know defining new steps call defined steps: check out tutorial topic. maybe can workaround problem.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -