diff --git a/TestsUI/ChatTester.m b/TestsUI/ChatTester.m index be3c980be..7616bc62a 100644 --- a/TestsUI/ChatTester.m +++ b/TestsUI/ChatTester.m @@ -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"]; diff --git a/TestsUI/LinphoneTestCase.h b/TestsUI/LinphoneTestCase.h index f7e15bc6a..9b5092759 100644 --- a/TestsUI/LinphoneTestCase.h +++ b/TestsUI/LinphoneTestCase.h @@ -21,6 +21,8 @@ - (UITableView *)findTableView:(NSString *)table; +- (void)waitForRegistration; + @end #define ASSERT_EQ(actual, expected) \ diff --git a/TestsUI/LinphoneTestCase.m b/TestsUI/LinphoneTestCase.m index 966842000..842fa1de1 100644 --- a/TestsUI/LinphoneTestCase.m +++ b/TestsUI/LinphoneTestCase.m @@ -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 diff --git a/TestsUI/WizardTester.m b/TestsUI/WizardTester.m index 3e39986fc..c21059b39 100644 --- a/TestsUI/WizardTester.m +++ b/TestsUI/WizardTester.m @@ -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 {