diff --git a/.gitignore b/.gitignore index 279bb0b08..dbbd6a8a3 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,8 @@ tscommand*.tmp.txt # Other *.js +# https://github.com/NativeScript/nativescript-dev-webpack/issues/932 +!tns-core-modules/xml/xml.js !tests/hooks/**/*.* !gruntfile.js !js-libs/**/*.* diff --git a/.vscode/launch.json b/.vscode/launch.json index cec715adc..75e18bd2f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,4 +1,7 @@ { + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { @@ -6,7 +9,12 @@ "request": "launch", "name": "Unit Tests", "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", - "args": [ "--timeout", "999999", "--opts", "unit-tests/mocha.opts" ], + "args": [ + "--timeout", + "999999", + "--opts", + "unit-tests/mocha.opts" + ], "internalConsoleOptions": "openOnSessionStart", "preLaunchTask": "tsc-unit-tests" }, @@ -19,6 +27,20 @@ "sourceMaps": true, "watch": true }, + // { + // "name": "Test on iOS", + // "type": "nativescript", + // "request": "launch", + // "platform": "ios", + // "appRoot": "${workspaceRoot}", + // "sourceMaps": true, + // "watch": false, + // "stopOnEntry": true, + // "launchTests": true, + // "tnsArgs": [ + // "--justlaunch" + // ] + // }, { "name": "Attach on iOS", "type": "nativescript", @@ -37,6 +59,32 @@ "sourceMaps": true, "watch": true }, + { + "name": "Debug tests on Android", + "type": "nativescript", + "request": "launch", + "platform": "android", + "appRoot": "${workspaceRoot}/tests", + "sourceMaps": true, + "watch": true, + // "tnsArgs": [ + // "--debug-brk" + // ] + }, + // { + // "name": "Test on Android", + // "type": "nativescript", + // "request": "launch", + // "platform": "android", + // "appRoot": "${workspaceRoot}", + // "sourceMaps": true, + // "watch": false, + // "stopOnEntry": true, + // "launchTests": true, + // "tnsArgs": [ + // "--justlaunch" + // ] + // }, { "name": "Attach on Android", "type": "nativescript", @@ -47,4 +95,4 @@ "watch": false } ] -} \ No newline at end of file +} diff --git a/DevelopmentWorkflow.md b/DevelopmentWorkflow.md index 9ae5adf61..b54e0e8da 100644 --- a/DevelopmentWorkflow.md +++ b/DevelopmentWorkflow.md @@ -42,12 +42,7 @@ Install devDependencies: npm install ``` -Run `setup` script. This will [`npm link`](https://docs.npmjs.com/cli/link) the `tns-core-modules` and `tns-core-modules-declarations` dependencies inside the `tests` and `apps` projects. - -```bash -npm run setup -``` - + ## Running Unit Tests -The test app is an ordinary NativeScript app that logs the test results as it go. -After the [initial setup](#initial-setup) you can run the tests with: - -```bash -# Make sure TypeScript is transpiled -tsc - -# Run the tests app -tns run ios --path tests -tns run android --path tests +``` +cd ./tests +tns run android| ios ``` ## Running the Test App diff --git a/WritingUnitTests.md b/WritingUnitTests.md index a6945bc1c..38fa35ca4 100644 --- a/WritingUnitTests.md +++ b/WritingUnitTests.md @@ -59,7 +59,7 @@ A test will fail if assert is not satisfied or if an error is thrown during exec There is a large set of asserting functions available in the [`tests/app/TKUnit.ts`](tests/app/TKUnit.ts) module. We recommend using those in your tests. ```typescript -import * as TKUnit from "../TKUnit"; +import * as TKUnit from "../tk-unit"; export function testSomethingWorksFast() { let arr = [1, 2, 3]; diff --git a/apps/app/App_Resources/Android/app.gradle b/apps/app/App_Resources/Android/app.gradle index 3a25fb4f7..bb4842141 100644 --- a/apps/app/App_Resources/Android/app.gradle +++ b/apps/app/App_Resources/Android/app.gradle @@ -2,16 +2,19 @@ // Uncomment to add recyclerview-v7 dependency //dependencies { -// compile 'com.android.support:recyclerview-v7:+' +// implementation 'com.android.support:recyclerview-v7:+' //} -android { - defaultConfig { +// If you want to add something to be applied before applying plugins' include.gradle files +// e.g. project.ext.googlePlayServicesVersion = "15.0.1" +// create a file named before-plugins.gradle in the current directory and place it there + +android { + defaultConfig { + minSdkVersion 17 generatedDensities = [] - applicationId = "org.nativescript.apps" - } - aaptOptions { - additionalParameters "--no-version-vectors" - } -} -project.ext.useAndroidX=true \ No newline at end of file + } + aaptOptions { + additionalParameters "--no-version-vectors" + } +} diff --git a/apps/app/App_Resources/Android/drawable-ldpi/icon.png b/apps/app/App_Resources/Android/drawable-ldpi/icon.png deleted file mode 100644 index ddfc17a71..000000000 Binary files a/apps/app/App_Resources/Android/drawable-ldpi/icon.png and /dev/null differ diff --git a/apps/app/App_Resources/Android/drawable-mdpi/icon.png b/apps/app/App_Resources/Android/drawable-mdpi/icon.png deleted file mode 100644 index 486e41091..000000000 Binary files a/apps/app/App_Resources/Android/drawable-mdpi/icon.png and /dev/null differ diff --git a/apps/app/App_Resources/Android/AndroidManifest.xml b/apps/app/App_Resources/Android/src/main/AndroidManifest.xml similarity index 60% rename from apps/app/App_Resources/Android/AndroidManifest.xml rename to apps/app/App_Resources/Android/src/main/AndroidManifest.xml index 93e4c008e..1bd6826c3 100644 --- a/apps/app/App_Resources/Android/AndroidManifest.xml +++ b/apps/app/App_Resources/Android/src/main/AndroidManifest.xml @@ -10,42 +10,27 @@ android:largeScreens="true" android:xlargeScreens="true"/> - - - - - - - - + android:theme="@style/AppTheme"> + android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode" + android:theme="@style/LaunchScreenTheme"> - + + + - diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png b/apps/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png new file mode 100644 index 000000000..eb381c258 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-hdpi/background.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png b/apps/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png new file mode 100644 index 000000000..9cde84cd5 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-hdpi/icon.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png b/apps/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png new file mode 100644 index 000000000..5218f4c90 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-hdpi/logo.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png b/apps/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png new file mode 100644 index 000000000..748b2adf5 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-ldpi/background.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png b/apps/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png new file mode 100644 index 000000000..4d6a674b3 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-ldpi/icon.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png b/apps/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png new file mode 100644 index 000000000..b9e102a76 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-ldpi/logo.png differ diff --git a/apps/app/App_Resources/Android/drawable-mdpi/add_to_fav.png b/apps/app/App_Resources/Android/src/main/res/drawable-mdpi/add_to_fav.png similarity index 100% rename from apps/app/App_Resources/Android/drawable-mdpi/add_to_fav.png rename to apps/app/App_Resources/Android/src/main/res/drawable-mdpi/add_to_fav.png diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png b/apps/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png new file mode 100644 index 000000000..efeaf2907 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-mdpi/background.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png b/apps/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png new file mode 100644 index 000000000..92ccc85a6 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-mdpi/icon.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png b/apps/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png new file mode 100644 index 000000000..626338766 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-mdpi/logo.png differ diff --git a/apps/app/App_Resources/Android/drawable-nodpi/i18x32.png b/apps/app/App_Resources/Android/src/main/res/drawable-nodpi/i18x32.png similarity index 100% rename from apps/app/App_Resources/Android/drawable-nodpi/i18x32.png rename to apps/app/App_Resources/Android/src/main/res/drawable-nodpi/i18x32.png diff --git a/apps/app/App_Resources/Android/drawable-nodpi/i32x18.png b/apps/app/App_Resources/Android/src/main/res/drawable-nodpi/i32x18.png similarity index 100% rename from apps/app/App_Resources/Android/drawable-nodpi/i32x18.png rename to apps/app/App_Resources/Android/src/main/res/drawable-nodpi/i32x18.png diff --git a/apps/app/App_Resources/Android/drawable-nodpi/i32x32.png b/apps/app/App_Resources/Android/src/main/res/drawable-nodpi/i32x32.png similarity index 100% rename from apps/app/App_Resources/Android/drawable-nodpi/i32x32.png rename to apps/app/App_Resources/Android/src/main/res/drawable-nodpi/i32x32.png diff --git a/apps/app/App_Resources/Android/drawable-hdpi/icon.png b/apps/app/App_Resources/Android/src/main/res/drawable-nodpi/icon.png similarity index 100% rename from apps/app/App_Resources/Android/drawable-hdpi/icon.png rename to apps/app/App_Resources/Android/src/main/res/drawable-nodpi/icon.png diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml b/apps/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml new file mode 100644 index 000000000..ada77f92c --- /dev/null +++ b/apps/app/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/apps/app/App_Resources/Android/drawable-nodpi/splashscreen.9.png b/apps/app/App_Resources/Android/src/main/res/drawable-nodpi/splashscreen.9.png similarity index 100% rename from apps/app/App_Resources/Android/drawable-nodpi/splashscreen.9.png rename to apps/app/App_Resources/Android/src/main/res/drawable-nodpi/splashscreen.9.png diff --git a/apps/app/App_Resources/Android/drawable-nodpi/testlogo.jpg b/apps/app/App_Resources/Android/src/main/res/drawable-nodpi/testlogo.jpg similarity index 100% rename from apps/app/App_Resources/Android/drawable-nodpi/testlogo.jpg rename to apps/app/App_Resources/Android/src/main/res/drawable-nodpi/testlogo.jpg diff --git a/apps/app/App_Resources/Android/drawable-nodpi/tile.png b/apps/app/App_Resources/Android/src/main/res/drawable-nodpi/tile.png similarity index 100% rename from apps/app/App_Resources/Android/drawable-nodpi/tile.png rename to apps/app/App_Resources/Android/src/main/res/drawable-nodpi/tile.png diff --git a/apps/app/App_Resources/Android/drawable-nodpi/up.png b/apps/app/App_Resources/Android/src/main/res/drawable-nodpi/up.png similarity index 100% rename from apps/app/App_Resources/Android/drawable-nodpi/up.png rename to apps/app/App_Resources/Android/src/main/res/drawable-nodpi/up.png diff --git a/apps/app/App_Resources/Android/drawable-nodpi/upccw.png b/apps/app/App_Resources/Android/src/main/res/drawable-nodpi/upccw.png similarity index 100% rename from apps/app/App_Resources/Android/drawable-nodpi/upccw.png rename to apps/app/App_Resources/Android/src/main/res/drawable-nodpi/upccw.png diff --git a/apps/app/App_Resources/Android/drawable-nodpi/upcw.png b/apps/app/App_Resources/Android/src/main/res/drawable-nodpi/upcw.png similarity index 100% rename from apps/app/App_Resources/Android/drawable-nodpi/upcw.png rename to apps/app/App_Resources/Android/src/main/res/drawable-nodpi/upcw.png diff --git a/apps/app/App_Resources/Android/drawable-nodpi/upflip.png b/apps/app/App_Resources/Android/src/main/res/drawable-nodpi/upflip.png similarity index 100% rename from apps/app/App_Resources/Android/drawable-nodpi/upflip.png rename to apps/app/App_Resources/Android/src/main/res/drawable-nodpi/upflip.png diff --git a/apps/app/App_Resources/Android/drawable-xhdpi/add_to_fav.png b/apps/app/App_Resources/Android/src/main/res/drawable-xhdpi/add_to_fav.png similarity index 100% rename from apps/app/App_Resources/Android/drawable-xhdpi/add_to_fav.png rename to apps/app/App_Resources/Android/src/main/res/drawable-xhdpi/add_to_fav.png diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png b/apps/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png new file mode 100644 index 000000000..612bbd072 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-xhdpi/background.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png b/apps/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png new file mode 100644 index 000000000..8bcde6277 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-xhdpi/icon.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png b/apps/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png new file mode 100644 index 000000000..ad8ee2f4b Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png differ diff --git a/apps/app/App_Resources/Android/drawable-xxhdpi/add_to_fav.png b/apps/app/App_Resources/Android/src/main/res/drawable-xxhdpi/add_to_fav.png similarity index 100% rename from apps/app/App_Resources/Android/drawable-xxhdpi/add_to_fav.png rename to apps/app/App_Resources/Android/src/main/res/drawable-xxhdpi/add_to_fav.png diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png b/apps/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png new file mode 100644 index 000000000..0fa88e235 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png b/apps/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png new file mode 100644 index 000000000..9d81c85dc Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-xxhdpi/icon.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png b/apps/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png new file mode 100644 index 000000000..668327832 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png b/apps/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png new file mode 100644 index 000000000..c650f6438 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png b/apps/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png new file mode 100644 index 000000000..9a34d0d43 Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/icon.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png b/apps/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png new file mode 100644 index 000000000..fa6331c8d Binary files /dev/null and b/apps/app/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png differ diff --git a/apps/app/App_Resources/Android/src/main/res/values-v21/colors.xml b/apps/app/App_Resources/Android/src/main/res/values-v21/colors.xml new file mode 100644 index 000000000..a64641a9d --- /dev/null +++ b/apps/app/App_Resources/Android/src/main/res/values-v21/colors.xml @@ -0,0 +1,4 @@ + + + #3d5afe + \ No newline at end of file diff --git a/apps/app/App_Resources/Android/src/main/res/values-v21/styles.xml b/apps/app/App_Resources/Android/src/main/res/values-v21/styles.xml new file mode 100644 index 000000000..dac8727c8 --- /dev/null +++ b/apps/app/App_Resources/Android/src/main/res/values-v21/styles.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/apps/app/App_Resources/Android/src/main/res/values/colors.xml b/apps/app/App_Resources/Android/src/main/res/values/colors.xml new file mode 100644 index 000000000..74ad8829c --- /dev/null +++ b/apps/app/App_Resources/Android/src/main/res/values/colors.xml @@ -0,0 +1,7 @@ + + + #F5F5F5 + #757575 + #33B5E5 + #272734 + \ No newline at end of file diff --git a/apps/app/App_Resources/Android/src/main/res/values/styles.xml b/apps/app/App_Resources/Android/src/main/res/values/styles.xml new file mode 100644 index 000000000..c793e6d4c --- /dev/null +++ b/apps/app/App_Resources/Android/src/main/res/values/styles.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json index 5f5359340..1a8b0e645 100644 --- a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,17 @@ { "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "icon-20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "icon-20@3x.png", + "scale" : "3x" + }, { "size" : "29x29", "idiom" : "iphone", @@ -30,18 +42,6 @@ "filename" : "icon-40@3x.png", "scale" : "3x" }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "icon-57.png", - "scale" : "1x" - }, - { - "size" : "57x57", - "idiom" : "iphone", - "filename" : "icon-57@2x.png", - "scale" : "2x" - }, { "size" : "60x60", "idiom" : "iphone", @@ -54,6 +54,18 @@ "filename" : "icon-60@3x.png", "scale" : "3x" }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "icon-20.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "icon-20@2x.png", + "scale" : "2x" + }, { "size" : "29x29", "idiom" : "ipad", @@ -78,30 +90,6 @@ "filename" : "icon-40@2x.png", "scale" : "2x" }, - { - "size" : "50x50", - "idiom" : "ipad", - "filename" : "icon-50.png", - "scale" : "1x" - }, - { - "size" : "50x50", - "idiom" : "ipad", - "filename" : "icon-50@2x.png", - "scale" : "2x" - }, - { - "size" : "72x72", - "idiom" : "ipad", - "filename" : "icon-72.png", - "scale" : "1x" - }, - { - "size" : "72x72", - "idiom" : "ipad", - "filename" : "icon-72@2x.png", - "scale" : "2x" - }, { "size" : "76x76", "idiom" : "ipad", @@ -119,6 +107,12 @@ "idiom" : "ipad", "filename" : "icon-83.5@2x.png", "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "icon-1024.png", + "scale" : "1x" } ], "info" : { diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png new file mode 100644 index 000000000..a1d7eb479 Binary files /dev/null and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png new file mode 100644 index 000000000..5797bdef4 Binary files /dev/null and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png new file mode 100644 index 000000000..a0bc5691b Binary files /dev/null and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png new file mode 100644 index 000000000..851ac65fb Binary files /dev/null and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png index 9e15af09d..bb9b9e86d 100644 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png index 7b9e55537..ec609dcf3 100644 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png index 76f61ec1f..a97180800 100644 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png index 15b06db11..214800ee6 100644 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png index 585065f94..8554b88a8 100644 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png index a450c421d..a22626bae 100644 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png deleted file mode 100644 index 4a62478f9..000000000 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50.png and /dev/null differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png deleted file mode 100644 index 01ff7c16c..000000000 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-50@2x.png and /dev/null differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png deleted file mode 100644 index beea81999..000000000 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57.png and /dev/null differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png deleted file mode 100644 index c3dc7b035..000000000 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-57@2x.png and /dev/null differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png index 457b6d94c..a22626bae 100644 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png index fa5a6ac86..492c9c8e8 100644 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png deleted file mode 100644 index 556bdd688..000000000 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72.png and /dev/null differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png deleted file mode 100644 index 4f69cb25b..000000000 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-72@2x.png and /dev/null differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png index 94abcf70d..9208113cf 100644 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png index 2e71dd3a0..24415e5a3 100644 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png index 4abc9ec50..b3ef1bf0c 100644 Binary files a/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png and b/apps/app/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json index 11bfcf55c..bb3b4a5f6 100644 --- a/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json +++ b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Contents.json @@ -1,5 +1,41 @@ { "images" : [ + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "2688h", + "filename" : "Default-Portrait-XS-Max.png", + "minimum-system-version" : "12.0", + "orientation" : "portrait", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "2688h", + "filename" : "Default-Landscape-XS-Max.png", + "minimum-system-version" : "12.0", + "orientation" : "landscape", + "scale" : "3x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "1792h", + "filename" : "Default-Portrait-XR.png", + "minimum-system-version" : "12.0", + "orientation" : "portrait", + "scale" : "2x" + }, + { + "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "1792h", + "filename" : "Default-Landscape-XR.png", + "minimum-system-version" : "12.0", + "orientation" : "landscape", + "scale" : "2x" + }, { "extent" : "full-screen", "idiom" : "iphone", @@ -10,12 +46,12 @@ "scale" : "3x" }, { - "orientation" : "landscape", - "idiom" : "iphone", "extent" : "full-screen", + "idiom" : "iphone", + "subtype" : "2436h", "filename" : "Default-Landscape-X.png", "minimum-system-version" : "11.0", - "subtype" : "2436h", + "orientation" : "landscape", "scale" : "3x" }, { diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XR.png b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XR.png new file mode 100644 index 000000000..686fda12d Binary files /dev/null and b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XR.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XS-Max.png b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XS-Max.png new file mode 100644 index 000000000..415e9c861 Binary files /dev/null and b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-XS-Max.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XR.png b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XR.png new file mode 100644 index 000000000..b66a4f2d5 Binary files /dev/null and b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XR.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XS-Max.png b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XS-Max.png new file mode 100644 index 000000000..e34463dd1 Binary files /dev/null and b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-XS-Max.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json index 4f4e9c506..ab5edd0ca 100644 --- a/apps/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json +++ b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json @@ -12,6 +12,7 @@ }, { "idiom" : "universal", + "filename" : "LaunchScreen-AspectFill@3x.png", "scale" : "3x" } ], diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png new file mode 100644 index 000000000..a954cc8f4 Binary files /dev/null and b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png differ diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json index 23c0ffd7a..444d7152d 100644 --- a/apps/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json +++ b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json @@ -12,6 +12,7 @@ }, { "idiom" : "universal", + "filename" : "LaunchScreen-Center@3x.png", "scale" : "3x" } ], diff --git a/apps/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png new file mode 100644 index 000000000..b2973b025 Binary files /dev/null and b/apps/app/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png differ diff --git a/apps/app/App_Resources/iOS/Info.plist b/apps/app/App_Resources/iOS/Info.plist index 383801fef..ea3e3ea23 100644 --- a/apps/app/App_Resources/iOS/Info.plist +++ b/apps/app/App_Resources/iOS/Info.plist @@ -43,10 +43,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - diff --git a/apps/app/App_Resources/iOS/LaunchScreen.storyboard b/apps/app/App_Resources/iOS/LaunchScreen.storyboard index 2ad9471e1..c4e5a3f39 100644 --- a/apps/app/App_Resources/iOS/LaunchScreen.storyboard +++ b/apps/app/App_Resources/iOS/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - - + + + + + - + + @@ -14,36 +18,36 @@ - + - + - + - + - + + - + + - + - - - + - + diff --git a/apps/app/App_Resources/iOS/build.xcconfig b/apps/app/App_Resources/iOS/build.xcconfig index 056205556..9d738435d 100644 --- a/apps/app/App_Resources/iOS/build.xcconfig +++ b/apps/app/App_Resources/iOS/build.xcconfig @@ -1,5 +1,7 @@ // You can add custom settings here // for example you can uncomment the following line to force distribution code signing // CODE_SIGN_IDENTITY = iPhone Distribution +// To build for device with XCode 8 you need to specify your development team. More info: https://developer.apple.com/library/prerelease/content/releasenotes/DeveloperTools/RN-Xcode/Introduction.html +// DEVELOPMENT_TEAM = YOUR_TEAM_ID; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; diff --git a/apps/app/app.css b/apps/app/app.css new file mode 100644 index 000000000..1ff4cdc5a --- /dev/null +++ b/apps/app/app.css @@ -0,0 +1 @@ +/* Just here to avoid startup warnings */ diff --git a/apps/app/cuteness.io/app-root.xml b/apps/app/cuteness.io/app-root.xml new file mode 100644 index 000000000..06509ce17 --- /dev/null +++ b/apps/app/cuteness.io/app-root.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/app/cuteness.io/app.css b/apps/app/cuteness.io/app.css new file mode 100644 index 000000000..b17ea2773 --- /dev/null +++ b/apps/app/cuteness.io/app.css @@ -0,0 +1 @@ +/* Add app css here */ diff --git a/apps/app/cuteness.io/app.ts b/apps/app/cuteness.io/app.ts index 94deae337..35bc0cc08 100644 --- a/apps/app/cuteness.io/app.ts +++ b/apps/app/cuteness.io/app.ts @@ -1,4 +1,6 @@ import * as application from "tns-core-modules/application"; // Start the application -application.start({ moduleName: "cuteness.io/main-page" }); \ No newline at end of file +global.registerModule("cuteness.io/app.css", () => require("~/cuteness.io/app.css")); +application.setCssFileName("cuteness.io/app.css"); +application.run({ moduleName: "cuteness.io/app-root" }); diff --git a/apps/app/perf-app/main-page.ts b/apps/app/perf-app/main-page.ts index 02e329997..0c75aeaa8 100644 --- a/apps/app/perf-app/main-page.ts +++ b/apps/app/perf-app/main-page.ts @@ -9,7 +9,7 @@ import * as frame from "tns-core-modules/ui/frame"; export function pageLoaded(args: EventData) { let page = args.object; - let view = require("ui/core/view"); + let view = require("tns-core-modules/ui/core/view"); let wrapLayout = view.getViewById(page, "wrapLayoutWithExamples"); diff --git a/apps/app/ui-tests-app/action-bar/action-item-position.ts b/apps/app/ui-tests-app/action-bar/action-item-position-page.ts similarity index 100% rename from apps/app/ui-tests-app/action-bar/action-item-position.ts rename to apps/app/ui-tests-app/action-bar/action-item-position-page.ts diff --git a/apps/app/ui-tests-app/action-bar/action-item-position.xml b/apps/app/ui-tests-app/action-bar/action-item-position-page.xml similarity index 97% rename from apps/app/ui-tests-app/action-bar/action-item-position.xml rename to apps/app/ui-tests-app/action-bar/action-item-position-page.xml index 906a5c4df..8272a576d 100644 --- a/apps/app/ui-tests-app/action-bar/action-item-position.xml +++ b/apps/app/ui-tests-app/action-bar/action-item-position-page.xml @@ -1,4 +1,4 @@ - @@ -12,4 +12,4 @@ + + + + \ No newline at end of file diff --git a/apps/app/ui-tests-app/action-bar/local-icons.ts b/e2e/ui-tests-app/app/action-bar/icons-page.ts similarity index 87% rename from apps/app/ui-tests-app/action-bar/local-icons.ts rename to e2e/ui-tests-app/app/action-bar/icons-page.ts index 9f83e7d81..b3ef18601 100644 --- a/apps/app/ui-tests-app/action-bar/local-icons.ts +++ b/e2e/ui-tests-app/app/action-bar/icons-page.ts @@ -5,8 +5,8 @@ import { ActionBar } from "tns-core-modules/ui/action-bar"; const iconModes = ["automatic", "alwaysOriginal", "alwaysTemplate", undefined]; -export function navigate(args) { - frame.topmost().navigate("ui-tests-app/action-bar/clean"); +export function navigate() { + frame.topmost().navigate("action-bar/clean-page"); } export function onChangeRenderingMode(args: EventData) { diff --git a/e2e/ui-tests-app/app/action-bar/icons-page.xml b/e2e/ui-tests-app/app/action-bar/icons-page.xml new file mode 100644 index 000000000..cde351035 --- /dev/null +++ b/e2e/ui-tests-app/app/action-bar/icons-page.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/button/main-page.ts b/e2e/ui-tests-app/app/button/main-page.ts new file mode 100644 index 000000000..b83dcf2c7 --- /dev/null +++ b/e2e/ui-tests-app/app/button/main-page.ts @@ -0,0 +1,23 @@ +import { EventData } from "tns-core-modules/data/observable"; +import { SubMainPageViewModel } from "../sub-main-page-view-model"; +import { WrapLayout } from "tns-core-modules/ui/layouts/wrap-layout"; +import { Page } from "tns-core-modules/ui/page"; + +export function pageLoaded(args: EventData) { + const page = args.object; + const wrapLayout = page.getViewById("wrapLayoutWithExamples"); + page.bindingContext = new SubMainPageViewModel(wrapLayout, loadExamples()); +} + +export function loadExamples() { + const examples = new Map(); + examples.set("btn-wrap-text-alignment-4266", "button/btn-wrap-text-alignment-4266-page"); + examples.set("button-border", "button/button-border-page"); + examples.set("styles", "button/styles-page"); + examples.set("background", "button/background-page"); + examples.set("border-playground", "button/border-playground-page"); + examples.set("issue-4287", "button/issue-4287-page"); + examples.set("issue-4385", "button/issue-4385-page"); + examples.set("highlight-4740", "button/highlight-4740/highlight-4740-page"); + return examples; +} diff --git a/e2e/ui-tests-app/app/button/main-page.xml b/e2e/ui-tests-app/app/button/main-page.xml new file mode 100644 index 000000000..33306f0d0 --- /dev/null +++ b/e2e/ui-tests-app/app/button/main-page.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/apps/app/ui-tests-app/button/styles.css b/e2e/ui-tests-app/app/button/styles-page.css similarity index 51% rename from apps/app/ui-tests-app/button/styles.css rename to e2e/ui-tests-app/app/button/styles-page.css index 451885bf9..1bd47cec9 100644 --- a/apps/app/ui-tests-app/button/styles.css +++ b/e2e/ui-tests-app/app/button/styles-page.css @@ -2,4 +2,4 @@ background-color: lightcoral; } -@import url('~/ui-tests-app/css/import.css'); \ No newline at end of file +@import url("../css/import.css"); diff --git a/e2e/ui-tests-app/app/button/styles-page.ts b/e2e/ui-tests-app/app/button/styles-page.ts new file mode 100644 index 000000000..05b053e62 --- /dev/null +++ b/e2e/ui-tests-app/app/button/styles-page.ts @@ -0,0 +1,4 @@ +export function onLoaded(args) { + var page = args.object; + page.addCss("#property { background-color: lightsalmon; }"); +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/button/styles-page.xml b/e2e/ui-tests-app/app/button/styles-page.xml new file mode 100644 index 000000000..ab51df754 --- /dev/null +++ b/e2e/ui-tests-app/app/button/styles-page.xml @@ -0,0 +1,9 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/css/elevation-page.css b/e2e/ui-tests-app/app/css/elevation-page.css new file mode 100644 index 000000000..5ebb8a2ab --- /dev/null +++ b/e2e/ui-tests-app/app/css/elevation-page.css @@ -0,0 +1,43 @@ +Label, Button { + text-align: center; + padding: 10; + margin: 16; + background-color: #bbb; +} + +.elevation-0 { + android-elevation: 0; +} + +.elevation-2 { + android-elevation: 2; +} + +.elevation-4 { + android-elevation: 4; +} + +.elevation-4:highlighted { + android-elevation: 2; +} + +.elevation-8 { + android-elevation: 8; +} + +.elevation-10 { + android-elevation: 10; +} + +.pressed-z-10 { + android-dynamic-elevation-offset: 10; +} + +.round { + color: #fff; + background-color: #ff1744; + border-radius: 50%; /* TODO kills elevation */ + width: 80; + height: 80; + android-elevation: 8; +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/css/elevation-page.ts b/e2e/ui-tests-app/app/css/elevation-page.ts new file mode 100644 index 000000000..dd7e54701 --- /dev/null +++ b/e2e/ui-tests-app/app/css/elevation-page.ts @@ -0,0 +1,20 @@ +import { Button } from "tns-core-modules/ui/button/button"; +import { EventData } from "tns-core-modules/ui/page/page"; + +const states = [ + { class: "", text: "default elevation" }, + { class: "elevation-10", text: "elevetion 10" }, + { class: "elevation-10 pressed-z-10", text: "elevetion 10 pressed-z 10" }, + { class: "elevation-0", text: "elevetion 0" }, +] +let currentState = 0; + +export function buttonTap(args: EventData) { + let btn: Button = args.object as Button; + currentState++; + if (currentState >= states.length) { + currentState = 0; + } + btn.className = states[currentState].class; + btn.text = states[currentState].text; +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/css/elevation-page.xml b/e2e/ui-tests-app/app/css/elevation-page.xml new file mode 100644 index 000000000..37a492e92 --- /dev/null +++ b/e2e/ui-tests-app/app/css/elevation-page.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/css/line-height-page.ts b/e2e/ui-tests-app/app/css/line-height-page.ts new file mode 100644 index 000000000..2254d7876 --- /dev/null +++ b/e2e/ui-tests-app/app/css/line-height-page.ts @@ -0,0 +1,20 @@ +import { EventData, TextBase } from "tns-core-modules/ui/text-base"; + +const values = [3, 7, 13]; + +export function buttonTap(args: EventData) { + let page = (args.object).page; + let lbl = page.getViewById("label"); + let btn = page.getViewById("button"); + let tv = page.getViewById("textView"); + let ft = page.getViewById("formattedText"); + + let index = values.indexOf(lbl.lineHeight); + let newIndex = (index + 1) % values.length; + let newValue = values[newIndex]; + + lbl.lineHeight = newValue; + btn.lineHeight = newValue; + tv.lineHeight = newValue; + ft.lineHeight = newValue; +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/css/line-height-page.xml b/e2e/ui-tests-app/app/css/line-height-page.xml new file mode 100644 index 000000000..362445b1e --- /dev/null +++ b/e2e/ui-tests-app/app/css/line-height-page.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/css/measure-tests-page.css b/e2e/ui-tests-app/app/css/measure-tests-page.css new file mode 100644 index 000000000..a73d01f15 --- /dev/null +++ b/e2e/ui-tests-app/app/css/measure-tests-page.css @@ -0,0 +1,11 @@ +.c { + border-width: 5; padding: 5; border-color: magenta; background-color: cyan; +} + +.c1 { + border-width: 5; border-color: red green blue yellow; background-color: white; horizontal-align: left; margin: 1; +} + +.c2 { + border-width: 5; padding: 10; border-color: red green blue yellow; background-color: white; horizontal-align: left; margin: 1; +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/css/measure-tests-page.xml b/e2e/ui-tests-app/app/css/measure-tests-page.xml new file mode 100644 index 000000000..d213f4003 --- /dev/null +++ b/e2e/ui-tests-app/app/css/measure-tests-page.xml @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/css/test-page.css b/e2e/ui-tests-app/app/css/test-page.css new file mode 100644 index 000000000..fc4faec03 --- /dev/null +++ b/e2e/ui-tests-app/app/css/test-page.css @@ -0,0 +1,3 @@ +TabView{ + font-size:10; +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/css/text-decoration-page.ts b/e2e/ui-tests-app/app/css/text-decoration-page.ts new file mode 100644 index 000000000..5e6ce22d7 --- /dev/null +++ b/e2e/ui-tests-app/app/css/text-decoration-page.ts @@ -0,0 +1,31 @@ +import { EventData, TextBase, TextDecoration } from "tns-core-modules/ui/text-base"; + +const possibleValues = [ + "none", + "underline", + "line-through", + "underline line-through" +]; + +export function butonTap(args: EventData) { + let page = (args.object).page; + let lbl = page.getViewById("Label"); + let btn = page.getViewById("Button"); + let textField = page.getViewById("TextField"); + let textView = page.getViewById("TextView"); + + let currentIndex = possibleValues.indexOf(lbl.textDecoration); + let newIndex = (currentIndex + 1) % possibleValues.length; + let newValue = possibleValues[newIndex]; + + lbl.textDecoration = newValue; + btn.textDecoration = newValue; + textField.textDecoration = newValue; + textView.textDecoration = newValue; + + if (lbl.text === "Change text") { + lbl.text = btn.text = textField.text = textView.text = "Text changed"; + } else { + lbl.text = btn.text = textField.text = textView.text = "Change text"; + } +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/css/text-decoration-page.xml b/e2e/ui-tests-app/app/css/text-decoration-page.xml new file mode 100644 index 000000000..a938cfc8a --- /dev/null +++ b/e2e/ui-tests-app/app/css/text-decoration-page.xml @@ -0,0 +1,9 @@ + + + + + + + + + + diff --git a/e2e/ui-tests-app/app/fonts-tests/fonts-weight/courier-new-page.xml b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/courier-new-page.xml new file mode 100644 index 000000000..2dc656de1 --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/courier-new-page.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/e2e/ui-tests-app/app/fonts-tests/fonts-weight/custom-fontawesome-page.xml b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/custom-fontawesome-page.xml new file mode 100644 index 000000000..d50bd6af4 --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/custom-fontawesome-page.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/e2e/ui-tests-app/app/fonts-tests/fonts-weight/custom-muli-page.xml b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/custom-muli-page.xml new file mode 100644 index 000000000..12ee174fb --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/custom-muli-page.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/e2e/ui-tests-app/app/fonts-tests/fonts-weight/custom-sofia-page.xml b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/custom-sofia-page.xml new file mode 100644 index 000000000..2dab7d3dd --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/custom-sofia-page.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/e2e/ui-tests-app/app/fonts-tests/fonts-weight/font-fallback-page.xml b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/font-fallback-page.xml new file mode 100644 index 000000000..bc22a7c41 --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/font-fallback-page.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/e2e/ui-tests-app/app/fonts-tests/fonts-weight/helvetica-page.xml b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/helvetica-page.xml new file mode 100644 index 000000000..1e697e8e5 --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/helvetica-page.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/e2e/ui-tests-app/app/fonts-tests/fonts-weight/main-page.ts b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/main-page.ts new file mode 100644 index 000000000..6ae3b43ce --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/main-page.ts @@ -0,0 +1,26 @@ +import { EventData } from "tns-core-modules/data/observable"; +import { SubMainPageViewModel } from "../../sub-main-page-view-model"; +import { WrapLayout } from "tns-core-modules/ui/layouts/wrap-layout"; +import { Page } from "tns-core-modules/ui/page"; + +export function loadExamples() { + const examples = new Map(); + examples.set("system", "fonts-tests/fonts-weight/system-page"); + examples.set("sans-serif", "fonts-tests/fonts-weight/sans-serif-page"); + examples.set("serif", "fonts-tests/fonts-weight/serif-page"); + examples.set("monospace", "fonts-tests/fonts-weight/monospace-page"); + examples.set("courier-new", "fonts-tests/fonts-weight/courier-new-page"); + examples.set("helvetica", "fonts-tests/fonts-weight/helvetica-page"); + examples.set("custom-fontawesome", "fonts-tests/fonts-weight/custom-fontawesome-page"); + examples.set("custom-muli", "fonts-tests/fonts-weight/custom-muli-page"); + examples.set("custom-sofia", "fonts-tests/fonts-weight/custom-sofia-page"); + examples.set("font-fallback", "fonts-tests/fonts-weight/font-fallback-page"); + + return examples; +} + +export function pageLoaded(args: EventData) { + const page = args.object; + const wrapLayout = page.getViewById("wrapLayoutWithExamples"); + page.bindingContext = new SubMainPageViewModel(wrapLayout, loadExamples()); +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/fonts-tests/fonts-weight/main-page.xml b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/main-page.xml new file mode 100644 index 000000000..33306f0d0 --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/main-page.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/fonts-tests/fonts-weight/monospace-page.xml b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/monospace-page.xml new file mode 100644 index 000000000..212447dfd --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/monospace-page.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/e2e/ui-tests-app/app/fonts-tests/fonts-weight/no-family-page.xml b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/no-family-page.xml new file mode 100644 index 000000000..141bed1a3 --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/no-family-page.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/e2e/ui-tests-app/app/fonts-tests/fonts-weight/sans-serif-page.xml b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/sans-serif-page.xml new file mode 100644 index 000000000..5117a4111 --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/sans-serif-page.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/e2e/ui-tests-app/app/fonts-tests/fonts-weight/serif-page.xml b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/serif-page.xml new file mode 100644 index 000000000..2fffd1107 --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/serif-page.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/e2e/ui-tests-app/app/fonts-tests/fonts-weight/system-page.xml b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/system-page.xml new file mode 100644 index 000000000..7f5989ca3 --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/fonts-weight/system-page.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/e2e/ui-tests-app/app/fonts-tests/label-page.ts b/e2e/ui-tests-app/app/fonts-tests/label-page.ts new file mode 100644 index 000000000..d429f46e6 --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/label-page.ts @@ -0,0 +1,15 @@ +import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout"; +import { View, unsetValue, eachDescendant } from "tns-core-modules/ui/core/view"; + +export function resetStyles(args) { + var stackLayout = args.object.parent; + eachDescendant(stackLayout, function (v: View) { + v.style.fontFamily = unsetValue; + v.style.fontSize = unsetValue; + v.style.fontStyle = unsetValue; + v.style.fontWeight = unsetValue; + v.style.color = unsetValue; + v.style.textAlignment = unsetValue; + return true; + }); +} diff --git a/e2e/ui-tests-app/app/fonts-tests/label-page.xml b/e2e/ui-tests-app/app/fonts-tests/label-page.xml new file mode 100644 index 000000000..cf3e9f809 --- /dev/null +++ b/e2e/ui-tests-app/app/fonts-tests/label-page.xml @@ -0,0 +1,25 @@ + + + + + diff --git a/e2e/ui-tests-app/app/issues/issue-3714-page.ts b/e2e/ui-tests-app/app/issues/issue-3714-page.ts new file mode 100644 index 000000000..c7478a190 --- /dev/null +++ b/e2e/ui-tests-app/app/issues/issue-3714-page.ts @@ -0,0 +1,25 @@ +import { EventData } from "tns-core-modules/data/observable"; +import { Page } from "tns-core-modules/ui/page"; +import { Button } from "tns-core-modules/ui/button"; +import { Label } from "tns-core-modules/ui/label"; +import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout"; +import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout"; + +export function toggle(args: EventData) { + const page = ((args.object).page); + + const getElementById = id => page.getViewById(id) + + const toggleBtn = + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/issues/sub-1657-page.xml b/e2e/ui-tests-app/app/issues/sub-1657-page.xml new file mode 100644 index 000000000..aa2aa8d79 --- /dev/null +++ b/e2e/ui-tests-app/app/issues/sub-1657-page.xml @@ -0,0 +1,5 @@ + + + + diff --git a/e2e/ui-tests-app/app/issues/tabview-with-scrollview_4022-page.xml b/e2e/ui-tests-app/app/issues/tabview-with-scrollview_4022-page.xml new file mode 100644 index 000000000..f36f0f6fd --- /dev/null +++ b/e2e/ui-tests-app/app/issues/tabview-with-scrollview_4022-page.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/e2e/ui-tests-app/app/layouts-percent/absolute-page.ts b/e2e/ui-tests-app/app/layouts-percent/absolute-page.ts new file mode 100644 index 000000000..41794a3fa --- /dev/null +++ b/e2e/ui-tests-app/app/layouts-percent/absolute-page.ts @@ -0,0 +1,22 @@ +import * as pageModule from "tns-core-modules/ui/page"; +import * as absoluteLayout from "tns-core-modules/ui/layouts/absolute-layout"; +import * as model from "./myview"; + +var count = 0; + +export function onLoaded(args: { eventName: string, object: any }) { + var page = args.object; + page.bindingContext = new model.ViewModelWithPercentage(); +} + +export function onSetLeftSetTop(args: { eventName: string, object: any }) { + var layout = args.object.parent; + var child = layout.getViewById("setLeftSetTop"); + if (++count % 2 === 1) { + absoluteLayout.AbsoluteLayout.setLeft(child, 175); + absoluteLayout.AbsoluteLayout.setTop(child, 375); + } else { + absoluteLayout.AbsoluteLayout.setLeft(child, 0); + absoluteLayout.AbsoluteLayout.setTop(child, 400); + } +} diff --git a/e2e/ui-tests-app/app/layouts-percent/absolute-page.xml b/e2e/ui-tests-app/app/layouts-percent/absolute-page.xml new file mode 100644 index 000000000..dfeb55e29 --- /dev/null +++ b/e2e/ui-tests-app/app/layouts-percent/absolute-page.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/scroll-view/layout-outside-scroll-view-model.ts b/e2e/ui-tests-app/app/scroll-view/layout-outside-scroll-view-model.ts new file mode 100644 index 000000000..5bd171325 --- /dev/null +++ b/e2e/ui-tests-app/app/scroll-view/layout-outside-scroll-view-model.ts @@ -0,0 +1,29 @@ +import { Observable } from "tns-core-modules/data/observable"; +import { ScrollView } from "tns-core-modules/ui/scroll-view"; + +export class LayoutOutsideScrollViewModel extends Observable { + content: string = "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium," + + "totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. " + + "Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos " + + "qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, " + + "adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. " + + "Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? " + + "Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, " + + "vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?"; + isVisible: boolean = true; + + onChangeVisibility() { + this.isVisible = !this.isVisible; + this.notifyPropertyChange("isVisible", this.isVisible); + } + + onScrollToBottom(args) { + const scrollView = args.object.page.getViewById("scroll-view"); + scrollView.scrollToVerticalOffset(scrollView.scrollableHeight, false); + } + + onScrollToTop(args) { + const scrollView = args.object.page.getViewById("scroll-view"); + scrollView.scrollToVerticalOffset(0, false); + } +} diff --git a/apps/app/ui-tests-app/scroll-view/main-page.ts b/e2e/ui-tests-app/app/scroll-view/main-page.ts similarity index 88% rename from apps/app/ui-tests-app/scroll-view/main-page.ts rename to e2e/ui-tests-app/app/scroll-view/main-page.ts index a2b6a5dd8..05aae0749 100644 --- a/apps/app/ui-tests-app/scroll-view/main-page.ts +++ b/e2e/ui-tests-app/app/scroll-view/main-page.ts @@ -11,11 +11,11 @@ export function pageLoaded(args: EventData) { export function loadExamples() { const examples = new Map(); - examples.set("scrolling-and-sizing", "scroll-view/scrolling-and-sizing"); - examples.set("safe-area-root-element", "scroll-view/safe-area-root-element"); - examples.set("safe-area-sub-element", "scroll-view/safe-area-sub-element"); - examples.set("safe-area-images", "scroll-view/safe-area-images"); - examples.set("safe-area-images-overflow", "scroll-view/safe-area-images-overflow"); - examples.set("layout-outside-scroll", "scroll-view/layout-outside-scroll"); + examples.set("scrolling-and-sizing", "scroll-view/scrolling-and-sizing-page"); + examples.set("safe-area-root-element", "scroll-view/safe-area-root-element-page"); + examples.set("safe-area-sub-element", "scroll-view/safe-area-sub-element-page"); + examples.set("safe-area-images", "scroll-view/safe-area-images-page"); + examples.set("safe-area-images-overflow", "scroll-view/safe-area-images-overflow-page"); + examples.set("layout-outside-scroll", "scroll-view/layout-outside-scroll-page"); return examples; -} \ No newline at end of file +} diff --git a/e2e/ui-tests-app/app/scroll-view/main-page.xml b/e2e/ui-tests-app/app/scroll-view/main-page.xml new file mode 100644 index 000000000..33306f0d0 --- /dev/null +++ b/e2e/ui-tests-app/app/scroll-view/main-page.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/scroll-view/safe-area-images-overflow-page.xml b/e2e/ui-tests-app/app/scroll-view/safe-area-images-overflow-page.xml new file mode 100644 index 000000000..d775a88cf --- /dev/null +++ b/e2e/ui-tests-app/app/scroll-view/safe-area-images-overflow-page.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/scroll-view/safe-area-images-page.xml b/e2e/ui-tests-app/app/scroll-view/safe-area-images-page.xml new file mode 100644 index 000000000..4c8000fcd --- /dev/null +++ b/e2e/ui-tests-app/app/scroll-view/safe-area-images-page.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/scroll-view/safe-area-root-element-page.xml b/e2e/ui-tests-app/app/scroll-view/safe-area-root-element-page.xml new file mode 100644 index 000000000..668c51055 --- /dev/null +++ b/e2e/ui-tests-app/app/scroll-view/safe-area-root-element-page.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/scroll-view/safe-area-sub-element-page.xml b/e2e/ui-tests-app/app/scroll-view/safe-area-sub-element-page.xml new file mode 100644 index 000000000..3d4b43732 --- /dev/null +++ b/e2e/ui-tests-app/app/scroll-view/safe-area-sub-element-page.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/scroll-view/scrolling-and-sizing-page.css b/e2e/ui-tests-app/app/scroll-view/scrolling-and-sizing-page.css new file mode 100644 index 000000000..fa1a2c8f0 --- /dev/null +++ b/e2e/ui-tests-app/app/scroll-view/scrolling-and-sizing-page.css @@ -0,0 +1,47 @@ +.p-10 { + padding: 10 20 10 20; +} + +.m-b-10 { + margin-bottom: 10; +} + +.page { + background-color: #F2F2F2; +} + +ScrollView { + background-color: #FFF; +} + +.bordered { + border-width: 5; + border-color: green; +} + +.fixed-height { + height: 55; +} + +.border-radius { + border-radius: 15; +} + +.border-radius-nonuniform { + border-radius: 10 20 30 40; +} + +.bordered-nonuniform { + border-top-color: red; + border-right-color: green; + border-bottom-color: blue; + border-left-color: purple; + border-top-width: 5; + border-right-width: 10; + border-bottom-width: 15; + border-left-width: 20; +} + +.body { + font-size: 11; +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/scroll-view/scrolling-and-sizing-page.xml b/e2e/ui-tests-app/app/scroll-view/scrolling-and-sizing-page.xml new file mode 100644 index 000000000..da25a263c --- /dev/null +++ b/e2e/ui-tests-app/app/scroll-view/scrolling-and-sizing-page.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/search-bar/issue-4147-page.css b/e2e/ui-tests-app/app/search-bar/issue-4147-page.css new file mode 100644 index 000000000..ed88b8b80 --- /dev/null +++ b/e2e/ui-tests-app/app/search-bar/issue-4147-page.css @@ -0,0 +1,13 @@ +#bg-color{ + background-color: red; +} + +.color{ + color: blue; +} + +#border{ + border-color: yellow; + border-width: 5; + border-style: solid; +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/search-bar/issue-4147-page.ts b/e2e/ui-tests-app/app/search-bar/issue-4147-page.ts new file mode 100644 index 000000000..be5820759 --- /dev/null +++ b/e2e/ui-tests-app/app/search-bar/issue-4147-page.ts @@ -0,0 +1,5 @@ +import * as frame from "tns-core-modules/ui/frame"; + +export function onNavBtnTap(args) { + frame.topmost().goBack(); +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/search-bar/issue-4147-page.xml b/e2e/ui-tests-app/app/search-bar/issue-4147-page.xml new file mode 100644 index 000000000..bb3a743d9 --- /dev/null +++ b/e2e/ui-tests-app/app/search-bar/issue-4147-page.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/e2e/ui-tests-app/app/search-bar/issue-5039-page.ts b/e2e/ui-tests-app/app/search-bar/issue-5039-page.ts new file mode 100644 index 000000000..10942d892 --- /dev/null +++ b/e2e/ui-tests-app/app/search-bar/issue-5039-page.ts @@ -0,0 +1,9 @@ +import { Issue5039ViewModel } from "./issue-5039-view-model" +import { SearchBar } from "tns-core-modules/ui/search-bar"; +import { Page } from "tns-core-modules/ui/page"; + +export function navigatingTo(args) { + const page = args.object; + const searchBar = page.getViewById("searchBar") + page.bindingContext = new Issue5039ViewModel(searchBar); +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/search-bar/issue-5039-page.xml b/e2e/ui-tests-app/app/search-bar/issue-5039-page.xml new file mode 100644 index 000000000..aaee382c9 --- /dev/null +++ b/e2e/ui-tests-app/app/search-bar/issue-5039-page.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/search-bar/issue-5039-view-model.ts b/e2e/ui-tests-app/app/search-bar/issue-5039-view-model.ts new file mode 100644 index 000000000..0fb8a68bf --- /dev/null +++ b/e2e/ui-tests-app/app/search-bar/issue-5039-view-model.ts @@ -0,0 +1,27 @@ +import { Observable } from "tns-core-modules/data/observable" +import { ObservableArray } from "tns-core-modules/data/observable-array" +import { SearchBar } from "tns-core-modules/ui/search-bar"; + +export class Issue5039ViewModel extends Observable { + + private _items = ["apple", "apple cider", "apple pie", "orange", "orange juice", "strawberry", "blueberry"] + public items = new ObservableArray() + + constructor(private _searchBar: SearchBar) { + super() + this.items.push(this._items) + } + + onSubmit() { + this.filter(this._searchBar.text); + } + + clearSearch() { + this.filter(); + } + + filter(value: string = "") { + this.items.splice(0, this.items.length) // remove all items + this.items.push(this._items.filter(i => -1 !== i.indexOf(value))) + } +} \ No newline at end of file diff --git a/e2e/ui-tests-app/app/search-bar/issue-5655-page.xml b/e2e/ui-tests-app/app/search-bar/issue-5655-page.xml new file mode 100644 index 000000000..fab139506 --- /dev/null +++ b/e2e/ui-tests-app/app/search-bar/issue-5655-page.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/search-bar/main-page.ts b/e2e/ui-tests-app/app/search-bar/main-page.ts new file mode 100644 index 000000000..74063b0cc --- /dev/null +++ b/e2e/ui-tests-app/app/search-bar/main-page.ts @@ -0,0 +1,20 @@ +import { EventData } from "tns-core-modules/data/observable"; +import { SubMainPageViewModel } from "../sub-main-page-view-model"; +import { WrapLayout } from "tns-core-modules/ui/layouts/wrap-layout"; +import { Page } from "tns-core-modules/ui/page"; + +export function pageLoaded(args: EventData) { + const page = args.object; + const wrapLayout = page.getViewById("wrapLayoutWithExamples"); + page.bindingContext = new SubMainPageViewModel(wrapLayout, loadExamples()); +} + +export function loadExamples() { + const examples = new Map(); + examples.set("issue-4147", "search-bar/issue-4147-page"); + examples.set("search-bar", "search-bar/search-bar-page"); + examples.set("issue-5039", "search-bar/issue-5039-page"); + examples.set("issue-5655", "search-bar/issue-5655-page"); + + return examples; +} diff --git a/e2e/ui-tests-app/app/search-bar/main-page.xml b/e2e/ui-tests-app/app/search-bar/main-page.xml new file mode 100644 index 000000000..33306f0d0 --- /dev/null +++ b/e2e/ui-tests-app/app/search-bar/main-page.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/search-bar/search-bar-page.xml b/e2e/ui-tests-app/app/search-bar/search-bar-page.xml new file mode 100644 index 000000000..41442dbad --- /dev/null +++ b/e2e/ui-tests-app/app/search-bar/search-bar-page.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/e2e/ui-tests-app/app/segmented-bar/all-page.ts b/e2e/ui-tests-app/app/segmented-bar/all-page.ts new file mode 100644 index 000000000..4d0a670a1 --- /dev/null +++ b/e2e/ui-tests-app/app/segmented-bar/all-page.ts @@ -0,0 +1,5 @@ +import * as frame from "tns-core-modules/ui/frame"; + +export function navigate() { + frame.topmost().navigate("segmented-bar/clean-page"); +} diff --git a/e2e/ui-tests-app/app/segmented-bar/all-page.xml b/e2e/ui-tests-app/app/segmented-bar/all-page.xml new file mode 100644 index 000000000..6b08fdc0e --- /dev/null +++ b/e2e/ui-tests-app/app/segmented-bar/all-page.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/tests/app/color/color-tests.ts b/tests/app/color/color-tests.ts index 02a020ebb..4b74a8cee 100644 --- a/tests/app/color/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 "../tk-unit"; export var test_Hex_Color = function () { // >> color-hex diff --git a/tests/app/data/observable-array-tests.ts b/tests/app/data/observable-array-tests.ts index 474cb4af5..11c8b31ac 100644 --- a/tests/app/data/observable-array-tests.ts +++ b/tests/app/data/observable-array-tests.ts @@ -1,4 +1,4 @@ -import * as TKUnit from "../TKUnit"; +import * as TKUnit from "../tk-unit"; import { Label } from "tns-core-modules/ui/label"; // >> observable-array-require import { ObservableArray, ChangedData, ChangeType } from "tns-core-modules/data/observable-array"; diff --git a/tests/app/data/observable-tests.ts b/tests/app/data/observable-tests.ts index 6e647b5de..6fb6dfbfd 100644 --- a/tests/app/data/observable-tests.ts +++ b/tests/app/data/observable-tests.ts @@ -2,7 +2,7 @@ import { Observable, fromObject, fromObjectRecursive, PropertyChangeData, EventData, WrappedValue } from "tns-core-modules/data/observable"; // << observable-require -import * as TKUnit from "../TKUnit"; +import * as TKUnit from "../tk-unit"; import * as types from "tns-core-modules/utils/types"; import { ObservableArray } from "tns-core-modules/data/observable-array"; diff --git a/tests/app/data/virtual-array-tests.ts b/tests/app/data/virtual-array-tests.ts index 54c7df9eb..493da9706 100644 --- a/tests/app/data/virtual-array-tests.ts +++ b/tests/app/data/virtual-array-tests.ts @@ -1,4 +1,4 @@ -import * as TKUnit from "../TKUnit"; +import * as TKUnit from "../tk-unit"; import * as types from "tns-core-modules/utils/types"; import * as virtualArrayModule from "tns-core-modules/data/virtual-array"; diff --git a/tests/app/debugger/dom-node-tests.ts b/tests/app/debugger/dom-node-tests.ts index ae7c2c249..02ebfbe06 100644 --- a/tests/app/debugger/dom-node-tests.ts +++ b/tests/app/debugger/dom-node-tests.ts @@ -1,4 +1,4 @@ -import { assert, assertEqual } from "../TKUnit"; +import { assert, assertEqual } from "../tk-unit"; import { DOMNode } from "tns-core-modules/debugger/dom-node"; import { attachDOMInspectorCommandCallbacks, attachCSSInspectorCommandCallbacks, attachDOMInspectorEventCallbacks } from "tns-core-modules/debugger/devtools-elements"; import { InspectorCommands, InspectorEvents } from "tns-core-modules/debugger/devtools-elements"; diff --git a/tests/app/fetch/fetch-tests.ts b/tests/app/fetch/fetch-tests.ts index 835f405d9..cada33241 100644 --- a/tests/app/fetch/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 "../tk-unit"; import * as types from "tns-core-modules/utils/types"; export var test_fetch_defined = function () { diff --git a/tests/app/file-name-resolver-tests/file-name-resolver-tests.ts b/tests/app/file-name-resolver-tests/file-name-resolver-tests.ts index ce1a43199..34a53b046 100644 --- a/tests/app/file-name-resolver-tests/file-name-resolver-tests.ts +++ b/tests/app/file-name-resolver-tests/file-name-resolver-tests.ts @@ -1,4 +1,4 @@ -import * as TKUnit from "../TKUnit"; +import * as TKUnit from "../tk-unit"; import * as fs from "tns-core-modules/file-system"; import * as enums from "tns-core-modules/ui/enums"; import * as resolver from "tns-core-modules/file-system/file-name-resolver"; diff --git a/tests/app/file-system-access-tests/file-system-access-tests.ts b/tests/app/file-system-access-tests/file-system-access-tests.ts index c1ed3c8da..4dee3982d 100644 --- a/tests/app/file-system-access-tests/file-system-access-tests.ts +++ b/tests/app/file-system-access-tests/file-system-access-tests.ts @@ -1,9 +1,8 @@ -import * as TKUnit from "../TKUnit"; +import * as TKUnit from "../tk-unit"; import * as fs from "tns-core-modules/file-system"; export var test_UTF8_BOM_is_not_returned = function () { - var actualResult: string; - var path = fs.path.join(__dirname, "xml.expected"); + var path = fs.path.join(fs.knownFolders.currentApp().path, "file-system-access-tests", "xml.expected"); if (!fs.File.exists(path)) { TKUnit.assert(false, "Could not read file utf8.txt"); return; @@ -24,7 +23,7 @@ export var test_UTF8_BOM_is_not_returned = function () { }; export var test_file_exists_on_folder = function () { - var path = fs.path.join(__dirname, "folder"); + var path = fs.path.join(fs.knownFolders.currentApp().path, "file-system-access-tests", "folder"); if (!fs.Folder.exists(path)) { TKUnit.assert(false, `Could not read path ${path}`); diff --git a/tests/app/file-system/file-system-tests.ts b/tests/app/file-system/file-system-tests.ts index 60d2db33e..c9b33a568 100644 --- a/tests/app/file-system/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 "../tk-unit"; import * as appModule from "tns-core-modules/application"; import * as platform from "tns-core-modules/platform"; @@ -180,7 +180,7 @@ export var testFileReadWriteBinary = function () { var fileName = "logo.png"; var error; - var sourceFile = fs.File.fromPath(__dirname + "/../" + fileName); + var sourceFile = fs.File.fromPath(__dirname + "/assets/" + fileName); var destinationFile = fs.knownFolders.documents().getFile(fileName); var source = sourceFile.readSync(e => { error = e; }); diff --git a/tests/app/http/http-tests.ts b/tests/app/http/http-tests.ts index 1cd5283e9..f924edffc 100644 --- a/tests/app/http/http-tests.ts +++ b/tests/app/http/http-tests.ts @@ -1,5 +1,5 @@ import { ImageSource } from "tns-core-modules/image-source"; -import * as TKUnit from "../TKUnit"; +import * as TKUnit from "../tk-unit"; import * as http from "tns-core-modules/http"; import * as fs from "tns-core-modules/file-system"; import { addHeader } from "tns-core-modules/http/http-request"; diff --git a/tests/app/image-source/image-source-tests.ts b/tests/app/image-source/image-source-tests.ts index be4e630cc..63f9ba8d6 100644 --- a/tests/app/image-source/image-source-tests.ts +++ b/tests/app/image-source/image-source-tests.ts @@ -2,14 +2,14 @@ import * as imageAssetModule from "tns-core-modules/image-asset"; 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 "../tk-unit"; import * as platform from "tns-core-modules/platform"; -const imagePath = "~/logo.png"; -const splashscreenPath = "~/splashscreen.png"; +const imagePath = "~/assets/logo.png"; +const splashscreenPath = "~/assets/splashscreen.png"; const splashscreenWidth = 372; const splashscreenHeight = 218; -const smallImagePath = "~/small-image.png"; +const smallImagePath = "~/assets/small-image.png"; export function testFromResource() { // >> imagesource-resname diff --git a/tests/app/livesync/livesync-tests.ts b/tests/app/livesync/livesync-tests.ts index 87e3c67d6..04d54584c 100644 --- a/tests/app/livesync/livesync-tests.ts +++ b/tests/app/livesync/livesync-tests.ts @@ -1,18 +1,18 @@ -import * as helper from "../ui/helper"; -import * as TKUnit from "../TKUnit"; +import * as helper from "../ui-helper"; +import * as TKUnit from "../tk-unit"; import * as app from "tns-core-modules/application/application"; import * as frame from "tns-core-modules/ui/frame"; - +import * as fs from "tns-core-modules/file-system"; import { Color } from "tns-core-modules/color"; import { createViewFromEntry } from "tns-core-modules/ui/builder"; import { Page } from "tns-core-modules/ui/page"; import { Frame } from "tns-core-modules/ui/frame"; -const appCssFileName = "./app/application.css"; -const appNewCssFileName = "./app/app-new.css"; -const appNewScssFileName = "./app/app-new.scss"; -const buttonCssFileName = "./app/button-page.css"; +const appCssFileName = "/application-page.css"; +const appNewCssFileName = "app-new-page.css"; +const appNewScssFileName = "app-new-sass-page.css"; +const buttonCssFileName = "/button-page.css"; const buttonPageModuleName = "livesync/livesync-button-page"; const buttonHtmlPageFileName = "./livesync/livesync-button-page.html"; @@ -49,7 +49,7 @@ export function test_onLiveSync_ModuleContext_Script_TsFile() { } export function test_onLiveSync_ModuleContext_Style_CssFile() { - _test_onLiveSync_ModuleContext_TypeStyle({ type: "style", path: buttonCssFileName }); + _test_onLiveSync_ModuleContext_TypeStyle({ type: "style", path: fs.knownFolders.currentApp().path + buttonCssFileName }); } export function test_onLiveSync_ModuleContext_Markup_HtmlFile() { @@ -96,7 +96,7 @@ export function setUp() { } export function tearDown() { - app.setCssFileName(appCssFileName); + app.setCssFileName(fs.knownFolders.currentApp().path + appCssFileName); } function _test_onLiveSync_ModuleContext_AppStyle(styleFileName: string) { @@ -104,9 +104,9 @@ function _test_onLiveSync_ModuleContext_AppStyle(styleFileName: string) { const buttonPage = createViewFromEntry(({ moduleName: buttonPageModuleName })); helper.navigateWithHistory(() => buttonPage); - app.setCssFileName(styleFileName); + app.setCssFileName(fs.knownFolders.currentApp().path + "/" + styleFileName); const pageBeforeLiveSync = helper.getCurrentPage(); - global.__onLiveSync({ type: "style", path: styleFileName }); + global.__onLiveSync({ type: "style", path: fs.knownFolders.currentApp().path + "/" + styleFileName }); const pageAfterLiveSync = helper.getCurrentPage(); TKUnit.waitUntilReady(() => pageAfterLiveSync.getViewById("button").style.color.toString() === green.toString()); diff --git a/tests/app/app/mainPage.ts b/tests/app/main-page.ts similarity index 70% rename from tests/app/app/mainPage.ts rename to tests/app/main-page.ts index 2f3939b22..e48982712 100644 --- a/tests/app/app/mainPage.ts +++ b/tests/app/main-page.ts @@ -1,6 +1,7 @@ -import { Page } from "tns-core-modules/ui/page"; import * as trace from "tns-core-modules/trace"; -import * as tests from "../testRunner"; +import { Page } from "tns-core-modules/ui/page"; + +import * as tests from "./test-runner"; let executeTests = true; @@ -18,8 +19,6 @@ trace.addCategories(trace.categories.Test + "," + trace.categories.Error); // )); function runTests() { - // setTimeout(() => tests.runAll("BOTTOM-NAVIGATION-ROOT.test_android_default_offset_should_preload_1_tab_on_each_side"), 10); - // setTimeout(() => tests.runAll("BOTTOM-NAVIGATION-ROOT"), 10); setTimeout(() => tests.runAll(""), 10); } diff --git a/tests/app/main-page.xml b/tests/app/main-page.xml new file mode 100644 index 000000000..880573bd4 --- /dev/null +++ b/tests/app/main-page.xml @@ -0,0 +1,3 @@ + + diff --git a/tests/app/navigation/navigation-tests.ts b/tests/app/navigation/navigation-tests.ts index 42cc2327d..730fe6d67 100644 --- a/tests/app/navigation/navigation-tests.ts +++ b/tests/app/navigation/navigation-tests.ts @@ -1,10 +1,10 @@ -import * as TKUnit from "../TKUnit"; +import * as TKUnit from "../tk-unit"; import { EventData, Page, NavigatedData } from "tns-core-modules/ui/page"; import { topmost as topmostFrame, NavigationTransition } from "tns-core-modules/ui/frame"; import { StackLayout, } from "tns-core-modules/ui/layouts/stack-layout"; import { GridLayout, } from "tns-core-modules/ui/layouts/grid-layout"; import { Color } from "tns-core-modules/color"; -import * as helper from "../ui/helper"; +import * as helper from "../ui-helper"; import * as frame from "tns-core-modules/ui/frame"; // Creates a random colorful page full of meaningless stuff. let id = 0; diff --git a/tests/app/navigation/transition-tests.ts b/tests/app/navigation/transition-tests.ts index cdf9b0e37..690772cfd 100644 --- a/tests/app/navigation/transition-tests.ts +++ b/tests/app/navigation/transition-tests.ts @@ -1,5 +1,4 @@ -import * as TKUnit from "../TKUnit"; -import * as helper from "../ui/helper"; +import * as helper from "../ui-helper"; import * as platform from "tns-core-modules/platform"; import * as trace from "tns-core-modules/trace"; import { Color } from "tns-core-modules/color"; diff --git a/tests/app/package.json b/tests/app/package.json index 46c676fd0..24cb7bc4c 100644 --- a/tests/app/package.json +++ b/tests/app/package.json @@ -1,2 +1,6 @@ -{ "name" : "tns-samples-tests", - "main" : "app/app.js" } +{ + "main": "app.js", + "android": { + "v8Flags": "--expose_gc" + } +} diff --git a/tests/app/pages/page17.ts b/tests/app/pages/page17.ts index 0f8847ae3..5e483ae89 100644 --- a/tests/app/pages/page17.ts +++ b/tests/app/pages/page17.ts @@ -29,7 +29,7 @@ export function buttonTap(args: observable.EventData) { currentPage.actionBar.android.icon = "res://ic_test"; } else if (i % 3 === 1) { - currentPage.actionBar.android.icon = "~/test-icon.png"; + currentPage.actionBar.android.icon = "~/assets/test-icon.png"; } else if (i % 3 === 2) { currentPage.actionBar.android.icon = undefined; diff --git a/tests/app/platform/platform-tests.ts b/tests/app/platform/platform-tests.ts index b94c17708..7403fb81b 100644 --- a/tests/app/platform/platform-tests.ts +++ b/tests/app/platform/platform-tests.ts @@ -1,4 +1,4 @@ -import * as TKUnit from "../TKUnit"; +import * as TKUnit from "../tk-unit"; import * as app from "tns-core-modules/application"; import { isIOS, isAndroid } from "tns-core-modules/platform"; diff --git a/tests/app/profiling/profiling-tests.ts b/tests/app/profiling/profiling-tests.ts index e8bb9eb6f..1fb7a4373 100644 --- a/tests/app/profiling/profiling-tests.ts +++ b/tests/app/profiling/profiling-tests.ts @@ -1,4 +1,4 @@ -import { assert, assertEqual, assertFalse, assertNull, assertTrue, assertThrows } from "../TKUnit"; +import { assert, assertEqual, assertFalse, assertNull, assertTrue, assertThrows } from "../tk-unit"; import { enable, disable, profile, time, start, stop, timer, isRunning, resetProfiles } from "tns-core-modules/profiling"; enable(); diff --git a/tests/app/splashscreen.png b/tests/app/splashscreen.png deleted file mode 100644 index a157c4dda..000000000 Binary files a/tests/app/splashscreen.png and /dev/null differ diff --git a/tests/app/testRunner.ts b/tests/app/test-runner.ts similarity index 91% rename from tests/app/testRunner.ts rename to tests/app/test-runner.ts index 3697ae309..3e979c0e1 100644 --- a/tests/app/testRunner.ts +++ b/tests/app/test-runner.ts @@ -1,20 +1,21 @@ -/* tslint:disable */ -import * as TKUnit from "./TKUnit"; -import { _resetRootView } from "tns-core-modules/application"; -import { messageType } from "tns-core-modules/trace"; -import { topmost, Frame } from "tns-core-modules/ui/frame"; -import { Page } from "tns-core-modules/ui/page"; -import { TextView } from "tns-core-modules/ui/text-view"; -import { Button } from "tns-core-modules/ui/button"; -import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout"; -import * as platform from "tns-core-modules/platform"; -import "./ui-test"; -import { ios } from "tns-core-modules/utils/utils"; +/* tslint:disable */ +import * as TKUnit from './tk-unit'; +import './ui-test'; + +import { _resetRootView } from 'tns-core-modules/application'; +import * as platform from 'tns-core-modules/platform'; +import { messageType } from 'tns-core-modules/trace'; +import { Button } from 'tns-core-modules/ui/button'; +import { Frame, topmost } from 'tns-core-modules/ui/frame'; +import { StackLayout } from 'tns-core-modules/ui/layouts/stack-layout'; +import { Page } from 'tns-core-modules/ui/page'; +import { TextView } from 'tns-core-modules/ui/text-view'; +import { ios } from 'tns-core-modules/utils/utils'; Frame.defaultAnimatedNavigation = false; export function isRunningOnEmulator(): boolean { - // This checks are not good enough to be added to modules but keeps unittests green. + // These checks are not good enough to be added to modules but they keep unit tests green. if (platform.device.os === platform.platformNames.android) { return android.os.Build.FINGERPRINT.indexOf("generic") > -1 || @@ -24,7 +25,6 @@ export function isRunningOnEmulator(): boolean { android.os.Build.PRODUCT.toLocaleLowerCase().indexOf("emulator") > -1; // VS Emulator } else if (platform.device.os === platform.platformNames.ios) { - //return platform.device.model === "iPhone Simulator"; return (__dirname.search("Simulator") > -1); } } @@ -79,8 +79,8 @@ 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 bindingExpressionTests from "./ui/core/bindable/binding-expressions-tests"; +allTests["BINDING-EXPRESSIONS"] = bindingExpressionTests; import * as xmlParserTests from "./xml-parser-tests/xml-parser-tests"; allTests["XML-PARSER"] = xmlParserTests; @@ -112,6 +112,10 @@ allTests["SCROLL-VIEW"] = scrollViewTests; import * as actionBarTests from "./ui/action-bar/action-bar-tests"; allTests["ACTION-BAR"] = actionBarTests; +//TODO: 13 tests commented out. Reasons: +// 1. Loading module without XML and bundle is not supported at this moment +// 2. Using CODEFILE/IMPORT/CSSFILE with bundle is not supported at this moment +// 3. Attempted to assign to readonly property import * as xmlDeclarationTests from "./xml-declaration/xml-declaration-tests"; allTests["XML-DECLARATION"] = xmlDeclarationTests; @@ -216,6 +220,8 @@ allTests["PROGRESS"] = progressTests; import * as placeholderTests from "./ui/placeholder/placeholder-tests"; allTests["PLACEHOLDER"] = placeholderTests; +//TODO: 1 test commented out in page-tests-common. Reason: +// 1. CSS is not applied when creating Label from code import * as pageTests from "./ui/page/page-tests"; allTests["PAGE"] = pageTests; @@ -270,8 +276,9 @@ allTests["SEARCH-BAR"] = searchBarTests; import * as navigationTests from "./navigation/navigation-tests"; allTests["NAVIGATION"] = navigationTests; -import * as livesyncTests from "./livesync/livesync-tests"; -allTests["LIVESYNC"] = livesyncTests; +// TODO: These test should be run with --no-hrm +// import * as livesyncTests from "./livesync/livesync-tests"; +// allTests["LIVESYNC"] = livesyncTests; import * as tabViewRootTests from "./ui/tab-view/tab-view-root-tests"; allTests["TAB-VIEW-ROOT"] = tabViewRootTests; @@ -286,6 +293,8 @@ allTests["BOTTOM-NAVIGATION-ROOT"] = bottomNavigationRootTests; import * as resetRootViewTests from "./ui/root-view/reset-root-view-tests"; allTests["RESET-ROOT-VIEW"] = resetRootViewTests; +//TODO: 2 test commented out. Reason: +// 1.Loading module without XML and bundle is not supported at this moment import * as rootViewTests from "./ui/root-view/root-view-tests"; allTests["ROOT-VIEW"] = rootViewTests; @@ -300,7 +309,7 @@ const testsWithLongDelay = { testLocation: 10000, testLocationOnce: 10000, testLocationOnceMaximumAge: 10000, - //web-view-tests + // web-view-tests testLoadExistingUrl: 10000 * 5, testLoadLocalFile: 10000 * 5, testLoadInvalidUrl: 10000, @@ -316,8 +325,6 @@ let running = false; let testsQueue = new Array(); function printRunTestStats() { - const testCases = new Array(); - let failedTestCount = 0; const failedTestInfo = []; const slowTests = new Array(); @@ -328,12 +335,12 @@ function printRunTestStats() { let testName = testCase.testName; if (!testCase.isPassed) { failedTestCount++; - failedTestInfo.push(testCase.testName + " FAILED: " + testCase.errorMessage); + failedTestInfo.push(testName + " FAILED: " + testCase.errorMessage); } let duration = (testCase.duration / 1000).toFixed(2); if (testCase.duration > 500) { - slowTests.push(`${testCase.testName}: ${duration}s`); + slowTests.push(`${testName}: ${duration}s`); } }); @@ -464,8 +471,6 @@ export function runAll(testSelector?: string) { console.log("TESTS: " + singleModuleName ? singleModuleName : "" + " " + singleTestName ? singleTestName : ""); - const totalSuccess = 0; - const totalFailed: Array = []; testsQueue.push(new TestInfo(() => { running = true; startTime = TKUnit.time(); })); for (const name in allTests) { if (singleModuleName && (singleModuleName !== name.toLowerCase())) { diff --git a/tests/app/text/formatted-string-tests.ts b/tests/app/text/formatted-string-tests.ts index d137fc54d..d4897b102 100644 --- a/tests/app/text/formatted-string-tests.ts +++ b/tests/app/text/formatted-string-tests.ts @@ -5,7 +5,7 @@ import { Span } from "tns-core-modules/text/span"; import { Observable } from "tns-core-modules/data/observable"; import { Label } from "tns-core-modules/ui/label"; -import * as TKUnit from "../TKUnit"; +import * as TKUnit from "../tk-unit"; export function test_FormattedString_RemovesEventListeners_for_spans() { // >> formatted-string-set diff --git a/tests/app/timer/timer-tests.ts b/tests/app/timer/timer-tests.ts index c6c13b1b3..bba1a6f3e 100644 --- a/tests/app/timer/timer-tests.ts +++ b/tests/app/timer/timer-tests.ts @@ -1,4 +1,4 @@ -import * as TKUnit from "../TKUnit"; +import * as TKUnit from "../tk-unit"; import * as timer from "tns-core-modules/timer"; // >> timer-require diff --git a/tests/app/TKUnit.ts b/tests/app/tk-unit.ts similarity index 97% rename from tests/app/TKUnit.ts rename to tests/app/tk-unit.ts index f5fda0c8f..9f81fdaf8 100644 --- a/tests/app/TKUnit.ts +++ b/tests/app/tk-unit.ts @@ -1,4 +1,5 @@ -/* tslint:disable */ +/* tslint:disable */ + /* Notes: 1. all test function names should begin with 'test' @@ -10,11 +11,11 @@ */ -import * as Application from "tns-core-modules/application"; +import * as application from "tns-core-modules/application"; +import * as platform from "tns-core-modules/platform"; import * as timer from "tns-core-modules/timer"; import * as trace from "tns-core-modules/trace"; import * as types from "tns-core-modules/utils/types"; -import * as platform from "tns-core-modules/platform"; const sdkVersion = parseInt(platform.device.sdkVersion); @@ -34,14 +35,12 @@ export interface TestInfoEntry { export function time(): number { if (global.android) { return java.lang.System.nanoTime() / 1000000; // 1 ms = 1000000 ns - } - else { + } else { return CACurrentMediaTime() * 1000; } } export function write(message: string, type?: number) { - //console.log(message); trace.write(message, trace.categories.Test, type); } @@ -51,8 +50,7 @@ function runTest(testInfo: TestInfoEntry) { try { if (testInfo.instance) { testInfo.testFunc.apply(testInfo.instance); - } - else { + } else { testInfo.testFunc(); } @@ -116,7 +114,7 @@ function runAsync(testInfo: TestInfoEntry, recursiveIndex: number, testTimeout?: runTests(testsQueue, recursiveIndex + 1); } else if (error) { write(`--- [${testInfo.testName}] FAILED: ${error.message}, duration: ${duration.toFixed(2)}`, trace.messageType.error); - testInfo.errorMessage = error.message; + testInfo.errorMessage = error.message; runTests(testsQueue, recursiveIndex + 1); } else { const testEndTime = time(); @@ -208,7 +206,7 @@ export function assertEqual(actual } } else if (actual !== expected) { - throw new Error(`${message} Actual: <${actual}>(${typeof (actual)}). Expected: <${expected}>(${typeof (expected)})` ); + throw new Error(`${message} Actual: <${actual}>(${typeof (actual)}). Expected: <${expected}>(${typeof (expected)})`); } } @@ -363,7 +361,7 @@ export function waitUntilReady(isReady: () => boolean, timeoutSec: number = 3, s return; } - if (Application.ios) { + if (application.ios) { const timeoutMs = timeoutSec * 1000; let totalWaitTime = 0; while (true) { @@ -383,7 +381,7 @@ export function waitUntilReady(isReady: () => boolean, timeoutSec: number = 3, s } } } - } else if (Application.android) { + } else if (application.android) { doModalAndroid(isReady, timeoutSec, shouldThrow); } } diff --git a/tests/app/trace/trace-error-tests.ts b/tests/app/trace/trace-error-tests.ts index bdf787eb5..0f36d515d 100644 --- a/tests/app/trace/trace-error-tests.ts +++ b/tests/app/trace/trace-error-tests.ts @@ -2,7 +2,7 @@ ErrorHandler, getErrorHandler, setErrorHandler, DefaultErrorHandler, error as traceError } from "tns-core-modules/trace"; -import * as TKUnit from "../TKUnit"; +import * as TKUnit from "../tk-unit"; let cachedErrorHandler: ErrorHandler; export function setUpModule() { diff --git a/tests/app/ui/helper.ts b/tests/app/ui-helper.ts similarity index 96% rename from tests/app/ui/helper.ts rename to tests/app/ui-helper.ts index 6ccd5b490..33309d284 100644 --- a/tests/app/ui/helper.ts +++ b/tests/app/ui-helper.ts @@ -1,38 +1,35 @@ -import * as frame from "tns-core-modules/ui/frame"; -import { ViewBase, View, unsetValue, isIOS } from "tns-core-modules/ui/core/view"; -import { Page } from "tns-core-modules/ui/page"; -import { TabView, TabViewItem } from "tns-core-modules/ui/tab-view"; -import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout"; -import { Button } from "tns-core-modules/ui/button"; -import * as TKUnit from "../TKUnit"; -import * as utils from "tns-core-modules/utils/utils"; -import { ActionBar } from "tns-core-modules/ui/action-bar"; import { Color } from "tns-core-modules/color"; - -import { LayoutBase } from "tns-core-modules/ui/layouts/layout-base"; import { FormattedString, Span } from "tns-core-modules/text/formatted-string"; -import { _getProperties, _getStyleProperties } from "tns-core-modules/ui/core/properties"; -import { device } from "tns-core-modules/platform"; +import { ActionBar } from "tns-core-modules/ui/action-bar"; // TODO: Remove this and get it from global to decouple builder for angular import { createViewFromEntry } from "tns-core-modules/ui/builder"; +import { Button } from "tns-core-modules/ui/button"; +import { isIOS, unsetValue, View, ViewBase } from "tns-core-modules/ui/core/view"; +import * as frame from "tns-core-modules/ui/frame"; +import { LayoutBase } from "tns-core-modules/ui/layouts/layout-base"; +import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout"; +import { Page } from "tns-core-modules/ui/page"; +import { TabView, TabViewItem } from "tns-core-modules/ui/tab-view"; +import * as utils from "tns-core-modules/utils/utils"; + +import * as TKUnit from "./tk-unit"; const DELTA = 0.1; -const sdkVersion = parseInt(device.sdkVersion); -export var ASYNC = 0.2; -export var MEMORY_ASYNC = 2; +export let ASYNC = 0.2; +export let MEMORY_ASYNC = 2; export function getColor(uiColor: UIColor): Color { - var redRef = new interop.Reference(); - var greenRef = new interop.Reference(); - var blueRef = new interop.Reference(); - var alphaRef = new interop.Reference(); + let redRef = new interop.Reference(); + let greenRef = new interop.Reference(); + let blueRef = new interop.Reference(); + let alphaRef = new interop.Reference(); uiColor.getRedGreenBlueAlpha(redRef, greenRef, blueRef, alphaRef); - var red = redRef.value * 255; - var green = greenRef.value * 255; - var blue = blueRef.value * 255; - var alpha = alphaRef.value * 255; + let red = redRef.value * 255; + let green = greenRef.value * 255; + let blue = blueRef.value * 255; + let alpha = alphaRef.value * 255; return new Color(alpha, red, green, blue); } @@ -86,7 +83,6 @@ export interface PageOptions { tabBar?: boolean } -//export function buildUIAndRunTest(controlToTest, testFunction, options) { export function buildUIAndRunTest(controlToTest: T, testFunction: (views: [T, Page]) => void, options?: PageOptions) { clearPage(); let newPage = getCurrentPage(); @@ -304,12 +300,6 @@ export function _generateFormattedString(): FormattedString { return formattedString; } -// const props = _getProperties(); -// const styleProps = _getStyleProperties(); -// let setters: Map; -// let cssSetters: Map; -// let defaultNativeGetters: Map any>; - export function nativeView_recycling_test(createNew: () => View, createLayout?: () => LayoutBase, nativeGetters?: Map any>, customSetters?: Map) { return; diff --git a/tests/app/ui-test.ts b/tests/app/ui-test.ts index b0108ebcb..16e032690 100644 --- a/tests/app/ui-test.ts +++ b/tests/app/ui-test.ts @@ -1,8 +1,9 @@ -import { Page } from "tns-core-modules/ui/page"; -import { View } from "tns-core-modules/ui/core/view"; import * as trace from "tns-core-modules/trace"; -import * as navHelper from "./ui/helper"; -import * as TKUnit from "./TKUnit"; +import { View } from "tns-core-modules/ui/core/view"; +import { Page } from "tns-core-modules/ui/page"; + +import * as TKUnit from "./tk-unit"; +import * as navHelper from "./ui-helper"; export class UITest implements trace.TraceWriter { @@ -73,4 +74,4 @@ export class UITest implements trace.TraceWriter { export function createTestCase(): UITest { return null; -} \ No newline at end of file +} 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 d7f2df017..c9b4070c1 100644 --- a/tests/app/ui/action-bar/action-bar-tests-common.ts +++ b/tests/app/ui/action-bar/action-bar-tests-common.ts @@ -1,5 +1,5 @@ -import * as TKUnit from "../../TKUnit"; -import * as helper from "../helper"; +import * as TKUnit from "../../tk-unit"; +import * as helper from "../../ui-helper"; import * as builder from "tns-core-modules/ui/builder"; import { Label } from "tns-core-modules/ui/label"; import { Button } from "tns-core-modules/ui/button"; diff --git a/tests/app/ui/action-bar/action-bar-tests.android.ts b/tests/app/ui/action-bar/action-bar-tests.android.ts index 1106182d0..6952b2f66 100644 --- a/tests/app/ui/action-bar/action-bar-tests.android.ts +++ b/tests/app/ui/action-bar/action-bar-tests.android.ts @@ -1,15 +1,15 @@ -import * as actionTestsCommon from "./action-bar-tests-common"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; +import { createPageAndNavigate } from "./action-bar-tests-common"; import { ActionItem } from "tns-core-modules/ui/action-bar"; import { Visibility } from "tns-core-modules/ui/enums"; import { Button } from "tns-core-modules/ui/button"; -global.moduleMerge(actionTestsCommon, exports); +export * from "./action-bar-tests-common"; export function test_actionItem_visibility() { const actionItem = new ActionItem(); actionItem.text = "Test"; - const page = actionTestsCommon.createPageAndNavigate(); + const page = createPageAndNavigate(); page.actionBar.actionItems.addItem(actionItem); const toolbar = page.actionBar.nativeViewProtected; const menu = toolbar.getMenu(); @@ -21,8 +21,8 @@ export function test_actionItem_visibility() { export function test_navigationButton_visibility() { const actionItem = new ActionItem(); - actionItem.icon = "~/small-image.png"; - const page = actionTestsCommon.createPageAndNavigate(); + actionItem.icon = "~/assets/small-image.png"; + const page = createPageAndNavigate(); page.actionBar.navigationButton = actionItem; const toolbar = page.actionBar.nativeViewProtected; @@ -34,10 +34,10 @@ export function test_navigationButton_visibility() { export function test_navigationButton_contentDecription() { const actionItem = new ActionItem(); - actionItem.icon = "~/small-image.png"; + actionItem.icon = "~/assets/small-image.png"; const actionItemText = "NavButton with small-image"; actionItem.text = actionItemText; - const page = actionTestsCommon.createPageAndNavigate(); + const page = createPageAndNavigate(); page.actionBar.navigationButton = actionItem; const toolbar = page.actionBar.nativeViewProtected; @@ -50,7 +50,7 @@ export function test_set_actionView_to_attached_actionItem_propagates_context() const actionButton = new Button(); actionItem.actionView = actionButton; - const page = actionTestsCommon.createPageAndNavigate(); + const page = createPageAndNavigate(); // sanity check TKUnit.assertNotNull(page.content._context, "Page content context should not be null"); @@ -69,7 +69,7 @@ export function test_set_actionView_to_attached_actionItem_propagates_context() export function test_add_actionItem_with_actionView_propagates_context() { const actionItem = new ActionItem(); - const page = actionTestsCommon.createPageAndNavigate(); + const page = createPageAndNavigate(); // sanity check TKUnit.assertNotNull(page.content._context, "Page content context should not be null"); diff --git a/tests/app/ui/action-bar/action-bar-tests.ios.ts b/tests/app/ui/action-bar/action-bar-tests.ios.ts index 64e7fea2f..792c176de 100644 --- a/tests/app/ui/action-bar/action-bar-tests.ios.ts +++ b/tests/app/ui/action-bar/action-bar-tests.ios.ts @@ -1,13 +1,13 @@ -import * as actionTestsCommon from "./action-bar-tests-common"; +import { createPageAndNavigate } from "./action-bar-tests-common"; import * as PageModule from "tns-core-modules/ui/page"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import * as LabelModule from "tns-core-modules/ui/label"; -import * as helper from "../helper"; +import * as helper from "../../ui-helper"; import * as view from "tns-core-modules/ui/core/view"; import * as actionBar from "tns-core-modules/ui/action-bar"; import { Visibility } from "tns-core-modules/ui/enums"; -global.moduleMerge(actionTestsCommon, exports); +export * from "./action-bar-tests-common"; export function test_NavBar_isVisible_when_MenuItems_areSet() { @@ -87,7 +87,7 @@ export function test_actionItem_visibility() { var actionItem = new actionBar.ActionItem(); actionItem.text = "Test"; actionItem.ios.position = "left"; - var page = actionTestsCommon.createPageAndNavigate(); + var page = createPageAndNavigate(); page.actionBar.actionItems.addItem(actionItem); @@ -111,7 +111,7 @@ export function test_actionItem_visibility() { export function test_navigationButton_visibility() { var actionItem = new actionBar.ActionItem(); actionItem.text = "Test"; - var page = actionTestsCommon.createPageAndNavigate(); + var page = createPageAndNavigate(); page.actionBar.navigationButton = actionItem; diff --git a/tests/app/ui/activity-indicator/activity-indicator-tests.ts b/tests/app/ui/activity-indicator/activity-indicator-tests.ts index def58d71d..ae7624369 100644 --- a/tests/app/ui/activity-indicator/activity-indicator-tests.ts +++ b/tests/app/ui/activity-indicator/activity-indicator-tests.ts @@ -1,5 +1,5 @@ -import * as TKUnit from "../../TKUnit"; -import * as helper from "../helper"; +import * as TKUnit from "../../tk-unit"; +import * as helper from "../../ui-helper"; import * as viewModule from "tns-core-modules/ui/core/view"; import * as imageModule from "tns-core-modules/ui/image"; import * as platform from "tns-core-modules/platform"; diff --git a/tests/app/ui/animation/animation-tests.ts b/tests/app/ui/animation/animation-tests.ts index 2652cfc8e..aab78b9a2 100644 --- a/tests/app/ui/animation/animation-tests.ts +++ b/tests/app/ui/animation/animation-tests.ts @@ -1,5 +1,5 @@ -import * as TKUnit from "../../TKUnit"; -import * as helper from "../helper"; +import * as TKUnit from "../../tk-unit"; +import * as helper from "../../ui-helper"; import * as viewModule from "tns-core-modules/ui/core/view"; import { Label } from "tns-core-modules/ui/label"; import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout"; diff --git a/tests/app/ui/animation/css-animation-tests.ts b/tests/app/ui/animation/css-animation-tests.ts index b9cd7d3be..485784dc9 100644 --- a/tests/app/ui/animation/css-animation-tests.ts +++ b/tests/app/ui/animation/css-animation-tests.ts @@ -1,8 +1,8 @@ -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import * as styleScope from "tns-core-modules/ui/styling/style-scope"; import * as keyframeAnimation from "tns-core-modules/ui/animation/keyframe-animation"; import * as enums from "tns-core-modules/ui/enums"; -import * as helper from "../../ui/helper"; +import * as helper from "../../ui-helper"; import * as stackModule from "tns-core-modules/ui/layouts/stack-layout"; import * as labelModule from "tns-core-modules/ui/label"; import * as color from "tns-core-modules/color"; @@ -314,7 +314,7 @@ export function test_ReadAnimationWithUnsortedKeyframes() { } export function test_ReadAnimationsWithCSSImport() { - let css = "@import '~/ui/animation/test.css'; .test { animation-name: test; }"; + let css = "@import 'ui/animation/test-page.css'; .test { animation-name: test; }"; let animation = createAnimationFromCSS(css, "test"); TKUnit.assertEqual(animation.keyframes.length, 3); TKUnit.assertEqual(animation.keyframes[1].declarations[0].property, "backgroundColor"); diff --git a/tests/app/ui/animation/test.css b/tests/app/ui/animation/test-page.css similarity index 100% rename from tests/app/ui/animation/test.css rename to tests/app/ui/animation/test-page.css diff --git a/tests/app/ui/border/border-tests.ts b/tests/app/ui/border/border-tests.ts index c50b618ab..8989d8bc8 100644 --- a/tests/app/ui/border/border-tests.ts +++ b/tests/app/ui/border/border-tests.ts @@ -1,7 +1,7 @@ // >> border-require import { Border } from "tns-core-modules/ui/border"; // << border-require -import * as helper from "../helper"; +import * as helper from "../../ui-helper"; export function test_recycling() { helper.nativeView_recycling_test(() => new Border()); diff --git a/tests/app/ui/bottom-navigation/bottom-navigation-navigation-tests.ts b/tests/app/ui/bottom-navigation/bottom-navigation-navigation-tests.ts index b0b506f35..89973b723 100644 --- a/tests/app/ui/bottom-navigation/bottom-navigation-navigation-tests.ts +++ b/tests/app/ui/bottom-navigation/bottom-navigation-navigation-tests.ts @@ -1,5 +1,5 @@ -import * as TKUnit from "../../TKUnit"; -import * as helper from "../helper"; +import * as TKUnit from "../../tk-unit"; +import * as helper from "../../ui-helper"; import { isIOS, isAndroid } from "tns-core-modules/platform"; import { Label } from "tns-core-modules/ui/label"; import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout"; @@ -286,4 +286,4 @@ function _clickTheFirstButtonInTheListViewNatively(tabView: BottomNavigation) { const btn = cell.contentView.subviews[0]; btn.sendActionsForControlEvents(UIControlEvents.TouchUpInside); } -} \ No newline at end of file +} diff --git a/tests/app/ui/bottom-navigation/bottom-navigation-root-tests.ts b/tests/app/ui/bottom-navigation/bottom-navigation-root-tests.ts index 9cce92bb5..39bccdb96 100644 --- a/tests/app/ui/bottom-navigation/bottom-navigation-root-tests.ts +++ b/tests/app/ui/bottom-navigation/bottom-navigation-root-tests.ts @@ -1,4 +1,4 @@ -import TKUnit = require("../../TKUnit"); +import * as TKUnit from "../../tk-unit"; import { isAndroid } from "tns-core-modules/platform"; import { _resetRootView } from "tns-core-modules/application/"; import { Frame, NavigationEntry, topmost } from "tns-core-modules/ui/frame"; diff --git a/tests/app/ui/bottom-navigation/bottom-navigation-tests.ts b/tests/app/ui/bottom-navigation/bottom-navigation-tests.ts index 9475c5be4..76741f0d0 100644 --- a/tests/app/ui/bottom-navigation/bottom-navigation-tests.ts +++ b/tests/app/ui/bottom-navigation/bottom-navigation-tests.ts @@ -1,8 +1,8 @@ import { UITest } from "../../ui-test"; import { Label } from "tns-core-modules/ui/label"; import { unsetValue } from "tns-core-modules/ui/core/view"; -import * as TKUnit from "../../TKUnit"; -import * as helper from "../helper"; +import * as TKUnit from "../../tk-unit"; +import * as helper from "../../ui-helper"; import * as tabViewTestsNative from "./bottom-navigation-tests-native"; import { BottomNavigation, TabContentItem, TabStrip, TabStripItem, SelectedIndexChangedEventData } from "tns-core-modules/ui/bottom-navigation"; diff --git a/tests/app/ui/builder/builder-tests.ts b/tests/app/ui/builder/builder-tests.ts index f9cb5885d..00aeeeb30 100644 --- a/tests/app/ui/builder/builder-tests.ts +++ b/tests/app/ui/builder/builder-tests.ts @@ -1,14 +1,15 @@ import { path } from "tns-core-modules/file-system"; import { loadPage } from "tns-core-modules/ui/builder"; -import { assertEqual, assertNull, assertThrows } from "../../TKUnit"; +import { assertEqual, assertNull, assertThrows } from "../../tk-unit"; const COMPONENT_MODULE = "component-module"; const MISSING_MODULE = "missing-module"; const LABEL = "label"; +const testDir = "ui/builder"; function getViewComponent(componentModule: string) { - const moduleNamePath = path.join(__dirname, componentModule); - const fileName = path.join(__dirname, `${componentModule}.xml`); + const moduleNamePath = path.join(testDir, componentModule); + const fileName = path.join(testDir, `${componentModule}.xml`); const view = loadPage(moduleNamePath, fileName); return view; } diff --git a/tests/app/ui/button/button-tests-native.ios.ts b/tests/app/ui/button/button-tests-native.ios.ts index 41f31545f..ced55b4c0 100644 --- a/tests/app/ui/button/button-tests-native.ios.ts +++ b/tests/app/ui/button/button-tests-native.ios.ts @@ -1,7 +1,7 @@ import * as buttonModule from "tns-core-modules/ui/button"; import * as colorModule from "tns-core-modules/color"; import * as enums from "tns-core-modules/ui/enums"; -import { getColor } from "../helper"; +import { getColor } from "../../ui-helper"; export function getNativeText(button: buttonModule.Button): string { return button.ios.titleForState(UIControlState.Normal); diff --git a/tests/app/ui/button/button-tests.ts b/tests/app/ui/button/button-tests.ts index 1af31325d..4df74d227 100644 --- a/tests/app/ui/button/button-tests.ts +++ b/tests/app/ui/button/button-tests.ts @@ -1,5 +1,5 @@ -import * as TKUnit from "../../TKUnit"; -import * as helper from "../helper"; +import * as TKUnit from "../../tk-unit"; +import * as helper from "../../ui-helper"; import * as viewModule from "tns-core-modules/ui/core/view"; import * as pagesModule from "tns-core-modules/ui/page"; import * as buttonTestsNative from "./button-tests-native"; diff --git a/tests/app/ui/core/bindable/bindable-tests.ts b/tests/app/ui/core/bindable/bindable-tests.ts index aca39c5d5..967766cb6 100644 --- a/tests/app/ui/core/bindable/bindable-tests.ts +++ b/tests/app/ui/core/bindable/bindable-tests.ts @@ -1,9 +1,9 @@ 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 "../../../tk-unit"; import * as types from "tns-core-modules/utils/types"; -import * as helper from "../../helper"; +import * as helper from "../../../ui-helper"; import * as utils from "tns-core-modules/utils/utils"; import * as bindingBuilder from "tns-core-modules/ui/builder/binding-builder"; import * as appModule from "tns-core-modules/application"; @@ -218,12 +218,19 @@ export function test_WhenBindingIsSetToAnElement_AndElementIsRemoved_ShouldBeCol try { stack.addChild(weakRef.get()); + TKUnit.waitUntilReady(() => weakRef.get().isLoaded); + TKUnit.assertEqual(weakRef.get().text, expectedValue, "Binding is not working properly!"); stack.removeChild(weakRef.get()); TKUnit.waitUntilReady(() => !weakRef.get().isLoaded); + utils.GC(); - TKUnit.assert(!weakRef.get(), "UIElement is still alive!"); - testFinished = true; + // Give time for the GC to kick in + setTimeout(() => { + utils.GC(); + TKUnit.assert(!weakRef.get(), "UIElement is still alive!"); + testFinished = true; + }, 100); } catch (e) { done(e); diff --git a/tests/app/ui/core/bindable/binding-expressions-tests.ts b/tests/app/ui/core/bindable/binding-expressions-tests.ts index aaaaf2a1f..6e61a0ce9 100644 --- a/tests/app/ui/core/bindable/binding-expressions-tests.ts +++ b/tests/app/ui/core/bindable/binding-expressions-tests.ts @@ -1,6 +1,6 @@ import * as frameModule from "tns-core-modules/ui/frame"; import * as textFieldModule from "tns-core-modules/ui/text-field"; -import * as helper from "../../helper"; +import * as helper from "../../../ui-helper"; export var test_BindingExpressions_ArrayAccess = function () { navigateToPage("bindingExpressions_arrayAccess_testPage"); @@ -84,5 +84,5 @@ export var assertElementValueIsNaN = function (elementId: string) { } export var navigateToPage = function (pageName: string) { - helper.navigateToModule("/ui/test-pages/" + pageName); + helper.navigateToModule("ui/test-pages/" + pageName); } diff --git a/tests/app/ui/core/weak-event-listener/weak-event-listener-tests.ts b/tests/app/ui/core/weak-event-listener/weak-event-listener-tests.ts index f59f147df..3736264cd 100644 --- a/tests/app/ui/core/weak-event-listener/weak-event-listener-tests.ts +++ b/tests/app/ui/core/weak-event-listener/weak-event-listener-tests.ts @@ -1,7 +1,7 @@ -import * as TKUnit from "../../../TKUnit"; +import * as TKUnit from "../../../tk-unit"; import { Observable, EventData } from "tns-core-modules/data/observable"; import { addWeakEventListener, removeWeakEventListener } from "tns-core-modules/ui/core/weak-event-listener"; -import { forceGC } from "../../helper"; +import { forceGC } from "../../../ui-helper"; class Target { public counter: number = 0; diff --git a/tests/app/ui/date-picker/date-picker-tests.ts b/tests/app/ui/date-picker/date-picker-tests.ts index eaa9e40b7..976da252a 100644 --- a/tests/app/ui/date-picker/date-picker-tests.ts +++ b/tests/app/ui/date-picker/date-picker-tests.ts @@ -1,4 +1,4 @@ -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import * as testModule from "../../ui-test"; import * as datePickerTestsNative from "./date-picker-tests-native"; import * as color from "tns-core-modules/color"; @@ -8,7 +8,7 @@ import * as platform from "tns-core-modules/platform"; import * as datePickerModule from "tns-core-modules/ui/date-picker"; // << date-picker-require -import * as helper from "../helper"; +import * as helper from "../../ui-helper"; export function test_recycling() { helper.nativeView_recycling_test(() => new datePickerModule.DatePicker()); diff --git a/tests/app/ui/dependency-observable-tests.ts b/tests/app/ui/dependency-observable-tests.ts index cc074c454..852512f07 100644 --- a/tests/app/ui/dependency-observable-tests.ts +++ b/tests/app/ui/dependency-observable-tests.ts @@ -9,7 +9,7 @@ import * as dependencyObservableModule from "tns-core-modules/ui/core/dependency // ``` // -import * as TKUnit from "../TKUnit"; +import * as TKUnit from "../tk-unit"; import * as types from "tns-core-modules/utils/types"; import * as observableModule from "tns-core-modules/data/observable"; diff --git a/tests/app/ui/frame/frame-tests-common.ts b/tests/app/ui/frame/frame-tests-common.ts index 81953412a..3bf54dc6f 100644 --- a/tests/app/ui/frame/frame-tests-common.ts +++ b/tests/app/ui/frame/frame-tests-common.ts @@ -5,8 +5,8 @@ import { Frame, getFrameById, topmost, NavigationEntry } from "tns-core-modules/ import { getRootView } from "tns-core-modules/application"; import { Label } from "tns-core-modules/ui/label"; import { Page } from "tns-core-modules/ui/page"; -import * as helper from "../helper"; -import * as TKUnit from "../../TKUnit"; +import * as helper from "../../ui-helper"; +import * as TKUnit from "../../tk-unit"; const NAV_WAIT = 15; function emptyNavigationQueue(frame: Frame) { diff --git a/tests/app/ui/frame/frame-tests.android.ts b/tests/app/ui/frame/frame-tests.android.ts index 5e0ac94a2..29519b109 100644 --- a/tests/app/ui/frame/frame-tests.android.ts +++ b/tests/app/ui/frame/frame-tests.android.ts @@ -1,5 +1,5 @@ import * as frameModule from "tns-core-modules/ui/frame"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import { unsetValue, PercentLength } from "tns-core-modules/ui/core/view"; export * from "./frame-tests-common"; diff --git a/tests/app/ui/html-view/html-view-tests.ts b/tests/app/ui/html-view/html-view-tests.ts index 924df1a82..60a96b1f0 100644 --- a/tests/app/ui/html-view/html-view-tests.ts +++ b/tests/app/ui/html-view/html-view-tests.ts @@ -1,5 +1,5 @@ -import * as TKUnit from "../../TKUnit"; -import * as helper from "../helper"; +import * as TKUnit from "../../tk-unit"; +import * as helper from "../../ui-helper"; import * as types from "tns-core-modules/utils/types"; // >> htmlview-require diff --git a/tests/app/ui/image-cache/image-cache-tests.ts b/tests/app/ui/image-cache/image-cache-tests.ts index 946cf426b..6d313a9a1 100644 --- a/tests/app/ui/image-cache/image-cache-tests.ts +++ b/tests/app/ui/image-cache/image-cache-tests.ts @@ -4,7 +4,7 @@ import * as types from "tns-core-modules/utils/types"; import { device } from "tns-core-modules/platform"; import lazy from "tns-core-modules/utils/lazy"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; const sdkVersion = lazy(() => parseInt(device.sdkVersion)); diff --git a/tests/app/ui/image/image-tests.ts b/tests/app/ui/image/image-tests.ts index 693ae5670..2b8992cdd 100644 --- a/tests/app/ui/image/image-tests.ts +++ b/tests/app/ui/image/image-tests.ts @@ -4,8 +4,8 @@ import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout"; import { isIOS, isAndroid } from "tns-core-modules/platform"; import { PropertyChangeData } from "tns-core-modules/data/observable"; import * as utils from "tns-core-modules/utils/utils"; -import * as TKUnit from "../../TKUnit"; -import { getColor } from "../helper"; +import * as TKUnit from "../../tk-unit"; +import { getColor } from "../../ui-helper"; // >> img-require import * as ImageModule from "tns-core-modules/ui/image"; @@ -14,12 +14,12 @@ import * as ImageModule from "tns-core-modules/ui/image"; import * as types from "tns-core-modules/utils/types"; import * as ImageSourceModule from "tns-core-modules/image-source"; import * as ViewModule from "tns-core-modules/ui/core/view"; -import * as helper from "../helper"; +import * as helper from "../../ui-helper"; import * as ObservableModule from "tns-core-modules/data/observable"; import * as color from "tns-core-modules/color"; import * as backgroundModule from "tns-core-modules/ui/styling/background"; import { android as androidApp } from "tns-core-modules/application"; -const imagePath = "~/logo.png"; +const imagePath = "~/assets/logo.png"; export function test_recycling() { helper.nativeView_recycling_test(() => new Image()); @@ -107,7 +107,7 @@ export const test_SettingImageSrcToURL_async = function (done) { export const test_SettingImageSrcToFileWithinApp_sync = function () { // >> img-create-local const image = new ImageModule.Image(); - image.src = "~/logo.png"; + image.src = "~/assets/logo.png"; // << img-create-local runImageTestSync(image, image.src); @@ -116,7 +116,7 @@ export const test_SettingImageSrcToFileWithinApp_sync = function () { export const test_SettingImageSrcToFileWithinApp_async = function (done) { const image = new ImageModule.Image(); (image).useCache = false; - image.src = "~/logo.png"; + image.src = "~/assets/logo.png"; runImageTestAsync(image, image.src, done); }; @@ -164,9 +164,9 @@ export const __test_SettingImageSrcTwiceMustNotMismatch = function (done) { } }); image.loadMode = "async"; - image.src = "~/logo.png"; + image.src = "~/assets/logo.png"; image.src = null; - // At somepoint image.imageSource was set to "~/logo.png"; + // At somepoint image.imageSource was set to "~/assets/logo.png"; }; export const test_SettingStretch_AspectFit = function () { @@ -267,7 +267,7 @@ export const test_SettingImageSourceWhenSizedToParentDoesNotRequestLayout = ios( let called = false; image.requestLayout = () => called = true; - image.src = "~/logo.png"; + image.src = "~/assets/logo.png"; TKUnit.assertFalse(called, "image.requestLayout should not be called."); }); @@ -285,7 +285,7 @@ export const test_SettingImageSourceWhenFixedWidthAndHeightDoesNotRequestLayout let called = false; image.requestLayout = () => called = true; - image.src = "~/logo.png"; + image.src = "~/assets/logo.png"; TKUnit.assertFalse(called, "image.requestLayout should not be called."); }); @@ -301,7 +301,7 @@ export const test_SettingImageSourceWhenSizedToContentShouldInvalidate = ios(() let called = false; image.requestLayout = () => called = true; - image.src = "~/logo.png"; + image.src = "~/assets/logo.png"; TKUnit.assertTrue(called, "image.requestLayout should be called."); }); diff --git a/tests/app/ui/image/image.md b/tests/app/ui/image/image.md index 2796098b9..06c243969 100644 --- a/tests/app/ui/image/image.md +++ b/tests/app/ui/image/image.md @@ -76,7 +76,7 @@ The sample above, demonstrates, how to load an image source while providing URL ``` XML - {%raw%}{%endraw%} + {%raw%}{%endraw%} ``` diff --git a/tests/app/ui/label/label-tests-native.ios.ts b/tests/app/ui/label/label-tests-native.ios.ts index f08e98a76..b5dc8a9a5 100644 --- a/tests/app/ui/label/label-tests-native.ios.ts +++ b/tests/app/ui/label/label-tests-native.ios.ts @@ -1,7 +1,7 @@ import * as labelModule from "tns-core-modules/ui/label"; import * as enums from "tns-core-modules/ui/enums"; import * as colorModule from "tns-core-modules/color"; -import { getColor } from "../helper"; +import { getColor } from "../../ui-helper"; export function getNativeTextAlignment(label: labelModule.Label): string { switch (label.ios.textAlignment) { diff --git a/tests/app/ui/label/label-tests.css b/tests/app/ui/label/label-tests-page.css similarity index 100% rename from tests/app/ui/label/label-tests.css rename to tests/app/ui/label/label-tests-page.css diff --git a/tests/app/ui/label/label-tests-wrong.css b/tests/app/ui/label/label-tests-wrong-page.css similarity index 100% rename from tests/app/ui/label/label-tests-wrong.css rename to tests/app/ui/label/label-tests-wrong-page.css diff --git a/tests/app/ui/label/label-tests.ts b/tests/app/ui/label/label-tests.ts index 6e4f416af..98e78534a 100644 --- a/tests/app/ui/label/label-tests.ts +++ b/tests/app/ui/label/label-tests.ts @@ -1,4 +1,4 @@ -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import * as testModule from "../../ui-test"; //>> label-require @@ -19,9 +19,11 @@ import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout"; import { isIOS, isAndroid } from "tns-core-modules/platform"; import { Label } from "tns-core-modules/ui/label"; import { LayoutBase } from "tns-core-modules/ui/layouts/layout-base"; -import * as helper from "../helper"; +import * as helper from "../../ui-helper"; import { Span, FormattedString } from "tns-core-modules/text/formatted-string"; +const testDir = "ui/label"; + export class LabelTest extends testModule.UITest { public create(): LabelModule.Label { @@ -525,7 +527,7 @@ export class LabelTest extends testModule.UITest { view.id = "testLabel"; page.addCss("#testLabel { text-align: " + this.expectedTextAlignment + "; }"); - page.addCssFile(fs.path.join(__dirname, "label-tests.css")); + page.addCssFile(fs.path.join(testDir, "label-tests-page.css")); const actualResult = view.style.textAlignment; // actual result is taken from #testLabel tag, because it has a greater priority (id vs type). @@ -559,7 +561,7 @@ export class LabelTest extends testModule.UITest { this.waitUntilTestElementIsLoaded(); view.id = "testLabel"; - page.addCssFile(fs.path.join(__dirname, "label-tests-wrong.css")); + page.addCssFile(fs.path.join(testDir, "label-tests-wrong-page.css")); TKUnit.assertNotEqual(this.errorMessage, undefined); } diff --git a/tests/app/ui/layouts/absolute-layout-tests.ts b/tests/app/ui/layouts/absolute-layout-tests.ts index be4bc45a8..5855392a4 100644 --- a/tests/app/ui/layouts/absolute-layout-tests.ts +++ b/tests/app/ui/layouts/absolute-layout-tests.ts @@ -1,10 +1,10 @@ import * as testModule from "../../ui-test"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import * as labelModule from "tns-core-modules/ui/label"; import * as colorModule from "tns-core-modules/color"; import * as layoutHelper from "./layout-helper"; import * as commonTests from "./common-layout-tests"; -import * as helper from "../helper"; +import * as helper from "../../ui-helper"; // >> absolute-layout-require import * as absoluteLayoutModule from "tns-core-modules/ui/layouts/absolute-layout"; diff --git a/tests/app/ui/layouts/common-layout-tests.ts b/tests/app/ui/layouts/common-layout-tests.ts index 91a94d0a4..f54d199e4 100644 --- a/tests/app/ui/layouts/common-layout-tests.ts +++ b/tests/app/ui/layouts/common-layout-tests.ts @@ -1,4 +1,4 @@ -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import * as layoutHelper from "./layout-helper"; import * as testModule from "../../ui-test"; import { LayoutBase, unsetValue, PercentLength } from "tns-core-modules/ui/layouts/layout-base"; diff --git a/tests/app/ui/layouts/dock-layout-tests.ts b/tests/app/ui/layouts/dock-layout-tests.ts index 93a97d4cc..13992ab4b 100644 --- a/tests/app/ui/layouts/dock-layout-tests.ts +++ b/tests/app/ui/layouts/dock-layout-tests.ts @@ -1,10 +1,10 @@ import * as button from "tns-core-modules/ui/button"; import { DockLayout } from "tns-core-modules/ui/layouts/dock-layout"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import * as helper from "./layout-helper"; import * as testModule from "../../ui-test"; import * as commonTests from "./common-layout-tests"; -import * as testHelper from "../helper"; +import * as testHelper from "../../ui-helper"; // >> dock-layout-require import * as dockModule from "tns-core-modules/ui/layouts/dock-layout"; diff --git a/tests/app/ui/layouts/flexbox-layout-tests.ts b/tests/app/ui/layouts/flexbox-layout-tests.ts index 86ef59e54..68fdcfbea 100644 --- a/tests/app/ui/layouts/flexbox-layout-tests.ts +++ b/tests/app/ui/layouts/flexbox-layout-tests.ts @@ -53,8 +53,8 @@ export namespace AlignSelf { import { View, unsetValue, Length, PercentLength } from "tns-core-modules/ui/core/view"; import { Label } from "tns-core-modules/ui/label"; -import * as TKUnit from "../../TKUnit"; -import * as helper from "../helper"; +import * as TKUnit from "../../tk-unit"; +import * as helper from "../../ui-helper"; import { parse } from "tns-core-modules/ui/builder"; import { dipToDp, left, top, right, bottom, height, width, paddingLeft, paddingTop, paddingRight, paddingBottom, diff --git a/tests/app/ui/layouts/grid-layout-tests.ts b/tests/app/ui/layouts/grid-layout-tests.ts index 6d80c7925..7acbda52e 100644 --- a/tests/app/ui/layouts/grid-layout-tests.ts +++ b/tests/app/ui/layouts/grid-layout-tests.ts @@ -1,7 +1,7 @@ import { Page } from "tns-core-modules/ui/page"; import { GridLayout, ItemSpec } from "tns-core-modules/ui/layouts/grid-layout"; import { Button } from "tns-core-modules/ui/button"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import * as view from "tns-core-modules/ui/core/view"; import { unsetValue } from "tns-core-modules/ui/core/view"; import * as builder from "tns-core-modules/ui/builder"; @@ -9,7 +9,7 @@ import * as testModule from "../../ui-test"; import * as layoutHelper from "./layout-helper"; import * as platform from "tns-core-modules/platform"; import * as commonTests from "./common-layout-tests"; -import * as helper from "../helper"; +import * as helper from "../../ui-helper"; var DELTA = 1; class RemovalTrackingGridLayout extends GridLayout { diff --git a/tests/app/ui/layouts/layout-helper.android.ts b/tests/app/ui/layouts/layout-helper.android.ts index 7120b019d..e1060ac46 100644 --- a/tests/app/ui/layouts/layout-helper.android.ts +++ b/tests/app/ui/layouts/layout-helper.android.ts @@ -3,7 +3,7 @@ import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout"; import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout"; import * as utils from "tns-core-modules/utils/utils"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import * as def from "./layout-helper"; var DELTA = 0.1; diff --git a/tests/app/ui/layouts/layout-helper.ios.ts b/tests/app/ui/layouts/layout-helper.ios.ts index fafa0a7ba..ce83ef284 100644 --- a/tests/app/ui/layouts/layout-helper.ios.ts +++ b/tests/app/ui/layouts/layout-helper.ios.ts @@ -2,7 +2,7 @@ import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout"; import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout"; import * as utils from "tns-core-modules/utils/utils"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import * as def from "./layout-helper"; var DELTA = 0.1; diff --git a/tests/app/ui/layouts/layout-tests-helper.ts b/tests/app/ui/layouts/layout-tests-helper.ts index cacd342ec..b9a4442f7 100644 --- a/tests/app/ui/layouts/layout-tests-helper.ts +++ b/tests/app/ui/layouts/layout-tests-helper.ts @@ -1,5 +1,5 @@ import { View, Length } from "tns-core-modules/ui/core/view"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import { layout } from "tns-core-modules/utils/utils"; import round = layout.round; diff --git a/tests/app/ui/layouts/safe-area-tests.ts b/tests/app/ui/layouts/safe-area-tests.ts index 965d89b07..1f792c9bd 100644 --- a/tests/app/ui/layouts/safe-area-tests.ts +++ b/tests/app/ui/layouts/safe-area-tests.ts @@ -1,9 +1,9 @@ import { GridLayout } from "tns-core-modules/ui/layouts/grid-layout"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import * as view from "tns-core-modules/ui/core/view"; import * as testModule from "../../ui-test"; import * as platform from "tns-core-modules/platform"; -import * as helper from "../helper"; +import * as helper from "../../ui-helper"; import { parse } from "tns-core-modules/ui/builder"; import { Page } from "tns-core-modules/ui/page"; import { Label } from "tns-core-modules/ui/label"; diff --git a/tests/app/ui/layouts/stack-layout-tests.ts b/tests/app/ui/layouts/stack-layout-tests.ts index 75e06e63b..4fbf228be 100644 --- a/tests/app/ui/layouts/stack-layout-tests.ts +++ b/tests/app/ui/layouts/stack-layout-tests.ts @@ -1,7 +1,7 @@ import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout"; import { Button } from "tns-core-modules/ui/button"; -import * as TKUnit from "../../TKUnit"; -import * as helper from "../helper"; +import * as TKUnit from "../../tk-unit"; +import * as helper from "../../ui-helper"; import * as enums from "tns-core-modules/ui/enums"; import * as utils from "tns-core-modules/utils/utils"; import * as testModule from "../../ui-test"; diff --git a/tests/app/ui/layouts/wrap-layout-tests.ts b/tests/app/ui/layouts/wrap-layout-tests.ts index 0e0c7fb0e..2a6fcdbf4 100644 --- a/tests/app/ui/layouts/wrap-layout-tests.ts +++ b/tests/app/ui/layouts/wrap-layout-tests.ts @@ -1,9 +1,9 @@ -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import { Label } from "tns-core-modules/ui/label"; import * as layoutHelper from "./layout-helper"; import * as testModule from "../../ui-test"; import * as commonTests from "./common-layout-tests"; -import * as helper from "../helper"; +import * as helper from "../../ui-helper"; // >> wrap-layout-require import * as wrapLayoutModule from "tns-core-modules/ui/layouts/wrap-layout"; diff --git a/tests/app/ui/lifecycle/lifecycle-tests.ts b/tests/app/ui/lifecycle/lifecycle-tests.ts index 69a733557..5e7912f04 100644 --- a/tests/app/ui/lifecycle/lifecycle-tests.ts +++ b/tests/app/ui/lifecycle/lifecycle-tests.ts @@ -1,6 +1,6 @@ -import * as helper from "../helper"; +import * as helper from "../../ui-helper"; import * as btnCounter from "./pages/button-counter"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import { isIOS, isAndroid } from "tns-core-modules/platform"; // Integration tests that asser sertain runtime behavior, lifecycle events atc. diff --git a/tests/app/ui/lifecycle/pages/page-one.xml b/tests/app/ui/lifecycle/pages/page-one.xml index fd36f8fba..0d1a9e732 100644 --- a/tests/app/ui/lifecycle/pages/page-one.xml +++ b/tests/app/ui/lifecycle/pages/page-one.xml @@ -7,6 +7,6 @@ - + diff --git a/tests/app/ui/list-picker/list-picker-tests.ts b/tests/app/ui/list-picker/list-picker-tests.ts index 2dedf070d..8c9041138 100644 --- a/tests/app/ui/list-picker/list-picker-tests.ts +++ b/tests/app/ui/list-picker/list-picker-tests.ts @@ -1,5 +1,5 @@ -import * as TKUnit from "../../TKUnit"; -import * as helper from "../helper"; +import * as TKUnit from "../../tk-unit"; +import * as helper from "../../ui-helper"; import * as viewModule from "tns-core-modules/ui/core/view"; import * as listPickerTestsNative from "./list-picker-tests-native"; import * as application from "tns-core-modules/application"; diff --git a/tests/app/ui/list-view/list-view-safe-area-tests.ts b/tests/app/ui/list-view/list-view-safe-area-tests.ts index 0e33c5841..fb984a0d7 100644 --- a/tests/app/ui/list-view/list-view-safe-area-tests.ts +++ b/tests/app/ui/list-view/list-view-safe-area-tests.ts @@ -1,5 +1,5 @@ -import * as helper from "../helper"; -import * as TKUnit from "../../TKUnit"; +import * as helper from "../../ui-helper"; +import * as TKUnit from "../../tk-unit"; import { parse } from "tns-core-modules/ui/builder"; import * as view from "tns-core-modules/ui/core/view"; import * as platform from "tns-core-modules/platform"; diff --git a/tests/app/ui/list-view/list-view-tests.ts b/tests/app/ui/list-view/list-view-tests.ts index 9478134a1..65c9c394f 100644 --- a/tests/app/ui/list-view/list-view-tests.ts +++ b/tests/app/ui/list-view/list-view-tests.ts @@ -1,5 +1,5 @@ -import * as TKUnit from "../../TKUnit"; -import * as helper from "../helper"; +import * as TKUnit from "../../tk-unit"; +import * as helper from "../../ui-helper"; import { UITest } from "../../ui-test"; import { getResources as appGetResources } from "tns-core-modules/application"; import { Observable, EventData } from "tns-core-modules/data/observable"; diff --git a/tests/app/ui/page/modal-page.ts b/tests/app/ui/page/modal-page.ts index b1c4ec910..78433bf98 100644 --- a/tests/app/ui/page/modal-page.ts +++ b/tests/app/ui/page/modal-page.ts @@ -1,5 +1,5 @@ import { topmost } from "tns-core-modules/ui/frame"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import { Page, ShownModallyData } from "tns-core-modules/ui/page"; export var modalPage: Page; diff --git a/tests/app/ui/page/modal-tab-page.ts b/tests/app/ui/page/modal-tab-page.ts index 9585789bf..ce7d16e61 100644 --- a/tests/app/ui/page/modal-tab-page.ts +++ b/tests/app/ui/page/modal-tab-page.ts @@ -1,6 +1,6 @@ import { NavigatedData } from "tns-core-modules/ui/page"; import { View } from "tns-core-modules/ui/core/view"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import { stack } from "tns-core-modules/ui/frame"; import { isAndroid } from "tns-core-modules/platform"; diff --git a/tests/app/ui/page/modal-tab-root.ts b/tests/app/ui/page/modal-tab-root.ts index 20b26a0ef..c47fb1a45 100644 --- a/tests/app/ui/page/modal-tab-root.ts +++ b/tests/app/ui/page/modal-tab-root.ts @@ -1,6 +1,6 @@ import { ShownModallyData } from "tns-core-modules/ui/core/view"; import { TabView } from "tns-core-modules/ui/tab-view/tab-view"; -import * as TKUnit from "../../TKUnit"; +import * as TKUnit from "../../tk-unit"; import { stack } from "tns-core-modules/ui/frame"; import { isIOS } from "tns-core-modules/platform" diff --git a/tests/app/ui/page/page-tests-common.ts b/tests/app/ui/page/page-tests-common.ts index 8f9f2da17..d4f6218d9 100644 --- a/tests/app/ui/page/page-tests-common.ts +++ b/tests/app/ui/page/page-tests-common.ts @@ -14,8 +14,8 @@ function pageLoaded(args) { } exports.pageLoaded = pageLoaded; // << article-set-bindingcontext -import * as TKUnit from "../../TKUnit"; -import * as helper from "../helper"; +import * as TKUnit from "../../tk-unit"; +import * as helper from "../../ui-helper"; import { StackLayout } from "tns-core-modules/ui/layouts/stack-layout"; import { View, PercentLength, unsetValue, EventData, isIOS } from "tns-core-modules/ui/core/view"; import { Frame, stack } from "tns-core-modules/ui/frame"; @@ -286,9 +286,10 @@ export function test_LoadPageFromModule() { export function test_LoadPageFromDeclarativeWithCSS() { const topFrame = topmost(); - helper.navigateToModule("ui/page/test-page-declarative-css"); + helper.navigateToModule("ui/page/test-declarative-css-page"); TKUnit.assert(topFrame.currentPage.content instanceof Label, "Content of the test page should be a Label created within test-page-module-css."); + const testLabel =