scope.SPECIFICATION in markdown

Skip to first unread message

Andy Dingfelder

Nov 14, 2018, 4:49:52 PM11/14/18
to concordion

I'm using a markdown table example and I need an object to persist across all tests
e.g. I need to construct a object that controls database connections etc prior to the tests running, and then use this same object for all tests

I see APIs that seem to do this, using scope.SPECIFICATION

But when I try the below, it seems like the object is still being recreated for each line in the markdown table

private ScopedObjectHolder<DbUtilsConcordion> dbUtilsPersister = new ScopedObjectHolder<DbUtilsConcordion>() {
protected DbUtilsConcordion create() {
log.debug("creating DbUtilsConcordion")
return new DbUtilsConcordion();

in my markdown I'm running:

**Then** the thing should work

| [run][] [Scenario](- "c:example") | [some column](- "#col1") | [another col](- "#col2") | [Result](- "?=#result") |
| ---------------------------------- | ------------------------ | ------------------------ | ----------------------- |
| 1 first test | abc | 123 | pass |
| 2 second test | def | 456 | pass |

[run]: - "#result=assertItPasses(#col1, #col2)"

The only way I can seem to get it not to re-initialise the object is by moving the code that calls the ScopedObjectHolder's get method into a @BeforeSuite method.
Is this expected behavior?

If so it would be great to have a scope.SUITE setting?


Reply all
Reply to author
0 new messages