mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
chore(tests): increased wait-timeout for tests for slower ad emulators (#6172)
This commit is contained in:

committed by
GitHub

parent
17e0dcc5ed
commit
9c67d7ba02
@ -8,6 +8,8 @@ import { Page } from "tns-core-modules/ui/page";
|
||||
import * as helper from "../helper";
|
||||
import * as TKUnit from "../../TKUnit";
|
||||
|
||||
const NAV_WAIT = 8;
|
||||
|
||||
export function ignore_test_DummyTestForSnippetOnly0() {
|
||||
// >> frame-navigating
|
||||
const frame = topmost();
|
||||
@ -129,7 +131,7 @@ export function test_can_go_back() {
|
||||
|
||||
TKUnit.assertFalse(frame.canGoBack(), "14");
|
||||
frame.goBack();
|
||||
TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty());
|
||||
TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty(), NAV_WAIT);
|
||||
}
|
||||
|
||||
export function test_go_back_to_backstack_entry() {
|
||||
@ -147,7 +149,7 @@ export function test_go_back_to_backstack_entry() {
|
||||
|
||||
TKUnit.assertFalse(frame.canGoBack(), "2");
|
||||
frame.goBack();
|
||||
TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty());
|
||||
TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty(), NAV_WAIT);
|
||||
}
|
||||
|
||||
export function test_page_parent_when_backstackVisible_is_false() {
|
||||
@ -163,7 +165,7 @@ export function test_page_parent_when_backstackVisible_is_false() {
|
||||
frame.navigate({ create: () => new Page(), clearHistory: true });
|
||||
frame.navigate({ create, backstackVisible: false });
|
||||
frame.navigate(() => new Page());
|
||||
TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty());
|
||||
TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty(), NAV_WAIT);
|
||||
|
||||
TKUnit.assertEqual(pages.length, 1);
|
||||
TKUnit.assertEqual(frame.backStack.length, 1);
|
||||
@ -189,7 +191,7 @@ export function test_page_parent_when_navigate_with_clear_history() {
|
||||
frame.navigate({ create, backstackVisible: false });
|
||||
frame.navigate({ create });
|
||||
frame.navigate({ create: () => new Page(), clearHistory: true });
|
||||
TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty());
|
||||
TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty(), NAV_WAIT);
|
||||
|
||||
TKUnit.assertEqual(pages.length, 3);
|
||||
TKUnit.assertEqual(frame.backStack.length, 0);
|
||||
@ -214,7 +216,7 @@ export function test_page_parent_when_navigate_back() {
|
||||
frame.navigate({ create: () => new Page(), clearHistory: true });
|
||||
frame.navigate({ create });
|
||||
frame.goBack();
|
||||
TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty());
|
||||
TKUnit.waitUntilReady(() => frame.navigationQueueIsEmpty(), NAV_WAIT);
|
||||
|
||||
TKUnit.assertEqual(pages.length, 1);
|
||||
TKUnit.assertEqual(frame.backStack.length, 0);
|
||||
|
@ -117,12 +117,14 @@ export function test_event_LayoutChanged_IsRaised_ParentMarginChanged() {
|
||||
};
|
||||
|
||||
export function test_event_LayoutChanged_IsNotRaised_TransformChanged() {
|
||||
const test = function (views: Array<View>) {
|
||||
helper.do_PageTest_WithStackLayout_AndButton(([page, stack, button, ActionBar]) => {
|
||||
let stackLayoutChangedCount = 0;
|
||||
let buttonLayoutChangedCount = 0;
|
||||
const button = <Button>views[2];
|
||||
|
||||
views[1].on(View.layoutChangedEvent, (data) => {
|
||||
TKUnit.waitUntilReady(() => button.isLayoutValid);
|
||||
TKUnit.waitUntilReady(() => stack.isLayoutValid);
|
||||
|
||||
stack.on(View.layoutChangedEvent, (data) => {
|
||||
stackLayoutChangedCount++;
|
||||
});
|
||||
|
||||
@ -133,15 +135,13 @@ export function test_event_LayoutChanged_IsNotRaised_TransformChanged() {
|
||||
button.translateX += 50;
|
||||
button.translateY += 50;
|
||||
button.rotate += 50;
|
||||
button.height = 200;
|
||||
|
||||
TKUnit.waitUntilReady(() => button.height === 200, 5);
|
||||
TKUnit.waitUntilReady(() => button.isLayoutValid);
|
||||
TKUnit.waitUntilReady(() => stack.isLayoutValid);
|
||||
|
||||
TKUnit.assertEqual(stackLayoutChangedCount, 1);
|
||||
TKUnit.assertEqual(buttonLayoutChangedCount, 1);
|
||||
};
|
||||
|
||||
helper.do_PageTest_WithStackLayout_AndButton(test);
|
||||
TKUnit.assertEqual(stackLayoutChangedCount, 0);
|
||||
TKUnit.assertEqual(buttonLayoutChangedCount, 0);
|
||||
})
|
||||
};
|
||||
|
||||
export function test_event_LayoutChanged_IsRaised_StackLayout_SizeChanged() {
|
||||
|
Reference in New Issue
Block a user