Merge branch 'nancy/uiAutomation1'

pull/2/head
Matthew Chen 6 years ago
commit 41fb19df69

@ -38,6 +38,8 @@
NS_ASSUME_NONNULL_BEGIN
NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversationsReuseIdentifier";
typedef NS_ENUM(NSInteger, HomeViewMode) {
HomeViewMode_Archive,
HomeViewMode_Inbox,
@ -60,8 +62,6 @@ typedef NS_ENUM(NSInteger, HomeViewControllerSection) {
HomeViewControllerSectionArchiveButton,
};
NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversationsReuseIdentifier";
@interface HomeViewController () <UITableViewDelegate,
UITableViewDataSource,
UIViewControllerPreviewingDelegate,
@ -341,6 +341,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
[self.view addSubview:self.emptyInboxView];
[self.emptyInboxView autoPinWidthToSuperviewMargins];
[self.emptyInboxView autoVCenterInSuperview];
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _emptyInboxView);
[self createFirstConversationCueView];
[self.view addSubview:self.firstConversationCueView];

@ -18,6 +18,7 @@
#import <SignalMessaging/UIViewController+OWS.h>
#import <SignalServiceKit/NSString+SSK.h>
#import <SignalServiceKit/OWSPrimaryStorage.h>
#import <SignalMessaging/UIUtil.h>
NS_ASSUME_NONNULL_BEGIN
@ -136,6 +137,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
nameTextField.text = [OWSProfileManager.sharedManager localProfileName];
nameTextField.textAlignment = NSTextAlignmentRight;
nameTextField.font = [UIFont ows_mediumFontWithSize:fontSizePoints];
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, nameTextField);
[nameTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
[nameRow addSubview:nameTextField];
[nameTextField autoPinLeadingToTrailingEdgeOfView:nameLabel offset:10.f];
@ -160,10 +162,11 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
[avatarLabel autoVCenterInSuperview];
self.avatarView = [AvatarImageView new];
self.avatarView.accessibilityIdentifier = SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, @"avatarView");
UIImage *cameraImage = [UIImage imageNamed:@"settings-avatar-camera"];
self.cameraImageView = [[UIImageView alloc] initWithImage:cameraImage];
[avatarRow addSubview:self.avatarView];
[avatarRow addSubview:self.cameraImageView];
[self updateAvatarView];
@ -229,6 +232,7 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
backgroundColor:[UIColor ows_signalBrandBlueColor]
target:self
selector:@selector(saveButtonPressed)];
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, saveButton);
self.saveButton = saveButton;
[buttonRow addSubview:saveButton];
[saveButton autoPinLeadingAndTrailingToSuperviewMargin];

@ -15,6 +15,7 @@
#import <SignalMessaging/OWSNavigationController.h>
#import <SignalServiceKit/NSString+SSK.h>
#import <SignalServiceKit/SignalServiceKit-Swift.h>
#import <SignalMessaging/UIUtil.h>
NS_ASSUME_NONNULL_BEGIN
@ -81,6 +82,7 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
self.view.userInteractionEnabled = YES;
[self.view
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(backgroundTapped:)]];
self.view.accessibilityIdentifier = SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, @"root_view");
UIView *headerWrapper = [UIView containerView];
[self.view addSubview:headerWrapper];
@ -112,6 +114,7 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
legalTopMatterLabel.textAlignment = NSTextAlignmentCenter;
legalTopMatterLabel.attributedText = attributedLegalTopMatter;
legalTopMatterLabel.userInteractionEnabled = YES;
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, legalTopMatterLabel);
UITapGestureRecognizer *tapGesture =
[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapLegalTerms:)];
@ -157,6 +160,7 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
[countryRow
addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(countryCodeRowWasTapped:)]];
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, countryRow);
UILabel *countryNameLabel = [UILabel new];
countryNameLabel.text
@ -216,6 +220,7 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
[phoneNumberRow addSubview:phoneNumberTextField];
[phoneNumberTextField autoVCenterInSuperview];
[phoneNumberTextField autoPinTrailingToSuperviewMargin];
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, phoneNumberTextField);
UILabel *examplePhoneNumberLabel = [UILabel new];
self.examplePhoneNumberLabel = examplePhoneNumberLabel;
@ -253,6 +258,7 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
[activateButton autoPinLeadingAndTrailingToSuperviewMargin];
[activateButton autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:separatorView2 withOffset:15];
[activateButton autoSetDimension:ALDimensionHeight toSize:kActivateButtonHeight];
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, activateButton);
UIActivityIndicatorView *spinnerView =
[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
@ -282,6 +288,8 @@ NSString *const kKeychainKey_LastRegisteredPhoneNumber = @"kKeychainKey_LastRegi
withOffset:ScaleFromIPhone5To7Plus(8, 12)];
[bottomLegalLinkButton setCompressionResistanceHigh];
[bottomLegalLinkButton setContentHuggingHigh];
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, bottomLegalLinkButton);
}
- (void)viewDidAppear:(BOOL)animated

@ -7,6 +7,11 @@
#import <SignalServiceKit/MIMETypeUtil.h>
#import <SignalServiceKit/UIImage+OWS.h>
#define SUBVIEW_ACCESSIBILITY_IDENTIFIER(_root_view, _variable_name) \
([NSString stringWithFormat:@"%@.%@", _root_view.class, _variable_name])
#define SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(_root_view, _variable_name) \
_variable_name.accessibilityIdentifier = SUBVIEW_ACCESSIBILITY_IDENTIFIER(_root_view, (@ #_variable_name))
typedef void (^completionBlock)(void);
/**

Loading…
Cancel
Save