Validating results

When doing any sort of testing, the most important thing to be able to do is to validate the results of some operation. Simon supports this with a number of pre-processor based macros. These macros can be used in your step mappings to assert values and trigger exceptions which Simon detects and report on. Here is an example of using one of these asserts. There are many more, just check the Macro reference for a complete list.

SIMapStepToSelector(@".* goto the second view", gotoSecondView);
-(void) gotoSecondView {
    SITapButtonWithLabel(@"Second View");
    SIWaitFor(@"//UILabel[@text='Second View']", 0.2, 10);
    SIAssertLabelTextEquals(@"//UILabel[2]", @"Hello");
}
blog comments powered by Disqus

Index

Simon What is BDD? Why Simon?
Installation Quick Start Guide Simon's UI
Writing Stories Mapping Stories Step Conversations Validating Results Accessing your app's UI Exceptions and Errors
The Pieman
Macro reference API reference Simon's CLI args Pieman's CLI args Change Log Thank you BSD License

Download latest
static library
v0.2.0