Do Fixture performs
Method Execution and invokes
Flow Fixture Keywords. If the first fixture in a story test page is a Do Fixture, it operates in
Flow Mode. If no fixture is operating in
Flow Mode, a default Do Fixture is created for the story test page.
Member names are made by concatenating the odd numbered cells. The even numbered cells are input values.
when input is⇓
story test fixture |
check | plain test | 'sample do'
'name from first' Bob 'and last' Martin
check name 'Bob Martin' | name from first | Bob | and last | Martin |
|
| 'sample do'
'name from first' Bob 'and last' Martin
check name 'Bob Martin' | then output is | name from first | Bob | and last | Martin |
|
A custom keyword, like the
Flow Fixture Keywords, can be added to the fixture.
when input is⇓
story test fixture |
check | plain test | 'sample do'
'check digit' 5
'check digit' five | |
| 'sample do'
'check digit' 5
'check digit' five | then output is | |
Any execution that returns boolean is colored with the boolean result.
when input is⇓
story test fixture |
check | plain test | 'sample do'
set 'boolean field' true
'boolean field'
set 'boolean field' false
'boolean field' | |
| 'sample do'
set 'boolean field' true
'boolean field'
set 'boolean field' false
'boolean field' | then output is | |
If a fixture is returned, it uses the rest of the current table. The following table returns to
Flow Mode.
when input is⇓
story test fixture |
check | plain test | 'sample do'
set name Kim
|'make sample column'
name 'name length?'
Bob 3
Mike 4
check name Kim |
make sample column | name | name length? | Bob | 3 | Mike | 4 |
|
| 'sample do'
set name Kim
|'make sample column'
name 'name length?'
Bob 3
Mike 4
check name Kim | then output is |
make sample column | name | name length? | Bob | 3 | Mike | 4 |
|
If a fixture is named in the first table cell, it uses the table. The following table returns to
Flow Mode.
when input is⇓
story test fixture |
check | plain test | 'sample do'
set name Kim
|'sample column'
name 'name length?'
Bob 3
Mike 4
check name Kim |
sample column | name | name length? | Bob | 3 | Mike | 4 |
|
| 'sample do'
set name Kim
|'sample column'
name 'name length?'
Bob 3
Mike 4
check name Kim | then output is |
sample column | name | name length? | Bob | 3 | Mike | 4 |
|
'SetUp' and 'TearDown' methods are called if they exist. When the fixture controls
Flow Mode, the teardown is done at the end of the page. Teardown is done even if an exception occurs.
when input is⇓
story test fixture |
check | plain test | 'sample do'
check one 1
set name Bob
throw oops |
|
check | log | SetUp() One() set_Name(Bob) TearDown() |
| 'sample do'
check one 1
set name Bob
throw oops | then output is |
| with log | SetUp() One() set_Name(Bob) TearDown() |
When another fixture controls
Flow Mode, the teardown is done at the end of the table.
when input is⇓
story test fixture |
check | plain test | do
'sample do'
check one 1
with new 'sample domain'
set name Bob |
|
check | log | SetUp() One() TearDown() set_Name(Bob) |
| do
'sample do'
check one 1
with new 'sample domain'
set name Bob | then output is |
| with log | SetUp() One() TearDown() set_Name(Bob) |