diff --git a/.gitignore b/.gitignore index b2ac3aa00..e6feee844 100644 --- a/.gitignore +++ b/.gitignore @@ -52,7 +52,11 @@ apps/hooks/ apps/node_modules/ e2e/**/platforms +!e2e/**/webpack.config.js +e2e/**/reports/ +e2e/**/*.trace/ +e2e/**/test-results.xml package-lock.json -.nsbuildinfo \ No newline at end of file +.nsbuildinfo diff --git a/DevelopmentWorkflow.md b/DevelopmentWorkflow.md index cc7d02bb8..0844de7a3 100644 --- a/DevelopmentWorkflow.md +++ b/DevelopmentWorkflow.md @@ -20,7 +20,6 @@ Managing dependencies: - `tns-platform-declarations` - `tns-core-modules` - `e2e` depends on: - - `tns-platform-declarations` - `tns-core-modules` - `tests` depends on: - `tns-platform-declarations` @@ -43,7 +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`, `apps` and `e2e` projects. +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 @@ -69,7 +68,7 @@ The modules have `typescript` as a devDependency so you should also be able to u ./node_modules/.bin/tsc ``` -You can compile the TypeScript files in the `tns-core-modules`, `tns-platform-declarations`, `apps`, `e2e` and `tests` at once at the root of the repo: +You can compile the TypeScript files in the `tns-core-modules`, `tns-platform-declarations`, `apps` and `tests` at once at the root of the repo: ```bash npm run tsc diff --git a/e2e/modal-navigation/.vscode/launch.json b/e2e/modal-navigation/.vscode/launch.json index d89bf7bf3..55dae90bf 100644 --- a/e2e/modal-navigation/.vscode/launch.json +++ b/e2e/modal-navigation/.vscode/launch.json @@ -4,7 +4,48 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - + { + "type": "node", + "request": "launch", + "name": "Launch Tests on Android", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "args": [ + "-u", + "tdd", + "--timeout", + "999999", + "--colors", + // "${workspaceFolder}/test", + "--opts", + "./e2e/config/mocha.opts", + "--runType", + "android23", + "--reuseDevice", + "--verbose" + ], + "internalConsoleOptions": "openOnSessionStart" + }, + { + "type": "node", + "request": "launch", + "name": "Launch Tests on iOS", + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", + "args": [ + "-u", + "tdd", + "--timeout", + "999999", + "--colors", + // "${workspaceFolder}/test", + "--opts", + "./e2e/config/mocha.opts", + "--runType", + "sim.iPhoneX.iOS112", + "--reuseDevice", + "--verbose" + ], + "internalConsoleOptions": "openOnSessionStart" + }, { "name": "Launch on iOS", "type": "nativescript", @@ -25,7 +66,6 @@ "platform": "ios", "appRoot": "${workspaceRoot}", "sourceMaps": true, - "stopOnEntry": true, "tnsArgs": [ "--syncAllFiles" ], @@ -51,7 +91,6 @@ "platform": "android", "appRoot": "${workspaceRoot}", "sourceMaps": true, - "stopOnEntry": true, "tnsArgs": [ "--syncAllFiles" ], diff --git a/e2e/modal-navigation/README.md b/e2e/modal-navigation/README.md new file mode 100644 index 000000000..b3371f391 --- /dev/null +++ b/e2e/modal-navigation/README.md @@ -0,0 +1,62 @@ +Execute Tests +============= + +Android: + +``` +npm run e2e -- --runType android23 --reuseDevice +``` + +iOS: + +``` +npm run e2e -- --runType sim.iPhoneX.iOS112 --reuseDevice +``` + +Scenarios +============= + +ROOT FRAME: + +1. [Done] Show modal dialog with frame + 1. Navigate to modal second page within modal dialog + 1. Go back + 2. Show nested modal dialog + 2. Close nested modal dialog + 3. Show nested modal dialog with frame + 3. Close nested modal dialog + 4. Close modal dialog +2. [Done] Show modal dialog + 1. Show nested modal dialog + 1. Close nested modal dialog + 2. Show nested modal dialog with frame + 2. Close nested modal dialog + 3. Close modal dialog +3. [Done] Show modal tabview + 1. Navigate to second page within tab item frame + 1. Go back + 2. Show nested modal dialog + 2. Close nested modal dialog + 3. Show nested modal dialog with frame + 3. Close nested modal dialog + 4. Close modal dialog +4. Navigate to second page within root frame + 1. Show modal dialog with frame + 1. Navigate to second page within modal dialog + 1. Go back + 2. Show nested modal dialog + 2. Close nested modal dialog + 3. Show nested modal dialog with frame + 3. Close nested modal dialog + 4. Close modal dialog + 2. Show modal dialog + 1. Show nested modal dialog + 1. Close nested modal dialog + 2. Show nested modal dialog with frame + 2. Close nested modal dialog + 3. Close modal dialog + 3. Go back + +ROOT TABVIEW: + +[Same as above] diff --git a/e2e/modal-navigation/app/app.ts b/e2e/modal-navigation/app/app.ts index 100be80a5..88113cfe5 100644 --- a/e2e/modal-navigation/app/app.ts +++ b/e2e/modal-navigation/app/app.ts @@ -1,3 +1,4 @@ +import "./bundle-config"; import * as application from "tns-core-modules/application"; application.run({ moduleName: "app-root" }); diff --git a/e2e/modal-navigation/app/bundle-config.ts b/e2e/modal-navigation/app/bundle-config.ts new file mode 100644 index 000000000..6dec5b29c --- /dev/null +++ b/e2e/modal-navigation/app/bundle-config.ts @@ -0,0 +1,9 @@ +if ((global).TNS_WEBPACK) { + // Register tns-core-modules UI framework modules + require("bundle-entry-points"); + + // Register application modules + // This will register each `root`, `page`, `fragment` postfixed xml, css, js, ts, scss file in the app/ folder + const context = (require).context("~/", true, /(root|page|fragment)\.(xml|css|js|ts|scss|less|sass)$/); + global.registerWebpackModules(context); +} diff --git a/e2e/modal-navigation/app/home/home-page.ts b/e2e/modal-navigation/app/home/home-page.ts index 2da3cde7f..8b6887127 100644 --- a/e2e/modal-navigation/app/home/home-page.ts +++ b/e2e/modal-navigation/app/home/home-page.ts @@ -56,6 +56,6 @@ export function onNavigate(args: EventData) { } export function onRootViewChange() { - let rootView: View = application.getRootView(); - rootView.typeName === "Frame" ? application._resetRootView({moduleName: "tab-root"}) : application._resetRootView({moduleName: "app-root"}); + let rootView = application.getRootView(); + rootView instanceof Frame ? application._resetRootView({moduleName: "tab-root"}) : application._resetRootView({moduleName: "app-root"}); } diff --git a/e2e/modal-navigation/app/modal-nested/modal-nested-page.xml b/e2e/modal-navigation/app/modal-nested/modal-nested-page.xml index 06b0a6ee0..aaba10de7 100644 --- a/e2e/modal-navigation/app/modal-nested/modal-nested-page.xml +++ b/e2e/modal-navigation/app/modal-nested/modal-nested-page.xml @@ -5,10 +5,10 @@ navigatedFrom="onNavigatedFrom"> - + -