From 935b78d53ac8e7444890d41bf814d897fb229bf7 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Tue, 7 Jul 2015 15:07:24 +0200 Subject: [PATCH] LinphoneUITester: try to fix last failing tests on travis --- .travis.yml | 4 ++-- Classes/LinphoneManager.m | 2 +- KifTests/ChatTester.m | 10 +++++----- KifTests/ContactsTester.m | 2 ++ 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 87f18b38b..2972982ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,8 +27,8 @@ install: - mkdir -p $KIF_SCREENSHOTS script: - - xctool -project linphone.xcodeproj -scheme linphone -sdk iphonesimulator8.1 build 1>/dev/null - - xctool -project linphone.xcodeproj -scheme linphone -sdk iphonesimulator8.1 test + - xctool -project linphone.xcodeproj -scheme linphone -sdk iphonesimulator${VERSION} build 1>/dev/null + - xctool -project linphone.xcodeproj -scheme linphone -sdk iphonesimulator${VERSION} test after_script: - ./Tools/imgur_upload.sh diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 2af127a7e..b64b28bec 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -2059,7 +2059,7 @@ static void audioRouteChangeListenerCallback ( if (enabled) { NSLog(@"Enabling debug logs"); linphone_core_enable_logs_with_cb((OrtpLogFunc)linphone_iphone_log_handler); - ortp_set_log_level_mask(ORTP_DEBUG|ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL); + linphone_core_set_log_level(ORTP_DEBUG); linphone_core_enable_log_collection(enabled); } else { NSLog(@"Disabling debug logs"); diff --git a/KifTests/ChatTester.m b/KifTests/ChatTester.m index ae7500274..6f15ab140 100644 --- a/KifTests/ChatTester.m +++ b/KifTests/ChatTester.m @@ -118,12 +118,15 @@ break; } ASSERT_EQ([[LinphoneManager instance] fileTransferDelegates].count, 0); + [tester scrollViewWithAccessibilityIdentifier:@"Chat list" byFractionOfSizeHorizontal:0.f vertical:1.f]; 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 waitForViewWithAccessibilityLabel:@"Download"]; [tester tapViewWithAccessibilityLabel:@"Download"]; [tester waitForTimeInterval:.2f]; // just wait a few secs to start download - if (i != 2) - [tester scrollViewWithAccessibilityIdentifier:@"Chat list" byFractionOfSizeHorizontal:0.f vertical:-.5f]; } while ([LinphoneManager instance].fileTransferDelegates.count > 0) { [tester waitForTimeInterval:.5]; @@ -276,10 +279,7 @@ ASSERT_EQ([[LinphoneManager instance] fileTransferDelegates].count, 0); [self uploadImageWithQuality:@"Minimum"]; ASSERT_EQ([[LinphoneManager instance] fileTransferDelegates].count, 1); - [self goBackFromChat]; - // if we go back to the same chatroom, the message should be still there - [self startChatWith:[self me]]; UITableView *tv = [self findTableView:@"Chat list"]; ASSERT_EQ([tv numberOfRowsInSection:0], 1); diff --git a/KifTests/ContactsTester.m b/KifTests/ContactsTester.m index 0bbafb2b6..9f3670c94 100644 --- a/KifTests/ContactsTester.m +++ b/KifTests/ContactsTester.m @@ -126,11 +126,13 @@ // remove all numbers for (NSInteger i = 0; i < phones.count; i++) { [self tapEditButtonForRowAtIndexPath:0 inSection:ContactSections_Number]; + [tester waitForTappableViewWithAccessibilityLabel:@"Delete"]; [tester tapViewWithAccessibilityLabel:@"Delete"]; } // remove all SIPs for (NSInteger i = 0; i < SIPs.count; i++) { [self tapEditButtonForRowAtIndexPath:0 inSection:ContactSections_Sip]; + [tester waitForTappableViewWithAccessibilityLabel:@"Delete"]; [tester tapViewWithAccessibilityLabel:@"Delete"]; } [tester tapViewWithAccessibilityLabel:@"Edit"];