diff --git a/tests/app/App_Resources/Android/drawable-nodpi/icon.png b/tests/app/App_Resources/Android/drawable-nodpi/icon.png new file mode 100755 index 000000000..1034356e2 Binary files /dev/null and b/tests/app/App_Resources/Android/drawable-nodpi/icon.png differ diff --git a/tests/app/application-settings-tests.ts b/tests/app/application-settings/application-settings-tests.ts similarity index 99% rename from tests/app/application-settings-tests.ts rename to tests/app/application-settings/application-settings-tests.ts index 2934baa4b..4cdea8d7d 100644 --- a/tests/app/application-settings-tests.ts +++ b/tests/app/application-settings/application-settings-tests.ts @@ -2,7 +2,7 @@ var appSettings = require("application-settings"); // << application-settings-require -import * as TKUnit from "./TKUnit"; +import * as TKUnit from "../TKUnit"; var stringKey:string = "stringKey"; var boolKey: string = "boolKey"; diff --git a/tests/app/application-settings.md b/tests/app/application-settings/application-settings.md similarity index 100% rename from tests/app/application-settings.md rename to tests/app/application-settings/application-settings.md diff --git a/tests/app/application-tests-common.ts b/tests/app/application/application-tests-common.ts similarity index 95% rename from tests/app/application-tests-common.ts rename to tests/app/application/application-tests-common.ts index cbb22945b..0e7a76e30 100644 --- a/tests/app/application-tests-common.ts +++ b/tests/app/application/application-tests-common.ts @@ -11,7 +11,7 @@ if (app.android) { } // << application-app-check -import * as TKUnit from "./TKUnit"; +import * as TKUnit from "../TKUnit"; export var testInitialized = function () { if (platform.device.os === platform.platformNames.android) { diff --git a/tests/app/application-tests.android.ts b/tests/app/application/application-tests.android.ts similarity index 98% rename from tests/app/application-tests.android.ts rename to tests/app/application/application-tests.android.ts index b7b2ab166..3964b8bb1 100644 --- a/tests/app/application-tests.android.ts +++ b/tests/app/application/application-tests.android.ts @@ -1,6 +1,6 @@ /* tslint:disable:no-unused-variable */ import * as app from "tns-core-modules/application"; -import * as TKUnit from "./TKUnit"; +import * as TKUnit from "../TKUnit"; import * as commonTests from "./application-tests-common"; global.moduleMerge(commonTests, exports); diff --git a/tests/app/application/application-tests.d.ts b/tests/app/application/application-tests.d.ts new file mode 100644 index 000000000..882585320 --- /dev/null +++ b/tests/app/application/application-tests.d.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +import * as android from "./application-tests.android"; +import * as iOS from "./application-tests.ios"; \ No newline at end of file diff --git a/tests/app/application-tests.ios.ts b/tests/app/application/application-tests.ios.ts similarity index 97% rename from tests/app/application-tests.ios.ts rename to tests/app/application/application-tests.ios.ts index 08a4a433a..6be1a1073 100644 --- a/tests/app/application-tests.ios.ts +++ b/tests/app/application/application-tests.ios.ts @@ -1,6 +1,6 @@ /* tslint:disable:no-unused-variable */ import * as app from "tns-core-modules/application"; -import * as TKUnit from "./TKUnit"; +import * as TKUnit from "../TKUnit"; import * as commonTests from "./application-tests-common"; import * as utils from "tns-core-modules/utils/utils"; diff --git a/tests/app/application.md b/tests/app/application/application.md similarity index 100% rename from tests/app/application.md rename to tests/app/application/application.md diff --git a/tests/app/color-tests.ts b/tests/app/color/color-tests.ts similarity index 99% rename from tests/app/color-tests.ts rename to tests/app/color/color-tests.ts index 33ec362dc..02a020ebb 100644 --- a/tests/app/color-tests.ts +++ b/tests/app/color/color-tests.ts @@ -2,7 +2,7 @@ import * as colorModule from "tns-core-modules/color"; var Color = colorModule.Color; // << color-require -import * as TKUnit from "./TKUnit"; +import * as TKUnit from "../TKUnit"; export var test_Hex_Color = function () { // >> color-hex diff --git a/tests/app/color.md b/tests/app/color/color.md similarity index 100% rename from tests/app/color.md rename to tests/app/color/color.md diff --git a/tests/app/connectivity-tests.ts b/tests/app/connectivity/connectivity-tests.ts similarity index 100% rename from tests/app/connectivity-tests.ts rename to tests/app/connectivity/connectivity-tests.ts diff --git a/tests/app/connectivity.md b/tests/app/connectivity/connectivity.md similarity index 100% rename from tests/app/connectivity.md rename to tests/app/connectivity/connectivity.md diff --git a/tests/app/console-tests.ts b/tests/app/console/console-tests.ts similarity index 100% rename from tests/app/console-tests.ts rename to tests/app/console/console-tests.ts diff --git a/tests/app/console.md b/tests/app/console/console.md similarity index 100% rename from tests/app/console.md rename to tests/app/console/console.md diff --git a/tests/app/fetch-tests.ts b/tests/app/fetch/fetch-tests.ts similarity index 99% rename from tests/app/fetch-tests.ts rename to tests/app/fetch/fetch-tests.ts index 5e40cae37..9b9e6edc1 100644 --- a/tests/app/fetch-tests.ts +++ b/tests/app/fetch/fetch-tests.ts @@ -1,5 +1,5 @@ /* tslint:disable:no-unused-variable */ -import * as TKUnit from "./TKUnit"; +import * as TKUnit from "../TKUnit"; import * as types from "tns-core-modules/utils/types"; export var test_fetch_defined = function () { diff --git a/tests/app/fetch.md b/tests/app/fetch/fetch.md similarity index 100% rename from tests/app/fetch.md rename to tests/app/fetch/fetch.md diff --git a/tests/app/file-system-tests.ts b/tests/app/file-system/file-system-tests.ts similarity index 99% rename from tests/app/file-system-tests.ts rename to tests/app/file-system/file-system-tests.ts index 313513839..53a66f9e4 100644 --- a/tests/app/file-system-tests.ts +++ b/tests/app/file-system/file-system-tests.ts @@ -3,7 +3,7 @@ import * as fs from "tns-core-modules/file-system"; // << file-system-require -import * as TKUnit from "./TKUnit"; +import * as TKUnit from "../TKUnit"; import * as appModule from "tns-core-modules/application"; import * as platform from "tns-core-modules/platform"; diff --git a/tests/app/file-system.md b/tests/app/file-system/file-system.md similarity index 100% rename from tests/app/file-system.md rename to tests/app/file-system/file-system.md diff --git a/tests/app/fps-meter-tests.ts b/tests/app/fps-meter/fps-meter-tests.ts similarity index 100% rename from tests/app/fps-meter-tests.ts rename to tests/app/fps-meter/fps-meter-tests.ts diff --git a/tests/app/fps-meter.md b/tests/app/fps-meter/fps-meter.md similarity index 100% rename from tests/app/fps-meter.md rename to tests/app/fps-meter/fps-meter.md diff --git a/tests/app/http-string-worker.ts b/tests/app/http/http-string-worker.ts similarity index 100% rename from tests/app/http-string-worker.ts rename to tests/app/http/http-string-worker.ts diff --git a/tests/app/http-tests.ts b/tests/app/http/http-tests.ts similarity index 99% rename from tests/app/http-tests.ts rename to tests/app/http/http-tests.ts index f5a606d6a..e1f01037f 100644 --- a/tests/app/http-tests.ts +++ b/tests/app/http/http-tests.ts @@ -1,5 +1,5 @@ /* tslint:disable:no-unused-variable */ -import * as TKUnit from "./TKUnit"; +import * as TKUnit from "../TKUnit"; import * as http from "tns-core-modules/http"; import * as types from "tns-core-modules/utils/types"; import * as fs from "tns-core-modules/file-system"; diff --git a/tests/app/http.md b/tests/app/http/http.md similarity index 100% rename from tests/app/http.md rename to tests/app/http/http.md diff --git a/tests/app/image-source-tests.ts b/tests/app/image-source/image-source-tests.ts similarity index 93% rename from tests/app/image-source-tests.ts rename to tests/app/image-source/image-source-tests.ts index 8c616011c..448883fc6 100644 --- a/tests/app/image-source-tests.ts +++ b/tests/app/image-source/image-source-tests.ts @@ -9,20 +9,17 @@ import * as imageSource from "tns-core-modules/image-source"; import * as fs from "tns-core-modules/file-system"; import * as app from "tns-core-modules/application"; -import * as TKUnit from "./TKUnit"; +import * as TKUnit from "../TKUnit"; import * as platform from "tns-core-modules/platform"; -var imagePath = fs.path.join(__dirname, "/logo.png"); -var smallImagePath = fs.path.join(__dirname, "/small-image.png"); +var imagePath = "~/logo.png"; +var smallImagePath = "~/small-image.png"; -/* TODO: We need a way to programmatically add an image to resources and then load it from, otherwise we do not know if there is such resource in the target native app. export function testFromResource() { - // >> imagesource-resname - var img = imageSource.fromResource("logo"); - // << imagesource-resname + var img = imageSource.fromResource("icon"); TKUnit.assert(img.height > 0, "image.fromResource failed"); } -*/ + export function testFromUrl(done) { //var completed; var result: imageSource.ImageSource; diff --git a/tests/app/image-source.md b/tests/app/image-source/image-source.md similarity index 100% rename from tests/app/image-source.md rename to tests/app/image-source/image-source.md diff --git a/tests/app/platform-tests.ts b/tests/app/platform/platform-tests.ts similarity index 97% rename from tests/app/platform-tests.ts rename to tests/app/platform/platform-tests.ts index 7a7ac3d06..81de067d5 100644 --- a/tests/app/platform-tests.ts +++ b/tests/app/platform/platform-tests.ts @@ -1,4 +1,4 @@ -import * as TKUnit from "./TKUnit"; +import * as TKUnit from "../TKUnit"; import * as app from "tns-core-modules/application"; import { isIOS, isAndroid } from "tns-core-modules/platform"; diff --git a/tests/app/platform.md b/tests/app/platform/platform.md similarity index 100% rename from tests/app/platform.md rename to tests/app/platform/platform.md diff --git a/tests/app/testRunner.ts b/tests/app/testRunner.ts index fe8ffcdd5..9912756cd 100644 --- a/tests/app/testRunner.ts +++ b/tests/app/testRunner.ts @@ -8,6 +8,8 @@ import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout"; import * as platform from "tns-core-modules/platform"; import "./ui-test"; import * as fs from "tns-core-modules/file-system"; +import { unsetValue } from "tns-core-modules/ui/core/properties"; +import { ad } from "tns-core-modules/utils/utils"; Frame.defaultAnimatedNavigation = false; @@ -29,80 +31,206 @@ export function isRunningOnEmulator(): boolean { export var allTests = {}; -allTests["PLATFORM"] = require("./platform-tests"); -allTests["FILE SYSTEM"] = require("./file-system-tests"); -allTests["HTTP"] = require("./http-tests"); -allTests["XHR"] = require("./xhr-tests"); -allTests["FETCH"] = require("./fetch-tests"); -allTests["APPLICATION SETTINGS"] = require("./application-settings-tests"); -allTests["APPLICATION"] = require("./application-tests"); -allTests["IMAGE SOURCE"] = require("./image-source-tests"); -allTests["OBSERVABLE-ARRAY"] = require("./data/observable-array-tests"); -allTests["VIRTUAL-ARRAY"] = require("./data/virtual-array-tests"); -allTests["OBSERVABLE"] = require("./data/observable-tests"); -allTests["TIMER"] = require("./timer-tests"); -allTests["COLOR"] = require("./color-tests"); +import * as platformTests from "./platform/platform-tests"; +allTests["PLATFORM"] = platformTests; -// allTests["DEPENDENCY-OBSERVABLE"] = require("./ui/dependency-observable-tests"); -allTests["BINDABLE"] = require("./ui/bindable-tests"); -allTests["BINDING-EXPRESSIONS"] = require("./ui/binding-expressions-tests"); -allTests["XML-PARSER"] = require("./xml-parser-tests/xml-parser-tests"); -allTests["FORMATTEDSTRING"] = require("./text/formatted-string-tests"); -allTests["FILE-SYSTEM-ACCESS"] = require("./file-system-access-tests/file-system-access-tests"); -allTests["FILE-NAME-RESOLVER"] = require("./file-name-resolver-tests/file-name-resolver-tests"); -allTests["WEAK-EVENTS"] = require("./weak-event-listener-tests"); -allTests["CONNECTIVITY"] = require("./connectivity-tests"); +import * as fsTests from "./file-system/file-system-tests"; +allTests["FILE SYSTEM"] = fsTests; -allTests["PROXY-VIEW-CONTAINER"] = require("./ui/proxy-view-container/proxy-view-container-tests") -allTests["SCROLL-VIEW"] = require("./ui/scroll-view/scroll-view-tests"); -allTests["ACTION-BAR"] = require("./ui/action-bar/action-bar-tests"); -allTests["XML-DECLARATION"] = require("./xml-declaration/xml-declaration-tests"); -allTests["DOCKLAYOUT"] = require("./ui/layouts/dock-layout-tests"); -allTests["WRAPLAYOUT"] = require("./ui/layouts/wrap-layout-tests"); -allTests["ABSOLUTELAYOUT"] = require("./ui/layouts/absolute-layout-tests"); -allTests["GRIDLAYOUT"] = require("./ui/layouts/grid-layout-tests"); -allTests["STACKLAYOUT"] = require("./ui/layouts/stack-layout-tests"); -allTests["FLEXBOXLAYOUT"] = require("./ui/layouts/flexbox-layout-tests"); -allTests["STYLE-PROPERTIES"] = require("./ui/styling/style-properties-tests"); -allTests["FRAME"] = require("./ui/frame/frame-tests"); -allTests["VIEW"] = require("./ui/view/view-tests"); -allTests["STYLE"] = require("./ui/styling/style-tests"); -allTests["VISUAL-STATE"] = require("./ui/styling/visual-state-tests"); -allTests["VALUE-SOURCE"] = require("./ui/styling/value-source-tests"); -allTests["CSS-SELECTOR-PARSER"] = require("./ui/styling/css-selector-parser"); -allTests["CSS-SELECTOR"] = require("./ui/styling/css-selector"); -allTests["BUTTON"] = require("./ui/button/button-tests"); -allTests["BORDER"] = require("./ui/border/border-tests"); -allTests["LABEL"] = require("./ui/label/label-tests"); -allTests["TAB-VIEW"] = require("./ui/tab-view/tab-view-tests"); -allTests["TAB-VIEW-NAVIGATION"] = require("./ui/tab-view/tab-view-navigation-tests"); -allTests["IMAGE"] = require("./ui/image/image-tests"); -allTests["SLIDER"] = require("./ui/slider/slider-tests"); -allTests["SWITCH"] = require("./ui/switch/switch-tests"); -allTests["PROGRESS"] = require("./ui/progress/progress-tests"); -allTests["PLACEHOLDER"] = require("./ui/placeholder/placeholder-tests"); -allTests["PAGE"] = require("./ui/page/page-tests"); -allTests["LISTVIEW"] = require("./ui/list-view/list-view-tests"); -allTests["ACTIVITY-INDICATOR"] = require("./ui/activity-indicator/activity-indicator-tests"); -allTests["TEXT-FIELD"] = require("./ui/text-field/text-field-tests"); -allTests["TEXT-VIEW"] = require("./ui/text-view/text-view-tests"); -allTests["LIST-PICKER"] = require("./ui/list-picker/list-picker-tests"); -allTests["DATE-PICKER"] = require("./ui/date-picker/date-picker-tests"); -allTests["TIME-PICKER"] = require("./ui/time-picker/time-picker-tests"); -allTests["WEB-VIEW"] = require("./ui/web-view/web-view-tests"); -allTests["HTML-VIEW"] = require("./ui/html-view/html-view-tests"); -allTests["REPEATER"] = require("./ui/repeater/repeater-tests"); -allTests["SEARCH-BAR"] = require('./ui/search-bar/search-bar-tests'); -allTests["SEGMENTED-BAR"] = require("./ui/segmented-bar/segmented-bar-tests"); -allTests["ANIMATION"] = require("./ui/animation/animation-tests"); -allTests["CSS-ANIMATION"] = require("./ui/animation/css-animation-tests"); +import * as httpTests from "./http/http-tests"; +allTests["HTTP"] = httpTests; +import * as xhrTests from "./xhr/xhr-tests"; +allTests["XHR"] = xhrTests; + +import * as fetchTests from "./fetch/fetch-tests"; +allTests["FETCH"] = fetchTests; + +import * as appSettingsTests from "./application-settings/application-settings-tests"; +allTests["APPLICATION SETTINGS"] = appSettingsTests; + +import * as applicationTests from "./application/application-tests"; +allTests["APPLICATION"] = applicationTests; + +import * as imageSourceTests from "./image-source/image-source-tests"; +allTests["IMAGE SOURCE"] = imageSourceTests; + +import * as observableArrayTests from "./data/observable-array-tests"; +allTests["OBSERVABLE-ARRAY"] = observableArrayTests; + +import * as virtualArrayTests from "./data/virtual-array-tests"; +allTests["VIRTUAL-ARRAY"] = virtualArrayTests; + +import * as observableTests from "./data/observable-tests"; +allTests["OBSERVABLE"] = observableTests; + +import * as timerTests from "./timer/timer-tests"; +allTests["TIMER"] = timerTests; + +import * as colorTests from "./color/color-tests"; +allTests["COLOR"] = colorTests; + +import * as bindableTests from "./ui/core/bindable/bindable-tests"; +allTests["BINDABLE"] = bindableTests; + +import * as bindintExpressionTests from "./ui/core/bindable/binding-expressions-tests"; +allTests["BINDING-EXPRESSIONS"] = bindintExpressionTests; + +import * as xmlParserTests from "./xml-parser-tests/xml-parser-tests"; +allTests["XML-PARSER"] = xmlParserTests; + +import * as formattedStringTests from "./text/formatted-string-tests"; +allTests["FORMATTEDSTRING"] = formattedStringTests; + +import * as fileSystemAccessTests from "./file-system-access-tests/file-system-access-tests"; +allTests["FILE-SYSTEM-ACCESS"] = fileSystemAccessTests; + +import * as fileNameResolverTests from "./file-name-resolver-tests/file-name-resolver-tests"; +allTests["FILE-NAME-RESOLVER"] = fileNameResolverTests; + +import * as weakEventsTests from "./ui/core/weak-event-listener/weak-event-listener-tests"; +allTests["WEAK-EVENTS"] = weakEventsTests; + +import * as connectivityTests from "./connectivity/connectivity-tests"; +allTests["CONNECTIVITY"] = connectivityTests; + +import * as proxyViewContainerTests from "./ui/proxy-view-container/proxy-view-container-tests"; +allTests["PROXY-VIEW-CONTAINER"] = proxyViewContainerTests; + +import * as scrollViewTests from "./ui/scroll-view/scroll-view-tests"; +allTests["SCROLL-VIEW"] = scrollViewTests; + +import * as actionBarTests from "./ui/action-bar/action-bar-tests"; +allTests["ACTION-BAR"] = actionBarTests; + +import * as xmlDeclarationTests from "./xml-declaration/xml-declaration-tests"; +allTests["XML-DECLARATION"] = xmlDeclarationTests; + +import * as dockLayoutTests from "./ui/layouts/dock-layout-tests"; +allTests["DOCKLAYOUT"] = dockLayoutTests; + +import * as wrapLayoutTests from "./ui/layouts/wrap-layout-tests"; +allTests["WRAPLAYOUT"] = wrapLayoutTests; + +import * as absoluteLayoutTests from "./ui/layouts/absolute-layout-tests"; +allTests["ABSOLUTELAYOUT"] = absoluteLayoutTests; + +import * as gridLayoutTests from "./ui/layouts/grid-layout-tests"; +allTests["GRIDLAYOUT"] = gridLayoutTests; + +import * as stackLayoutTests from "./ui/layouts/stack-layout-tests"; +allTests["STACKLAYOUT"] = stackLayoutTests; + +import * as flexBoxLayoutTests from "./ui/layouts/flexbox-layout-tests"; +allTests["FLEXBOXLAYOUT"] = flexBoxLayoutTests; + +import * as stylePropertiesTests from "./ui/styling/style-properties-tests"; +allTests["STYLE-PROPERTIES"] = stylePropertiesTests; + +import * as frameTests from "./ui/frame/frame-tests"; +allTests["FRAME"] = frameTests; + +import * as viewTests from "./ui/view/view-tests"; +allTests["VIEW"] = viewTests; + +import * as styleTests from "./ui/styling/style-tests"; +allTests["STYLE"] = styleTests; + +import * as visualStateTests from "./ui/styling/visual-state-tests"; +allTests["VISUAL-STATE"] = visualStateTests; + +import * as valueSourceTests from "./ui/styling/value-source-tests"; +allTests["VALUE-SOURCE"] = valueSourceTests; + +import * as cssSelectorParserTests from "./ui/styling/css-selector-parser"; +allTests["CSS-SELECTOR-PARSER"] = cssSelectorParserTests; + +import * as cssSelectorTests from "./ui/styling/css-selector"; +allTests["CSS-SELECTOR"] = cssSelectorTests; + +import * as buttonTests from "./ui/button/button-tests"; +allTests["BUTTON"] = buttonTests; + +import * as borderTests from "./ui/border/border-tests"; +allTests["BORDER"] = borderTests; + +import * as labelTests from "./ui/label/label-tests"; +allTests["LABEL"] = labelTests; + +import * as tabViewTests from "./ui/tab-view/tab-view-tests"; +allTests["TAB-VIEW"] = tabViewTests; + +import * as tabViewNavigationTests from "./ui/tab-view/tab-view-navigation-tests"; +allTests["TAB-VIEW-NAVIGATION"] = tabViewNavigationTests; + +import * as imageTests from "./ui/image/image-tests"; +allTests["IMAGE"] = imageTests; + +import * as sliderTests from "./ui/slider/slider-tests"; +allTests["SLIDER"] = sliderTests; + +import * as switchTests from "./ui/switch/switch-tests"; +allTests["SWITCH"] = switchTests; + +import * as progressTests from "./ui/progress/progress-tests"; +allTests["PROGRESS"] = progressTests; + +import * as placeholderTests from "./ui/placeholder/placeholder-tests"; +allTests["PLACEHOLDER"] = placeholderTests; + +import * as pageTests from "./ui/page/page-tests"; +allTests["PAGE"] = pageTests; + +import * as listViewTests from "./ui/list-view/list-view-tests"; +allTests["LISTVIEW"] = listViewTests; + +import * as activityIndicatorTests from "./ui/activity-indicator/activity-indicator-tests"; +allTests["ACTIVITY-INDICATOR"] = activityIndicatorTests; + +import * as textFieldTests from "./ui/text-field/text-field-tests"; +allTests["TEXT-FIELD"] = textFieldTests; + +import * as textViewTests from "./ui/text-view/text-view-tests"; +allTests["TEXT-VIEW"] = textViewTests; + +import * as listPickerTests from "./ui/list-picker/list-picker-tests"; +allTests["LIST-PICKER"] = listPickerTests; + +import * as datePickerTests from "./ui/date-picker/date-picker-tests"; +allTests["DATE-PICKER"] = datePickerTests; + +import * as timePickerTests from "./ui/time-picker/time-picker-tests"; +allTests["TIME-PICKER"] = timePickerTests; + +import * as webViewTests from "./ui/web-view/web-view-tests"; +allTests["WEB-VIEW"] = webViewTests; + +import * as htmlViewTests from "./ui/html-view/html-view-tests"; +allTests["HTML-VIEW"] = htmlViewTests; + +import * as repeaterTests from "./ui/repeater/repeater-tests"; +allTests["REPEATER"] = repeaterTests; + +import * as searchBarTests from "./ui/search-bar/search-bar-tests"; +allTests["SEARCH-BAR"] = searchBarTests; + +import * as segmentedBarTests from "./ui/segmented-bar/segmented-bar-tests"; +allTests["SEGMENTED-BAR"] = segmentedBarTests; + +import * as animationTests from "./ui/animation/animation-tests"; +allTests["ANIMATION"] = animationTests; + +import * as cssAnimationTests from "./ui/animation/css-animation-tests"; +allTests["CSS-ANIMATION"] = cssAnimationTests; + +import * as transitionTests from "./navigation/transition-tests"; // Skip transitions on android emulators with API 23 if (!(platform.device.os === platform.platformNames.android && parseInt(platform.device.sdkVersion) === 23 && isRunningOnEmulator())) { - allTests["TANSITIONS"] = require("./navigation/transition-tests"); + allTests["TANSITIONS"] = transitionTests; } -allTests["NAVIGATION"] = require("./navigation/navigation-tests"); +import * as navigationTests from "./navigation/navigation-tests"; +allTests["NAVIGATION"] = navigationTests; var testsWithLongDelay = { test_Transitions: 3 * 60 * 1000, @@ -208,7 +336,17 @@ function printRunTestStats() { messageContainer.editable = messageContainer.autocorrect = false; messageContainer.text = finalMessage; stack.addChild(messageContainer); - topmost().currentPage.content = stack; + const page = topmost().currentPage; + page.id = unsetValue; + page.className = unsetValue; + page.bindingContext = unsetValue; + page.style.color = unsetValue; + page.style.backgroundColor = unsetValue; + page.content = stack; + messageContainer.focus(); + if (page.android) { + setTimeout(() => messageContainer.dismissSoftInput()); + } } function startLog(): void { diff --git a/tests/app/timer-tests.ts b/tests/app/timer/timer-tests.ts similarity index 99% rename from tests/app/timer-tests.ts rename to tests/app/timer/timer-tests.ts index 08eac111d..57a48e560 100644 --- a/tests/app/timer-tests.ts +++ b/tests/app/timer/timer-tests.ts @@ -1,4 +1,4 @@ -import * as TKUnit from "./TKUnit"; +import * as TKUnit from "../TKUnit"; import * as timer from "tns-core-modules/timer"; // >> timer-require diff --git a/tests/app/timer.md b/tests/app/timer/timer.md similarity index 100% rename from tests/app/timer.md rename to tests/app/timer/timer.md diff --git a/tests/app/trace-tests.ts b/tests/app/trace/trace-tests.ts similarity index 100% rename from tests/app/trace-tests.ts rename to tests/app/trace/trace-tests.ts diff --git a/tests/app/trace.md b/tests/app/trace/trace.md similarity index 100% rename from tests/app/trace.md rename to tests/app/trace/trace.md diff --git a/tests/app/ui/action-bar/action-bar-tests-common.ts b/tests/app/ui/action-bar/action-bar-tests-common.ts index 1cbbbae1c..0c5133d35 100644 --- a/tests/app/ui/action-bar/action-bar-tests-common.ts +++ b/tests/app/ui/action-bar/action-bar-tests-common.ts @@ -1,7 +1,6 @@ import * as TKUnit from "../../TKUnit"; import * as helper from "../helper"; import * as builder from "tns-core-modules/ui/builder"; -import * as fs from "tns-core-modules/file-system"; import { Label } from "tns-core-modules/ui/label"; import { Button } from "tns-core-modules/ui/button"; import { Page } from "tns-core-modules/ui/page"; @@ -212,10 +211,8 @@ export function test_Setting_ActionItemsWithNumberAsText_doesnt_thrown() { let gotException = false; - const moduleName = __dirname.substr(fs.knownFolders.currentApp().path.length); - try { - helper.navigateToModule(moduleName + "/ActionBar_NumberAsText"); + helper.navigateToModule("ui/action-bar/ActionBar_NumberAsText"); } catch (e) { gotException = true; @@ -225,8 +222,8 @@ export function test_Setting_ActionItemsWithNumberAsText_doesnt_thrown() { } export function test_CanDefineEverythingAsContentBetweenTheTwoTags() { - const moduleName = __dirname.substr(fs.knownFolders.currentApp().path.length); - helper.navigateToModuleAndRunTest(moduleName + "/ActionBar_BetweenTags", undefined, (page: Page) => { + + helper.navigateToModuleAndRunTest("ui/action-bar/ActionBar_BetweenTags", undefined, (page: Page) => { TKUnit.assertNotNull(page.actionBar.navigationButton); TKUnit.assertEqual(page.actionBar.navigationButton.text, "nb"); diff --git a/tests/app/ui/action-bar/action-bar-tests.d.ts b/tests/app/ui/action-bar/action-bar-tests.d.ts new file mode 100644 index 000000000..03c7bb7c5 --- /dev/null +++ b/tests/app/ui/action-bar/action-bar-tests.d.ts @@ -0,0 +1,3 @@ +/* tslint:disable */ +import * as android from "./action-bar-tests.android"; +import * as iOS from "./action-bar-tests.ios"; \ No newline at end of file diff --git a/tests/app/ui/border/border-tests.ts b/tests/app/ui/border/border-tests.ts index 0548aee33..1425ebd4f 100644 --- a/tests/app/ui/border/border-tests.ts +++ b/tests/app/ui/border/border-tests.ts @@ -1,4 +1,5 @@ // >> border-require -var borderModule = require("ui/border"); +import { Border } from "tns-core-modules/ui/border"; // << border-require -console.dir(borderModule); + +console.dir(Border); \ No newline at end of file diff --git a/tests/app/ui/bindable-tests.ts b/tests/app/ui/core/bindable/bindable-tests.ts similarity index 98% rename from tests/app/ui/bindable-tests.ts rename to tests/app/ui/core/bindable/bindable-tests.ts index d9a03ae9d..7ebb0285e 100644 --- a/tests/app/ui/bindable-tests.ts +++ b/tests/app/ui/core/bindable/bindable-tests.ts @@ -1,12 +1,11 @@ import { Observable, fromObject, fromObjectRecursive } from "tns-core-modules/data/observable"; import { ViewBase } from "tns-core-modules/ui/core/view-base"; import { BindingOptions } from "tns-core-modules/ui/core/bindable"; -import * as TKUnit from "../TKUnit"; +import * as TKUnit from "../../../TKUnit"; import * as types from "tns-core-modules/utils/types"; -import * as helper from "../ui/helper"; +import * as helper from "../../helper"; import * as utils from "tns-core-modules/utils/utils"; import * as bindingBuilder from "tns-core-modules/ui/builder/binding-builder"; -import * as fs from "tns-core-modules/file-system"; import * as appModule from "tns-core-modules/application"; import * as trace from "tns-core-modules/trace"; import { View } from "tns-core-modules/ui/core/view"; @@ -502,24 +501,22 @@ export function test_TwoElementsBindingToSameBindingContext() { TKUnit.assertEqual(upperStackLabel.text, label1.text, "label1"); TKUnit.assertEqual(upperStackLabel.text, label2.text, "label2"); }; - const moduleName = __dirname.substr(fs.knownFolders.currentApp().path.length); - helper.navigateToModuleAndRunTest(("." + moduleName + "/bindingContext_testPage"), null, testFunc); + helper.navigateToModuleAndRunTest(("ui/core/bindable/bindingContext_testPage"), null, testFunc); }; export function test_BindingContext_NavigatingForwardAndBack() { const expectedValue = "Tralala"; - const moduleName = __dirname.substr(fs.knownFolders.currentApp().path.length); const testFunc = function (page: Page) { const innerTestFunc = function (childPage: Page) { const testTextField: TextField = (childPage.getViewById("testTextField")); testTextField.text = expectedValue; }; - helper.navigateToModuleAndRunTest(("." + moduleName + "/bindingContext_testPage2"), page.bindingContext, innerTestFunc); + helper.navigateToModuleAndRunTest(("ui/core/bindable/bindingContext_testPage2"), page.bindingContext, innerTestFunc); const testLabel: Label =