LinphoneUITester: be more resilient to delay when registering

This commit is contained in:
Gautier Pelloux-Prayer 2015-09-16 17:03:21 +02:00
parent d3e00234cc
commit c382374ccc
4 changed files with 26 additions and 13 deletions

View file

@ -275,7 +275,9 @@
for (int i = 0; i < 3; i++) {
// messages order is not known: if upload bitrate is huge, first image can be uploaded before last started
while (![tester tryFindingTappableViewWithAccessibilityLabel:@"Download" error:nil]) {
[tester scrollViewWithAccessibilityIdentifier:@"Chat list" byFractionOfSizeHorizontal:0.f vertical:-.1f];
[tester scrollViewWithAccessibilityIdentifier:@"ChatRoom list"
byFractionOfSizeHorizontal:0.f
vertical:-.1f];
}
[tester waitForViewWithAccessibilityLabel:@"Download"];
[tester tapViewWithAccessibilityLabel:@"Download"];

View file

@ -21,6 +21,8 @@
- (UITableView *)findTableView:(NSString *)table;
- (void)waitForRegistration;
@end
#define ASSERT_EQ(actual, expected) \

View file

@ -136,12 +136,12 @@ static bool invalidAccount = true;
linphone_auth_info_destroy(testAuth);
linphone_address_destroy(testAddr);
linphone_core_set_file_transfer_server(lc, "https://www.linphone.org:444/lft.php");
// reload address book to prepend proxy config domain to contacts' phone number
[[[LinphoneManager instance] fastAddressBook] reload];
[tester waitForViewWithAccessibilityLabel:@"Registration state"
value:@"Registered"
traits:UIAccessibilityTraitStaticText];
[self waitForRegistration];
invalidAccount = false;
}
@ -158,4 +158,19 @@ static bool invalidAccount = true;
return tv;
}
- (void)waitForRegistration {
// wait for account to be registered
int timeout = 15;
while (timeout && [tester tryFindingViewWithAccessibilityLabel:@"Registration state"
value:@"Registered"
traits:UIAccessibilityTraitStaticText
error:nil]) {
[tester waitForTimeInterval:1];
timeout--;
}
[tester waitForViewWithAccessibilityLabel:@"Registration state"
value:@"Registered"
traits:UIAccessibilityTraitStaticText];
}
@end

View file

@ -53,16 +53,12 @@
[tester tapViewWithAccessibilityLabel:@"Sign in SIP account"];
[tester enterText:[self me] intoViewWithAccessibilityLabel:@"Username"];
[tester enterText:@"testtest" intoViewWithAccessibilityLabel:@"Password"];
[tester enterText:[self me] intoViewWithAccessibilityLabel:@"Password"];
[tester enterText:[self accountDomain] intoViewWithAccessibilityLabel:@"Domain"];
[tester tapViewWithAccessibilityLabel:protocol];
[tester tapViewWithAccessibilityLabel:@"Sign in"];
// check the registration state
UIView *regState = [tester waitForViewWithAccessibilityLabel:@"Registration state"];
[tester waitForTimeInterval:1];
[tester expectView:regState toContainText:@"Registered"];
[self waitForRegistration];
}
#pragma mark - Tests
@ -103,9 +99,7 @@
[self _linphoneLogin:@"testios" withPW:@"testtest"];
// check the registration state
[tester waitForViewWithAccessibilityLabel:@"Registration state"
value:@"Registered"
traits:UIAccessibilityTraitStaticText];
[self waitForRegistration];
}
- (void)testLinphoneLoginWithBadPassword {