forked from kif-framework/KIF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBasicCalculatorRobot.m
47 lines (34 loc) · 1.06 KB
/
BasicCalculatorRobot.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
// Licensed to Square, Inc. under one or more contributor license agreements.
// See the LICENSE file distributed with this work for the terms under
// which Square, Inc. licenses this file to you.
@import KIF;
#import "BasicCalculatorRobot.h"
@implementation BasicCalculatorRobot
#pragma mark - Public Methods
- (void)enterValue1:(NSString *)value1 value2:(NSString *)value2 operation:(NSString *)operation
{
[self enterValue1:value1];
[self enterValue2:value2];
[self setOperation:operation];
}
- (void)enterValue1:(NSString *)value
{
[[viewTester usingLabel:@"First Number"] clearAndEnterText:value];
}
- (void)enterValue2:(NSString *)value
{
[[viewTester usingLabel:@"Second Number"] clearAndEnterText:value];
}
- (void)setOperation:(NSString *)operation
{
[[viewTester usingLabel:operation] tap];
}
- (void)waitForResult:(NSString *)result
{
[[viewTester usingLabel:result] waitForView];
}
@end
BasicCalculatorRobot *basicCalculatorRobot(KIFTestCase *testCase)
{
return [[BasicCalculatorRobot alloc] initWithTestCase:testCase];
}