-
Notifications
You must be signed in to change notification settings - Fork 1
/
UICAlertScenario.m
49 lines (40 loc) · 2.1 KB
/
UICAlertScenario.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// UICAlertScenario.m
// UICatalog
//
// Created by Michele Titolo on 3/5/13.
//
//
#import "UICAlertScenario.h"
#import "KIFTestStep.h"
#import "KIFTestStep+UICAdditions.h"
@implementation UICAlertScenario
+ (void)initialize
{
[UICAlertScenario setDefaultStepsToSetUp:[NSArray arrayWithObject:[KIFTestStep stepToReset]]];
}
+ (id)scenarioToOpenSimpleAlert
{
KIFTestScenario *scenario = [KIFTestScenario scenarioWithDescription:@"Test that we can open a simple alert."];
[scenario addStep:[KIFTestStep stepToScrollToItemWithAccessibilityLabel:NSLocalizedString(@"AlertTitle", @"")]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:NSLocalizedString(@"AlertTitle", @"")]];
[scenario addStep:[KIFTestStep stepToWaitForTimeInterval:1 description:@"Wait for push animation"]];
[scenario addStep:[KIFTestStep stepToScrollToItemWithAccessibilityLabel:@"UIAlertView Show Simple"]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"UIAlertView Show Simple"]];
[scenario addStep:[KIFTestStep stepToWaitForViewWithAccessibilityLabel:@"Alert Simple"]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"OK"]];
return scenario;
}
+ (id)scenarioToOpenOkCancelAlert
{
KIFTestScenario *scenario = [KIFTestScenario scenarioWithDescription:@"Test that we can open a simple alert."];
[scenario addStep:[KIFTestStep stepToScrollToItemWithAccessibilityLabel:NSLocalizedString(@"AlertTitle", @"")]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:NSLocalizedString(@"AlertTitle", @"")]];
[scenario addStep:[KIFTestStep stepToWaitForTimeInterval:1 description:@"Wait for push animation"]];
[scenario addStep:[KIFTestStep stepToScrollToItemWithAccessibilityLabel:@"UIAlertView Show OK-Cancel"]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"UIAlertView Show OK-Cancel"]];
[scenario addStep:[KIFTestStep stepToWaitForViewWithAccessibilityLabel:@"Alert OK-Cancel"]];
[scenario addStep:[KIFTestStep stepToTapViewWithAccessibilityLabel:@"OK"]];
return scenario;
}
@end