mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-27 16:09:20 +00:00
Use localized strings in tester (not yet complete)
This commit is contained in:
parent
2c163da517
commit
c70325edea
3 changed files with 26 additions and 24 deletions
|
|
@ -18,23 +18,23 @@
|
|||
[super beforeAll];
|
||||
[self switchToValidAccountIfNeeded];
|
||||
|
||||
[tester tapViewWithAccessibilityLabel:@"Chat"];
|
||||
[tester tapViewWithAccessibilityLabel:LOCALIZED(@"Chat")];
|
||||
}
|
||||
|
||||
#pragma mark - tools
|
||||
|
||||
- (void)goBackFromChat {
|
||||
[tester tapViewWithAccessibilityLabel:@"Back"];
|
||||
[tester tapViewWithAccessibilityLabel:LOCALIZED(@"Back")];
|
||||
}
|
||||
|
||||
- (void)startChatWith:(NSString*)user {
|
||||
[tester enterText:user intoViewWithAccessibilityLabel:@"Enter a address"];
|
||||
[tester tapViewWithAccessibilityLabel:@"New Discussion"];
|
||||
[tester enterText:user intoViewWithAccessibilityLabel:LOCALIZED(@"Enter a address")];
|
||||
[tester tapViewWithAccessibilityLabel:LOCALIZED(@"New Discussion")];
|
||||
}
|
||||
|
||||
- (void)sendMessage:(NSString*)message {
|
||||
[tester enterText:message intoViewWithAccessibilityLabel:@"Message field"];
|
||||
[tester tapViewWithAccessibilityLabel:@"Send"];
|
||||
[tester enterText:message intoViewWithAccessibilityLabel:LOCALIZED(@"Message field")];
|
||||
[tester tapViewWithAccessibilityLabel:LOCALIZED(@"Send")];
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -45,10 +45,10 @@
|
|||
|
||||
[self sendMessage:@"Hello"];
|
||||
|
||||
[tester waitForViewWithAccessibilityLabel:@"Outgoing message" value:@"Hello" traits:UIAccessibilityTraitStaticText];
|
||||
[tester waitForViewWithAccessibilityLabel:@"Incoming message" value:@"Hello" traits:UIAccessibilityTraitStaticText];
|
||||
[tester waitForViewWithAccessibilityLabel:LOCALIZED(@"Outgoing message") value:@"Hello" traits:UIAccessibilityTraitStaticText];
|
||||
[tester waitForViewWithAccessibilityLabel:LOCALIZED(@"Incoming message") value:@"Hello" traits:UIAccessibilityTraitStaticText];
|
||||
|
||||
[tester waitForViewWithAccessibilityLabel:@"Message status" value:@"delivered" traits:UIAccessibilityTraitImage];
|
||||
[tester waitForViewWithAccessibilityLabel:LOCALIZED(@"Message status") value:@"delivered" traits:UIAccessibilityTraitImage];
|
||||
|
||||
[self goBackFromChat];
|
||||
}
|
||||
|
|
@ -57,8 +57,8 @@
|
|||
|
||||
[self startChatWith:@"sip://toto"];
|
||||
|
||||
[tester waitForViewWithAccessibilityLabel:@"Invalid address" traits:UIAccessibilityTraitStaticText];
|
||||
[tester tapViewWithAccessibilityLabel:@"Cancel"];
|
||||
[tester waitForViewWithAccessibilityLabel:LOCALIZED(@"Invalid address") traits:UIAccessibilityTraitStaticText];
|
||||
[tester tapViewWithAccessibilityLabel:LOCALIZED(@"Cancel")];
|
||||
}
|
||||
|
||||
-(void)testSendToSIPAddress{
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
|
||||
[self startChatWith:sipAddr];
|
||||
|
||||
[tester waitForViewWithAccessibilityLabel:@"Contact name" value:@"testios" traits:0];
|
||||
[tester waitForViewWithAccessibilityLabel:LOCALIZED(@"Contact name") value:@"testios" traits:0];
|
||||
|
||||
[self goBackFromChat];
|
||||
}
|
||||
|
|
@ -78,11 +78,11 @@
|
|||
[self startChatWith:user];
|
||||
[self sendMessage:@"Hello Bro"];
|
||||
|
||||
[tester tapViewWithAccessibilityLabel:@"Edit" traits:UIAccessibilityTraitButton];
|
||||
[tester tapViewWithAccessibilityLabel:LOCALIZED(@"Edit") traits:UIAccessibilityTraitButton];
|
||||
|
||||
[tester tapViewWithAccessibilityLabel:@"Delete message"];
|
||||
[tester tapViewWithAccessibilityLabel:LOCALIZED(@"Delete message")];
|
||||
|
||||
[tester tapViewWithAccessibilityLabel:@"Edit" traits:UIAccessibilityTraitButton];
|
||||
[tester tapViewWithAccessibilityLabel:LOCALIZED(@"Edit") traits:UIAccessibilityTraitButton];
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
#import <KIF/KIF.h>
|
||||
|
||||
#define LOCALIZED(X) NSLocalizedString(X, nil)
|
||||
|
||||
@interface LinphoneTestCase : KIFTestCase
|
||||
@property BOOL invalidAccountSet;
|
||||
|
||||
|
|
|
|||
|
|
@ -91,23 +91,23 @@ static bool invalidAccount = true;
|
|||
|
||||
if( invalidAccount && ! [self hasValidProxyConfig] ){
|
||||
|
||||
[tester tapViewWithAccessibilityLabel:@"Settings"];
|
||||
[tester tapViewWithAccessibilityLabel:@"Run assistant"];
|
||||
[tester tapViewWithAccessibilityLabel:LOCALIZED(@"Settings")];
|
||||
[tester tapViewWithAccessibilityLabel:LOCALIZED(@"Wizard")];
|
||||
[tester waitForTimeInterval:0.5];
|
||||
if( [tester tryFindingViewWithAccessibilityLabel:@"Launch Wizard" error:nil]){
|
||||
[tester tapViewWithAccessibilityLabel:@"Launch Wizard"];
|
||||
if( [tester tryFindingViewWithAccessibilityLabel:LOCALIZED(@"Launch Wizard") error:nil]){
|
||||
[tester tapViewWithAccessibilityLabel:LOCALIZED(@"Launch Wizard")];
|
||||
[tester waitForTimeInterval:0.5];
|
||||
}
|
||||
|
||||
NSLog(@"Switching to a valid account");
|
||||
|
||||
[tester tapViewWithAccessibilityLabel:@"Start"];
|
||||
[tester tapViewWithAccessibilityLabel:@"Sign in linphone.org account"];
|
||||
[tester tapViewWithAccessibilityLabel:LOCALIZED(@"Start")];
|
||||
[tester tapViewWithAccessibilityLabel:LOCALIZED(@"Sign in linphone.org account")];
|
||||
|
||||
[tester enterText:@"testios" intoViewWithAccessibilityLabel:@"Username"];
|
||||
[tester enterText:@"testtest" intoViewWithAccessibilityLabel:@"Password"];
|
||||
[tester enterText:@"testios" intoViewWithAccessibilityLabel:LOCALIZED(@"Username")];
|
||||
[tester enterText:@"testtest" intoViewWithAccessibilityLabel:LOCALIZED(@"Password")];
|
||||
|
||||
[tester tapViewWithAccessibilityLabel:@"Sign in"];
|
||||
[tester tapViewWithAccessibilityLabel:LOCALIZED(@"Sign in")];
|
||||
|
||||
invalidAccount = false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue