mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
LinphoneUITester: be more resilient to delay when registering
This commit is contained in:
parent
d3e00234cc
commit
c382374ccc
4 changed files with 26 additions and 13 deletions
|
|
@ -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"];
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
- (UITableView *)findTableView:(NSString *)table;
|
||||
|
||||
- (void)waitForRegistration;
|
||||
|
||||
@end
|
||||
|
||||
#define ASSERT_EQ(actual, expected) \
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue