From 30acc6286d597767d05dd9b4f84a4ee642530778 Mon Sep 17 00:00:00 2001 From: Rossen Hristov Date: Tue, 13 Oct 2015 16:24:03 +0300 Subject: [PATCH 1/4] Playing with the unit test in order to blind-fix it for the PR build. --- apps/tests/ui/tab-view/tab-view-tests.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/tests/ui/tab-view/tab-view-tests.ts b/apps/tests/ui/tab-view/tab-view-tests.ts index c7c682c47..edbf79007 100644 --- a/apps/tests/ui/tab-view/tab-view-tests.ts +++ b/apps/tests/ui/tab-view/tab-view-tests.ts @@ -544,7 +544,8 @@ function testLoadedAndUnloadedAreFired_WhenNavigatingAwayAndBack(enablePageCache // Go back to the test page. helper.goBack(); } - TKUnit.waitUntilReady(() => { return items[0].view.isLoaded; }, ASYNC); + //TKUnit.waitUntilReady(() => { return items[0].view.isLoaded; }, ASYNC); + TKUnit.wait(500); //console.log("loaded items: " + loadedItems.join(", ")); //console.log("unloadedItems items: " + unloadedItems.join(", ")); From d66ec1cf1e0ea212aefd4ceae9d6ff44be71d23e Mon Sep 17 00:00:00 2001 From: Rossen Hristov Date: Tue, 13 Oct 2015 16:40:49 +0300 Subject: [PATCH 2/4] Playing with the unit test in order to blind-fix it for the PR build. --- apps/tests/ui/tab-view/tab-view-tests.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/tests/ui/tab-view/tab-view-tests.ts b/apps/tests/ui/tab-view/tab-view-tests.ts index edbf79007..0c3901a2d 100644 --- a/apps/tests/ui/tab-view/tab-view-tests.ts +++ b/apps/tests/ui/tab-view/tab-view-tests.ts @@ -545,13 +545,13 @@ function testLoadedAndUnloadedAreFired_WhenNavigatingAwayAndBack(enablePageCache helper.goBack(); } //TKUnit.waitUntilReady(() => { return items[0].view.isLoaded; }, ASYNC); - TKUnit.wait(500); + TKUnit.wait(1); - //console.log("loaded items: " + loadedItems.join(", ")); - //console.log("unloadedItems items: " + unloadedItems.join(", ")); + console.log(">>>>>>>>>>>>> loaded items: " + loadedItems.join(", ")); + console.log(">>>>>>>>>>>>> unloadedItems items: " + unloadedItems.join(", ")); // Check that at least the first item is loaded and unloaded - TKUnit.assert(items[0].view.isLoaded, "Thecontent of the first tab should be loaded."); + TKUnit.assert(items[0].view.isLoaded, "The content of the first tab should be loaded."); TKUnit.assertEqual(loadedItems[0], 1, "loaded count for 1st item"); TKUnit.assertEqual(unloadedItems[0], 1, "unloaded count for 1st item"); From 3cb2d8a9155b615f667cb5612104f6202cea6cc5 Mon Sep 17 00:00:00 2001 From: Rossen Hristov Date: Tue, 13 Oct 2015 17:03:39 +0300 Subject: [PATCH 3/4] Playing with the unit test in order to blind-fix it for the PR build. --- apps/tests/ui/scroll-view/scroll-view-tests.ts | 4 +++- apps/tests/ui/tab-view/tab-view-tests.ts | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/tests/ui/scroll-view/scroll-view-tests.ts b/apps/tests/ui/scroll-view/scroll-view-tests.ts index d4972357a..b7b13f395 100644 --- a/apps/tests/ui/scroll-view/scroll-view-tests.ts +++ b/apps/tests/ui/scroll-view/scroll-view-tests.ts @@ -236,7 +236,9 @@ export function test_scrollToHorizontalOffset_with_animation() { // No synchronous change. TKUnit.assertEqual(scrollView.horizontalOffset, 0, "scrollView.horizontalOffset"); - TKUnit.waitUntilReady(() => { return scrollView.horizontalOffset === 100 }, ASYNC); + //For some reason this wait here causes the test to fail on PR builds. + //TKUnit.waitUntilReady(() => { return scrollView.horizontalOffset === 100 }, ASYNC); + TKUnit.wait(1); // The scrolling animation should be finished by now TKUnit.assertAreClose(scrollView.horizontalOffset, 100, 0.1, "scrollView.horizontalOffset"); diff --git a/apps/tests/ui/tab-view/tab-view-tests.ts b/apps/tests/ui/tab-view/tab-view-tests.ts index 0c3901a2d..89d1f9210 100644 --- a/apps/tests/ui/tab-view/tab-view-tests.ts +++ b/apps/tests/ui/tab-view/tab-view-tests.ts @@ -544,11 +544,13 @@ function testLoadedAndUnloadedAreFired_WhenNavigatingAwayAndBack(enablePageCache // Go back to the test page. helper.goBack(); } + + //For some reason this wait here causes the test to fail on PR builds. //TKUnit.waitUntilReady(() => { return items[0].view.isLoaded; }, ASYNC); TKUnit.wait(1); - console.log(">>>>>>>>>>>>> loaded items: " + loadedItems.join(", ")); - console.log(">>>>>>>>>>>>> unloadedItems items: " + unloadedItems.join(", ")); + //console.log(">>>>>>>>>>>>> loaded items: " + loadedItems.join(", ")); + //console.log(">>>>>>>>>>>>> unloadedItems items: " + unloadedItems.join(", ")); // Check that at least the first item is loaded and unloaded TKUnit.assert(items[0].view.isLoaded, "The content of the first tab should be loaded."); From ddb281cff0ae1b0c4325ac4a5db2bdd58e3f26d5 Mon Sep 17 00:00:00 2001 From: Rossen Hristov Date: Tue, 13 Oct 2015 17:22:27 +0300 Subject: [PATCH 4/4] Playing with the unit test in order to blind-fix it for the PR build. --- apps/tests/ui/scroll-view/scroll-view-tests.ts | 6 ++---- apps/tests/ui/tab-view/tab-view-tests.ts | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/tests/ui/scroll-view/scroll-view-tests.ts b/apps/tests/ui/scroll-view/scroll-view-tests.ts index b7b13f395..2b7947f4f 100644 --- a/apps/tests/ui/scroll-view/scroll-view-tests.ts +++ b/apps/tests/ui/scroll-view/scroll-view-tests.ts @@ -24,7 +24,7 @@ import scrollViewModule = require("ui/scroll-view"); //  -var ASYNC = 0.3; +var ASYNC = 2; var tmp: buttonModule.Button; var newPage: page.Page; @@ -236,9 +236,7 @@ export function test_scrollToHorizontalOffset_with_animation() { // No synchronous change. TKUnit.assertEqual(scrollView.horizontalOffset, 0, "scrollView.horizontalOffset"); - //For some reason this wait here causes the test to fail on PR builds. - //TKUnit.waitUntilReady(() => { return scrollView.horizontalOffset === 100 }, ASYNC); - TKUnit.wait(1); + TKUnit.waitUntilReady(() => { return scrollView.horizontalOffset === 100 }, ASYNC); // The scrolling animation should be finished by now TKUnit.assertAreClose(scrollView.horizontalOffset, 100, 0.1, "scrollView.horizontalOffset"); diff --git a/apps/tests/ui/tab-view/tab-view-tests.ts b/apps/tests/ui/tab-view/tab-view-tests.ts index 89d1f9210..a60927522 100644 --- a/apps/tests/ui/tab-view/tab-view-tests.ts +++ b/apps/tests/ui/tab-view/tab-view-tests.ts @@ -39,7 +39,7 @@ import tabViewModule = require("ui/tab-view"); // ``` // -var ASYNC = 0.3; +var ASYNC = 2; function _createTabView(): tabViewModule.TabView { // @@ -545,9 +545,7 @@ function testLoadedAndUnloadedAreFired_WhenNavigatingAwayAndBack(enablePageCache helper.goBack(); } - //For some reason this wait here causes the test to fail on PR builds. - //TKUnit.waitUntilReady(() => { return items[0].view.isLoaded; }, ASYNC); - TKUnit.wait(1); + TKUnit.waitUntilReady(() => { return items[0].view.isLoaded; }, ASYNC); //console.log(">>>>>>>>>>>>> loaded items: " + loadedItems.join(", ")); //console.log(">>>>>>>>>>>>> unloadedItems items: " + unloadedItems.join(", "));