From a0aa80c644b18639130b64bbc441cd55c6047952 Mon Sep 17 00:00:00 2001 From: giomfo Date: Fri, 27 Jan 2017 11:28:58 +0100 Subject: [PATCH] Automatic tests: Add accessibility id in alert view controller. --- Vector/ViewController/ContactDetailsViewController.m | 1 + Vector/ViewController/HomeViewController.m | 5 ++++- Vector/ViewController/RoomParticipantsViewController.m | 3 +++ Vector/ViewController/RoomSettingsViewController.m | 9 +++++++++ Vector/ViewController/RoomViewController.m | 4 ++++ Vector/ViewController/SettingsViewController.m | 10 ++++++++++ 6 files changed, 31 insertions(+), 1 deletion(-) diff --git a/Vector/ViewController/ContactDetailsViewController.m b/Vector/ViewController/ContactDetailsViewController.m index ba9ef0c72..da02be21a 100644 --- a/Vector/ViewController/ContactDetailsViewController.m +++ b/Vector/ViewController/ContactDetailsViewController.m @@ -836,6 +836,7 @@ strongSelf->currentAlert = nil; }]; + currentAlert.mxkAccessibilityIdentifier = @"ContactDetailsVCIgnoreAlert"; [currentAlert showInViewController:self]; break; } diff --git a/Vector/ViewController/HomeViewController.m b/Vector/ViewController/HomeViewController.m index 793f2428c..a6f4483ed 100644 --- a/Vector/ViewController/HomeViewController.m +++ b/Vector/ViewController/HomeViewController.m @@ -687,6 +687,7 @@ }]; + currentAlert.mxkAccessibilityIdentifier = @"HomeVCUseGoogleAnalyticsAlert"; [currentAlert showInViewController:self]; } @@ -898,6 +899,7 @@ }]; + currentAlert.mxkAccessibilityIdentifier = @"HomeVCCheckDeviceIdAlert"; [currentAlert showInViewController:self]; } } @@ -1273,6 +1275,7 @@ currentAlert.sourceView = createNewRoomImageView; + currentAlert.mxkAccessibilityIdentifier = @"HomeVCCreateRoomAlert"; [currentAlert showInViewController:self]; } @@ -1339,8 +1342,8 @@ strongSelf->currentAlert = nil; }]; + currentAlert.mxkAccessibilityIdentifier = @"HomeVCRoomCreationInProgressAlert"; [currentAlert showInViewController:self]; - } } } diff --git a/Vector/ViewController/RoomParticipantsViewController.m b/Vector/ViewController/RoomParticipantsViewController.m index 6b6a31aaf..9ccae66ba 100644 --- a/Vector/ViewController/RoomParticipantsViewController.m +++ b/Vector/ViewController/RoomParticipantsViewController.m @@ -1313,6 +1313,7 @@ }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomParticipantsVCLeaveAlert"; [currentAlert showInViewController:self]; } else @@ -1382,6 +1383,7 @@ }]; }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomParticipantsVCKickAlert"; [currentAlert showInViewController:self]; } } @@ -1511,6 +1513,7 @@ }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomParticipantsVCInviteAlert"; [currentAlert showInViewController:self]; } diff --git a/Vector/ViewController/RoomSettingsViewController.m b/Vector/ViewController/RoomSettingsViewController.m index fee96a796..af1a248d6 100644 --- a/Vector/ViewController/RoomSettingsViewController.m +++ b/Vector/ViewController/RoomSettingsViewController.m @@ -569,6 +569,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomSettingsVCSaveChangesAlert"; [currentAlert showInViewController:self]; } @@ -604,6 +605,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomSettingsVCCopyRoomIdAlert"; currentAlert.sourceView = roomIdLabel; [currentAlert showInViewController:self]; } @@ -722,6 +724,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomSettingsVCOnSelectedAliasAlert"; currentAlert.sourceView = roomAliasLabel; [currentAlert showInViewController:self]; } @@ -1024,6 +1027,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomSettingsVCSaveChangesFailedAlert"; [currentAlert showInViewController:self]; } @@ -2729,6 +2733,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomSettingsVCChangeHistoryVisibilityAlert"; [currentAlert showInViewController:self]; } @@ -2810,6 +2815,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomSettingsVCRemoveCanonicalAliasAlert"; [currentAlert showInViewController:self]; } @@ -2903,6 +2909,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomSettingsVCLeaveAlert"; [currentAlert showInViewController:self]; } @@ -2993,6 +3000,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti } }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomSettingsVCEnableEncryptionAlert"; [currentAlert showInViewController:self]; } else @@ -3182,6 +3190,7 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti } }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomSettingsVCAddAliasAlert"; [currentAlert showInViewController:self]; return NO; diff --git a/Vector/ViewController/RoomViewController.m b/Vector/ViewController/RoomViewController.m index e01895fde..f6da9ed1e 100644 --- a/Vector/ViewController/RoomViewController.m +++ b/Vector/ViewController/RoomViewController.m @@ -2049,6 +2049,7 @@ // Do not display empty action sheet if (currentAlert.cancelButtonIndex) { + currentAlert.mxkAccessibilityIdentifier = @"RoomVCEventMenuAlert"; currentAlert.sourceView = roomBubbleTableViewCell; [currentAlert showInViewController:self]; } @@ -2273,6 +2274,7 @@ strongSelf->currentAlert = nil; }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomVCCallAlert"; [currentAlert showInViewController:self]; } // In case of conference call, check that the user has enough power level @@ -2290,6 +2292,7 @@ strongSelf->currentAlert = nil; }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomVCCallAlert"; [currentAlert showInViewController:self]; } else @@ -3064,6 +3067,7 @@ }]; + currentAlert.mxkAccessibilityIdentifier = @"RoomVCUnsentMessagesMenuAlert"; currentAlert.sourceView = roomActivitiesView; [currentAlert showInViewController:self]; diff --git a/Vector/ViewController/SettingsViewController.m b/Vector/ViewController/SettingsViewController.m index 2718582d1..822677c98 100644 --- a/Vector/ViewController/SettingsViewController.m +++ b/Vector/ViewController/SettingsViewController.m @@ -535,6 +535,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(); }]; + currentAlert.mxkAccessibilityIdentifier = @"SettingsVCEmailValidationAlert"; [currentAlert showInViewController:self]; } @@ -1534,6 +1535,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(); }]; + currentAlert.mxkAccessibilityIdentifier = @"SettingsVCUnignoreAlert"; [currentAlert showInViewController:self]; } } @@ -1646,6 +1648,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(); } }]; + currentAlert.mxkAccessibilityIdentifier = @"SettingsVCSignoutAlert"; [currentAlert showInViewController:self]; } @@ -1671,6 +1674,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(); }]; + currentAlert.mxkAccessibilityIdentifier = @"SettingsVCPushNotificationsAlert"; [currentAlert showInViewController:self]; // Keep off the switch @@ -1781,6 +1785,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(); }]; + currentAlert.mxkAccessibilityIdentifier = @"SettingsVCEnableEncryptionAlert"; [currentAlert showInViewController:self]; } else @@ -2079,6 +2084,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(); }]; + currentAlert.mxkAccessibilityIdentifier = @"SettingsVCSaveChangesFailedAlert"; [currentAlert showInViewController:rootViewController]; } } @@ -2103,6 +2109,8 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(); } }]; + + currentAlert.mxkAccessibilityIdentifier = @"SettingsVCAddEmailAlert"; [currentAlert showInViewController:self]; return; @@ -2321,6 +2329,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(); }]; + strongSelf->currentAlert.mxkAccessibilityIdentifier = @"SettingsVCOnPasswordUpdatedAlert"; [strongSelf->currentAlert showInViewController:strongSelf]; } else @@ -2366,6 +2375,7 @@ typedef void (^blockSettingsViewController_onReadyToDestroy)(); }]; + strongSelf->currentAlert.mxkAccessibilityIdentifier = @"SettingsVCPasswordChangeFailedAlert"; [strongSelf->currentAlert showInViewController:rootViewController]; } }