forked from mirrors/linphone-iphone
TestsUI: add contact swipe delete and push notification tests
This commit is contained in:
parent
ead1ae3517
commit
9d0fd05d1e
7 changed files with 64 additions and 2 deletions
|
|
@ -105,6 +105,7 @@ static UICompositeViewDescription *compositeDescription = nil;
|
|||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
tableController.tableView.accessibilityIdentifier = @"Contacts table";
|
||||
[self changeView:ContactsLinphone];
|
||||
if ([tableController totalNumberOfItems] == 0) {
|
||||
[self changeView:ContactsAll];
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 2e2e314a44aa9e3949fd54c75baff376af526493
|
||||
Subproject commit 9b42150f800c618f6ef308067eeb8221fddab2b3
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
<color key="backgroundColor" red="0.90588235289999997" green="0.90588235289999997" blue="0.90588235289999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<rect key="contentStretch" x="1.3877787807814457e-17" y="0.0" width="1" height="1"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<textInputTraits key="textInputTraits" returnKeyType="done"/>
|
||||
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no" returnKeyType="done"/>
|
||||
</textField>
|
||||
<button opaque="NO" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" id="C2f-aP-xjR" userLabel="deleteButton" customClass="UIIconButton">
|
||||
<rect key="frame" x="335" y="7" width="40" height="30"/>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#import "ContactsTester.h"
|
||||
|
||||
#import "ContactDetailsTableView.h"
|
||||
#import "UIContactCell.h"
|
||||
|
||||
@implementation ContactsTester
|
||||
|
||||
|
|
@ -135,6 +136,19 @@
|
|||
[tester tapViewWithAccessibilityLabel:@"DELETE" traits:UIAccessibilityTraitButton];
|
||||
}
|
||||
|
||||
- (void)testDeleteContactWithSwipe {
|
||||
NSString *contactName = [self getUUID];
|
||||
[self createContact:contactName lastName:@"dummy" phoneNumber:@"123" SIPAddress:@"ola"];
|
||||
[tester tapViewWithAccessibilityLabel:@"Back"];
|
||||
NSString *fullName = [contactName stringByAppendingString:@" dummy"];
|
||||
|
||||
[tester swipeViewWithAccessibilityLabel:fullName inDirection:KIFSwipeDirectionLeft];
|
||||
[tester tapViewWithAccessibilityLabel:@"Delete"];
|
||||
|
||||
// we should not find this contact anymore
|
||||
XCTAssert([tester tryFindingViewWithAccessibilityLabel:fullName error:nil] == NO);
|
||||
}
|
||||
|
||||
- (void)testEditContact {
|
||||
NSString *contactName = [self getUUID];
|
||||
[self createContact:contactName lastName:@"dummy" phoneNumber:nil SIPAddress:nil];
|
||||
|
|
|
|||
12
TestsUI/NotificationTester.h
Normal file
12
TestsUI/NotificationTester.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
//
|
||||
// NotificationTester.h
|
||||
// linphone
|
||||
//
|
||||
// Created by Gautier Pelloux-Prayer on 10/03/16.
|
||||
//
|
||||
//
|
||||
#import "LinphoneTestCase.h"
|
||||
|
||||
@interface NotificationTester : LinphoneTestCase
|
||||
|
||||
@end
|
||||
29
TestsUI/NotificationTester.m
Normal file
29
TestsUI/NotificationTester.m
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// NotificationTester.m
|
||||
// linphone
|
||||
//
|
||||
// Created by Gautier Pelloux-Prayer on 10/03/16.
|
||||
//
|
||||
//
|
||||
|
||||
#import "NotificationTester.h"
|
||||
|
||||
@implementation NotificationTester
|
||||
|
||||
- (void)beforeAll {
|
||||
[super beforeAll];
|
||||
[self switchToValidAccountIfNeeded];
|
||||
}
|
||||
|
||||
- (void)testCallNotificationInBackground {
|
||||
#if !TARGET_OS_SIMULATOR
|
||||
const LinphoneAddress *addr =
|
||||
linphone_proxy_config_get_identity_address(linphone_core_get_default_proxy_config(LC));
|
||||
LinphoneChatMessage *msg = linphone_chat_room_create_message(linphone_core_get_chat_room(LC, addr), "hello my own");
|
||||
linphone_chat_room_send_chat_message(linphone_core_get_chat_room(LC, addr), msg);
|
||||
linphone_core_set_network_reachable(LC, NO);
|
||||
[tester waitForViewWithAccessibilityLabel:@"hello my own"];
|
||||
#endif
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -584,6 +584,7 @@
|
|||
63B8D6A21BCBF43100C12B09 /* UIChatCreateCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 63B8D6A01BCBF43100C12B09 /* UIChatCreateCell.m */; };
|
||||
63BC49E21BA2CDFC004EC273 /* UICallPausedCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 63BC49E11BA2CDFC004EC273 /* UICallPausedCell.m */; };
|
||||
63C441C31BBC23ED0053DC5E /* UIAssistantTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 63C441C21BBC23ED0053DC5E /* UIAssistantTextField.m */; };
|
||||
63CAACDB1C91D10200216F8D /* NotificationTester.m in Sources */ = {isa = PBXBuildFile; fileRef = 63CAACD51C91D0D100216F8D /* NotificationTester.m */; };
|
||||
63CD4B4F1A5AAC8C00B84282 /* DTAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = 63CD4B4E1A5AAC8C00B84282 /* DTAlertView.m */; };
|
||||
63CDC45E1C3BDE370085F529 /* msg.caf in Resources */ = {isa = PBXBuildFile; fileRef = 63CDC4531C3BDE370085F529 /* msg.caf */; };
|
||||
63CDC45F1C3BDE370085F529 /* ringback.wav in Resources */ = {isa = PBXBuildFile; fileRef = 63CDC4541C3BDE370085F529 /* ringback.wav */; };
|
||||
|
|
@ -1503,6 +1504,8 @@
|
|||
63BC49E11BA2CDFC004EC273 /* UICallPausedCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICallPausedCell.m; sourceTree = "<group>"; };
|
||||
63C441C11BBC23ED0053DC5E /* UIAssistantTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIAssistantTextField.h; sourceTree = "<group>"; };
|
||||
63C441C21BBC23ED0053DC5E /* UIAssistantTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIAssistantTextField.m; sourceTree = "<group>"; };
|
||||
63CAACD41C91D0D100216F8D /* NotificationTester.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationTester.h; sourceTree = "<group>"; };
|
||||
63CAACD51C91D0D100216F8D /* NotificationTester.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotificationTester.m; sourceTree = "<group>"; };
|
||||
63CD4B4D1A5AAC8C00B84282 /* DTAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DTAlertView.h; sourceTree = "<group>"; };
|
||||
63CD4B4E1A5AAC8C00B84282 /* DTAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTAlertView.m; sourceTree = "<group>"; };
|
||||
63CDC4531C3BDE370085F529 /* msg.caf */ = {isa = PBXFileReference; lastKnownFileType = file; path = msg.caf; sourceTree = "<group>"; };
|
||||
|
|
@ -2236,6 +2239,8 @@
|
|||
630589E41B4E810900EFAE36 /* LinphoneTestCase.m */,
|
||||
630589E51B4E810900EFAE36 /* AssistantTester.h */,
|
||||
630589E61B4E810900EFAE36 /* AssistantTester.m */,
|
||||
63CAACD41C91D0D100216F8D /* NotificationTester.h */,
|
||||
63CAACD51C91D0D100216F8D /* NotificationTester.m */,
|
||||
);
|
||||
path = TestsUI;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -3866,6 +3871,7 @@
|
|||
630589EB1B4E810900EFAE36 /* AssistantTester.m in Sources */,
|
||||
630589E71B4E810900EFAE36 /* ChatTester.m in Sources */,
|
||||
630589E81B4E810900EFAE36 /* ContactsTester.m in Sources */,
|
||||
63CAACDB1C91D10200216F8D /* NotificationTester.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue