Test Suite 'All tests' started at 2012-02-20 17:05:44 +0000 Test Suite '/Users/.../ThrowawayTests.octest(Tests)' started at 2012-02-20 17:05:44 +0000 Test Suite 'ThrowawayTests' started at 2012-02-20 17:05:44 +0000 Test Case '-[ThrowawayTests testExample]' started. Test Case '-[ThrowawayTests testExample]' passed (0.000 seconds). Test Suite 'ThrowawayTests' finished at 2012-02-20 17:05:44 +0000. Executed 1 test, with 0 failures (0 unexpected) in 0.000 (0.000) seconds Test Suite '/Users/.../ThrowawayTests.octest(Tests)' finished at 2012-02-20 17:05:44 +0000. Executed 1 test, with 0 failures (0 unexpected) in 0.000 (0.000) seconds Test Suite 'All tests' finished at 2012-02-20 17:05:44 +0000. Executed 1 test, with 0 failures (0 unexpected) in 0.000 (0.010) seconds STAssertEqualObjects(@”a”, @”a”, @”my description”);
Test Suite 'All tests' started at 2012-02-20 17:02:01 +0000 Test Suite '/Users/.../ThrowawayTests.octest(Tests)' started at 2012-02-20 17:02:01 +0000 Test Suite 'ThrowawayTests' started at 2012-02-20 17:02:01 +0000 Test Case '-[ThrowawayTests testExample]' started. /.../ThrowawayTests.m:29: error: -[ThrowawayTests testExample] : 'a' should be equal to 'b' my description Test Case '-[ThrowawayTests testExample]' failed (0.000 seconds). Test Suite 'ThrowawayTests' finished at 2012-02-20 17:02:01 +0000. Executed 1 test, with 1 failure (0 unexpected) in 0.000 (0.000) seconds Test Suite '/Users/.../ThrowawayTests.octest(Tests)' finished at 2012-02-20 17:02:01 +0000. Executed 1 test, with 1 failure (0 unexpected) in 0.000 (0.000) seconds Test Suite 'All tests' finished at 2012-02-20 17:02:01 +0000. Executed 1 test, with 1 failure (0 unexpected) in 0.000 (0.002) seconds STAssertEqualObjects(@”a”, @”b”, @”my description”);
Frank - Feature File Feature: Login to the app Scenario: Successful login Given I launch the app When I log in with a valid userid and password Then I am on the start view
Frank - Simple Step Then /^I should see (.*) apples$/ do |count| apples = frankly_map( "label marked:'red apples'", 'tag' ) apples.count.should == count.to_i end
Frank - Textfield Step When /^I use the keyboard to fill in the textfield marked "([^\\"]*)" with "([^\\"]*)"$/ do |text_field_mark, text_to_type| text_field_selector = "view marked:'#{text_field_mark}'" check_element_exists( text_field_selector ) touch( text_field_selector ) frankly_map( text_field_selector, 'setText:', text_to_type ) frankly_map( text_field_selector, 'endEditing:', true ) end
Frank - Screencapture Step Then /^I save a screenshot with prefix (\w+)$/ do |prefix| filename = prefix + Time.now.to_i.to_s %x[screencapture #{filename}.png] end
KIF @interface EXTestController : KIFTestController @end @implementation EXTestController - (void)initializeScenarios; { [self addScenario:[KIFTestScenario scenarioToLogIn]]; // Add additional scenarios you want to test here } @end
KIF #import "KIFTestStep+EXAdditions.h" @implementation KIFTestStep (EXAdditions) + (NSArray *)stepsToGoToLoginPage; { NSMutableArray *steps = [NSMutableArray array]; // Dismiss the welcome message [steps addObject:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"That's awesome!"]]; // Tap the "I already have an account" button [steps addObject:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"I already have an account."]]; return steps; } @end