Hi All - apologies in advance for the long question
I'm looking to validate my meaning of the terms:
- Suite
- Specification
- Example
Looking on the concordion docs, the following example is given:
suite contains:
Product
Theme 1
Feature 1
Sub-Feature 1
Sub-Feature 2
Feature 2
It would be great if the documentation could use the same terms for tests that the example gives
- e.g. is Product = suite? and is Theme a Specification? and then Example a subFeature?
And is there any term for the separate sub-conditions for each row run within an example (markdown) table?
e.g. is the structure:
- Suite
- Specification1
- Specification2
__________________________________________________________
Trying to make sure I understand the terms correctly, I made a simple test class
It's base class contains:
@BeforeSuite
def printMessageBeforeSuite() {
log.debug("printing message before Suite")
}
@BeforeSuite
def printMessageAfterSuite() {
log.debug("printing message after Suite")
}
@BeforeSpecification
def printMessageBeforeSpecification() {
log.debug(" printing message before Specification")
}
@AfterSpecification
def printMessageAfterSpecification() {
log.debug(" printing message after Specification")
}
@BeforeExample
def printMessageBeforeExample() {
log.debug(" printing message before Example")
}
@AfterExample
def printMessageAfterExample() {
log.debug(" printing message after Example")
}__________________________________________________________
When I run one test spec, the output contained:
printing message before example
printing message after example
I'm guessing this doesn't print Suite messages because a "suite" only runs when a test runs other tests (as a wrapper using the run command)?
__________________________________________________________
So I created a suite e.g.
MyExampleTestSuite
-- MyExampleTest1
-- MyExampleTest2
The suite contains
- **[MyExampleTest1](MyExampleTest1.md "c:run")**
- **[MyExampleTest2](MyExampleTest2.md "c:run")**
__________________________________________________________
The example tests inherit from the base class (so they get the before/after hooks) and contain examples like:
# **Example Test1**
**Given** some condition
**Then** something should happen
| [run][] [Scenario](- "c:example" ) | [testVal](- "#testVal") | [Result](- "?=#result") |
| ----------------------------------- | ---------------------- | --------------------- |
| 1 scenario1 | 123 | pass |
| 2 scenario2 | 234 | pass |
[run]: - "#result=doSomething(#testVal)"
**And** if we do something else...
| [run][] [Scenario](- "c:example" ) | [testVal2](- "#testVal2") | [Result](- "?=#result") |
| ----------------------------------- | ---------------------- | --------------------- |
| 1 scenario3 | 123 | pass |
| 2 scenario4 | 234 | pass |
[run]: - "#result=doSomethingElse(#testVal2)"
__________________________________________________________
I was assuming it would print
- printing message before Suite
- printing message before Specification
- printing message before Example
- printing message after Example
- printing message after Specification
- printing message after Suite
But instead it printed:
- printing message before Suite
- printing message after Suite
- printing message before Specification
- printing message before Example
- printing message after Example
- printing message after Specification
(I added indention to aid in understanding of what parts contain other parts)
Can anyone please explain:
- Why the AfterSuite message is printed before the spec message instead of at the end?
- Why are there not 2 sets of example hooks fired (since there are 2 example tables?)
- Why a test that doesn't use the run command (e.g. manually running MyExampleTest1) prints the BeforeExample and AfterExample hooks but not the Specification hooks?
Thanks for your patience - it would be great to get clarity on this, and maybe it can help the documentation if it isnt clear enough?
Cheers
Andy