FitNesse. SuiteAcceptanceTests. SuiteWidgetTests.
TestParentVariables [add child]

 Scenario Libraries

Test variables declared on parent page.

When a variable is expressed on a page, if that variable was not defined on that page, then FitNesse looks on the parent pages until it finds one that has the variable.


Test parent variable

script
start Page Builder
line !define x {1}
page ParentPage
script
start Page Builder
line x is ${x}
page ParentPage.SubPage
Response Requester.
uri valid? contents?
ParentPage.SubPage true  
Response Examiner.
type pattern matches? wrapped html?
contents x is 1 true  


Make sure child variables override parent variables.

script
start Page Builder
line !define x {2}
line x is ${x}
page ParentPage.SubPageTwo
Response Requester.
uri valid? contents?
ParentPage.SubPageTwo true  
Response Examiner.
type pattern matches? wrapped html?
contents x is 2 true