-
Notifications
You must be signed in to change notification settings - Fork 913
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ffd57e5
commit c2e68f6
Showing
4 changed files
with
160 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// AccessibilityActivateTests_ViewTestActor.m | ||
// KIF Tests | ||
// | ||
// Created by Alex Odawa on 09/07/2024. | ||
// | ||
|
||
#import <KIF/KIF.h> | ||
|
||
@interface AccessibilityActivateTests_ViewTestActor : KIFTestCase | ||
@end | ||
|
||
|
||
@implementation AccessibilityActivateTests_ViewTestActor | ||
|
||
- (void)beforeEach | ||
{ | ||
[[viewTester usingLabel:@"Accessibility"] tap]; | ||
} | ||
|
||
- (void)afterEach | ||
{ | ||
[[[viewTester usingLabel:@"Test Suite"] usingTraits:UIAccessibilityTraitButton] tap]; | ||
} | ||
|
||
- (void)testAccessibilityActivate | ||
{ | ||
[[viewTester usingLabel:@"AccessibilityView"] performAccessibilityActivateWithExpectedResult:YES]; | ||
[[viewTester usingValue:@"Activated"] tryFindingView]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// AccessibilityViewController.m | ||
// Test Host | ||
// | ||
// Created by Alex Odawa on 17/09/2024. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface AccessibilityViewController_AccessibilityView : UIView | ||
@property (nonatomic, strong) UILabel *label; | ||
@end | ||
|
||
|
||
@implementation AccessibilityViewController_AccessibilityView | ||
- (instancetype)initWithCoder:(NSCoder *)coder { | ||
self = [super initWithCoder:coder]; | ||
self.isAccessibilityElement = YES; | ||
self.accessibilityLabel = @"AccessibilityView"; | ||
self.backgroundColor = [UIColor systemPinkColor]; | ||
self.label = [[UILabel alloc] initWithFrame:CGRectZero]; | ||
self.label.text = @"Inactive"; | ||
[self addSubview:self.label]; | ||
return self; | ||
} | ||
|
||
-(void)layoutSubviews { | ||
[super layoutSubviews]; | ||
[self.label sizeToFit]; | ||
self.label.frame = CGRectMake(self.frame.size.width - self.label.frame.size.width / 2, | ||
self.frame.size.height - self.label.frame.size.height / 2, | ||
self.label.frame.size.width, | ||
self.label.frame.size.height); | ||
} | ||
|
||
- (BOOL)accessibilityActivate { | ||
self.backgroundColor = [UIColor systemTealColor]; | ||
self.accessibilityValue = @"Activated"; | ||
self.label.text = @"Activated"; | ||
return YES; | ||
} | ||
|
||
@end | ||
|
||
@interface AccessibilityViewController : UIViewController | ||
|
||
@end | ||
|
||
@implementation AccessibilityViewController | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
// Do any additional setup after loading the view. | ||
} | ||
|
||
@end |
Oops, something went wrong.