Skip to content

Instantly share code, notes, and snippets.

@Kevinwlee
Created November 15, 2011 03:31
Show Gist options
  • Save Kevinwlee/1366046 to your computer and use it in GitHub Desktop.
Save Kevinwlee/1366046 to your computer and use it in GitHub Desktop.
KIF Framework After
#import "AQTestController.h"
#import "KIFTestScenario.h"
#import "KIFTestScenario+AQAdditions.h"
@implementation AQTestController
- (void)initializeScenarios {
[self addScenario:[KIFTestScenario scenarioToOpenAndCloseTheLogin]];
[self addScenario:[KIFTestScenario scenarioToOpenAndCloseTheCreateActivityScreen]];
[self addScenario:[KIFTestScenario scenarioToEnterTextIntoTheWhereBox]];
}
@end
#import "KIFTestScenario+AQAdditions.h"
#import "KIFTestStep.h"
#import "KIFTestStep+AQAdditions.h"
@implementation KIFTestScenario (AQAdditions)
+ (id)scenarioToOpenAndCloseTheLogin {
KIFTestScenario *scenario = [KIFTestScenario scenarioWithDescription:@"Test that a user can open and close the login view."];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Login"]];
[scenario addStep:[KIFTestStep stepToWaitForViewWithAccessibilityLabel:@"Login Steps"]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Close"]];
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:@"Detail"]];
return scenario;
}
@end
#import <Foundation/Foundation.h>
#import "KIFTestScenario.h"
@interface KIFTestScenario (AQAdditions)
+ (id)scenarioToOpenAndCloseTheLogin;
@end
#import <Foundation/Foundation.h>
#import "KIFTestScenario.h"
@interface KIFTestScenario (AQAdditions)
+ (id)scenarioToOpenAndCloseTheLogin;
+ (id)scenarioToOpenAndCloseTheCreateActivityScreen;
+ (id)scenarioToEnterTextIntoTheWhereBox;
@end
#import "KIFTestScenario+AQAdditions.h"
#import "KIFTestStep.h"
#import "KIFTestStep+AQAdditions.h"
@implementation KIFTestScenario (AQAdditions)
+ (id)scenarioToOpenAndCloseTheLogin {
KIFTestScenario *scenario = [KIFTestScenario scenarioWithDescription:@"Test that a user can open and close the login view."];
[scenario addStep:[KIFTestStep stepToReset]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Login"]];
[scenario addStep:[KIFTestStep stepToWaitForViewWithAccessibilityLabel:@"Login Steps"]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Close"]];
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:@"Detail"]];
return scenario;
}
+ (id)scenarioToOpenAndCloseTheCreateActivityScreen {
KIFTestScenario *scenario = [KIFTestScenario scenarioWithDescription:@"Test that a user can open and close the Create Activity view."];
[scenario addStep:[KIFTestStep stepToReset]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Add"]];
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:@"Create Activity"]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Cancel"]];
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:@"Detail"]];
return scenario;
}
+ (id)scenarioToEnterTextIntoTheWhereBox {
KIFTestScenario * scenario = [KIFTestScenario scenarioWithDescription:@"Test that a user can open the activiy view and enter data into the where box" ];
[scenario addStep:[KIFTestStep stepToReset]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Add"]];
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:@"Create Activity"]];
[scenario addStep:[KIFTestStep stepToEnterText:@"This should be in the where" intoViewWithAccessibilityLabel:@"where"]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Cancel"]];
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:@"Detail"]];
return scenario;
}
@end
#import <Foundation/Foundation.h>
#import "KIFTestScenario.h"
@interface KIFTestScenario (AQAdditions)
+ (id)scenarioToOpenAndCloseTheLogin;
+ (id)scenarioToOpenAndCloseTheCreateActivityScreen;
+ (id)scenarioToEnterTextIntoTheWhereBox;
@end
#import "KIFTestScenario+AQAdditions.h"
#import "KIFTestStep.h"
#import "KIFTestStep+AQAdditions.h"
@implementation KIFTestScenario (AQAdditions)
+ (id)scenarioToOpenAndCloseTheLogin {
KIFTestScenario *scenario = [KIFTestScenario scenarioWithDescription:@"Test that a user can open and close the login view."];
[scenario addStep:[KIFTestStep stepToReset]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Login"]];
[scenario addStep:[KIFTestStep stepToWaitForViewWithAccessibilityLabel:@"Login Steps"]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Close"]];
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:@"Detail"]];
return scenario;
}
+ (id)scenarioToOpenAndCloseTheCreateActivityScreen {
KIFTestScenario *scenario = [KIFTestScenario scenarioWithDescription:@"Test that a user can open and close the Create Activity view."];
[scenario addStep:[KIFTestStep stepToReset]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Add"]];
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:@"Create Activity"]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Cancel"]];
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:@"Detail"]];
return scenario;
}
+ (id)scenarioToEnterTextIntoTheWhereBox {
KIFTestScenario * scenario = [KIFTestScenario scenarioWithDescription:@"Test that a user can open the activiy view and enter data into the where box" ];
[scenario addStep:[KIFTestStep stepToReset]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Add"]];
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:@"Create Activity"]];
[scenario addStep:[KIFTestStep stepToEnterText:@"This should be in the where" intoViewWithAccessibilityLabel:@"where"]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"Cancel"]];
[scenario addStep:[KIFTestStep stepToWaitForTappableViewWithAccessibilityLabel:@"Detail"]];
return scenario;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment