diff --git a/e2e/config/appium.capabilities.json b/e2e/config/appium.capabilities.json
index c13c15e75..f7112699b 100644
--- a/e2e/config/appium.capabilities.json
+++ b/e2e/config/appium.capabilities.json
@@ -83,6 +83,18 @@
"fullReset": false,
"app": ""
},
+ "android28": {
+ "platformName": "Android",
+ "platformVersion": "28",
+ "deviceName": "Emulator-Api28-Google",
+ "avd": "Emulator-Api28-Google",
+ "lt": 60000,
+ "appActivity": "com.tns.NativeScriptActivity",
+ "newCommandTimeout": 720,
+ "noReset": true,
+ "fullReset": false,
+ "app": ""
+ },
"sim.iPhone7.iOS110": {
"platformName": "iOS",
"platformVersion": "11.2",
diff --git a/e2e/modal-navigation/app/app.android.css b/e2e/modal-navigation/app/app.android.css
new file mode 100644
index 000000000..5151a975a
--- /dev/null
+++ b/e2e/modal-navigation/app/app.android.css
@@ -0,0 +1,19 @@
+#home-page {
+ font-size: 8;
+ margin: 0px;
+ padding: 0px;
+}
+
+#action-bar-home-page{
+ font-size: 10;
+ margin: 0px;
+ padding: 0px;
+}
+
+#home-page Button {
+ margin-bottom: 5px;
+ border-color: gray;
+ border-width: 2px;
+ border-radius: 8px;
+ padding: 0px;
+}
\ No newline at end of file
diff --git a/e2e/modal-navigation/app/app.css b/e2e/modal-navigation/app/app.css
index ff57461c5..e69de29bb 100644
--- a/e2e/modal-navigation/app/app.css
+++ b/e2e/modal-navigation/app/app.css
@@ -1,13 +0,0 @@
-/*
-In NativeScript, the app.css file is where you place CSS rules that
-you would like to apply to your entire application. Check out
-http://docs.nativescript.org/ui/styling for a full list of the CSS
-selectors and properties you can use to style UI components.
-
-/*
-For example, the following CSS rule changes the font size of all UI
-components that have the btn class name.
-*/
-.btn {
- font-size: 18;
-}
diff --git a/e2e/modal-navigation/app/app.ios.css b/e2e/modal-navigation/app/app.ios.css
new file mode 100644
index 000000000..d123538c3
--- /dev/null
+++ b/e2e/modal-navigation/app/app.ios.css
@@ -0,0 +1,14 @@
+
+#home-page {
+ font-size: 13;
+ margin: 0px;
+ padding: 0px;
+}
+
+#home-page Button {
+ margin-bottom: 20px;
+ padding: 20px;
+ border-color: gray;
+ border-width: 2px;
+ border-radius: 8px;
+}
\ No newline at end of file
diff --git a/e2e/modal-navigation/app/home/home-page.xml b/e2e/modal-navigation/app/home/home-page.xml
index 9a85f1f33..67a6197eb 100644
--- a/e2e/modal-navigation/app/home/home-page.xml
+++ b/e2e/modal-navigation/app/home/home-page.xml
@@ -1,24 +1,28 @@
-
-
-
+ navigatingFrom="onNavigatingFrom"
+ navigatedTo="onNavigatedTo"
+ navigatedFrom="onNavigatedFrom">
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/e2e/modal-navigation/app/modal-no-page/modal-no-page.xml b/e2e/modal-navigation/app/modal-no-page/modal-no-page.xml
index dde7de6cb..6005c6a74 100644
--- a/e2e/modal-navigation/app/modal-no-page/modal-no-page.xml
+++ b/e2e/modal-navigation/app/modal-no-page/modal-no-page.xml
@@ -1,4 +1,4 @@
-
+
diff --git a/e2e/modal-navigation/e2e/android-back-button.e2e-spec.ts b/e2e/modal-navigation/e2e/android-back-button.e2e-spec.ts
new file mode 100644
index 000000000..e40afbe37
--- /dev/null
+++ b/e2e/modal-navigation/e2e/android-back-button.e2e-spec.ts
@@ -0,0 +1,39 @@
+import { AppiumDriver, createDriver, SearchOptions } from "nativescript-dev-appium";
+import { Screen } from "./screen"
+import { assert } from "chai";
+
+const exampleAndroidBackBtnEvents = "Android Back Btn Events";
+
+describe("android-navigate-back", () => {
+ let driver: AppiumDriver;
+ let screen: Screen;
+
+ before(async () => {
+ driver = await createDriver();
+ screen = new Screen(driver);
+ const btnShowNestedModalFrame = await driver.findElementByText(exampleAndroidBackBtnEvents);
+ await btnShowNestedModalFrame.click();
+ });
+
+ afterEach(async function () {
+ if (this.currentTest.state === "failed") {
+ await driver.logTestArtifacts(this.currentTest.title);
+ }
+ });
+
+ after(async () => {
+ await driver.resetApp();
+ });
+
+ it("should skip first navigate back", async function () {
+ if (driver.isIOS) {
+ this.skip();
+ }
+
+ await driver.navBack();
+ const textElement = await driver.findElementsByText("will cancel next back press: false", SearchOptions.contains, 10);
+ assert.isTrue(textElement !== null);
+ await driver.navBack();
+ await screen.loadedHome();
+ })
+})
\ No newline at end of file
diff --git a/e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts b/e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts
index 2c9b95206..79010a093 100644
--- a/e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts
+++ b/e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts
@@ -33,8 +33,7 @@ describe("modal-frame:", () => {
afterEach(async function () {
if (this.currentTest.state === "failed") {
- await driver.logPageSource(this.currentTest.title);
- await driver.logScreenshot(this.currentTest.title);
+ await driver.logTestArtifacts(this.currentTest.title);
await driver.resetApp();
await screen[root]();
}
diff --git a/e2e/modal-navigation/e2e/modal-layout.e2e-spec.ts b/e2e/modal-navigation/e2e/modal-layout.e2e-spec.ts
index 7145be191..189f94bd7 100644
--- a/e2e/modal-navigation/e2e/modal-layout.e2e-spec.ts
+++ b/e2e/modal-navigation/e2e/modal-layout.e2e-spec.ts
@@ -36,8 +36,7 @@ describe("modal-layout:", () => {
afterEach(async function () {
if (this.currentTest.state === "failed") {
- await driver.logPageSource(this.currentTest.title);
- await driver.logScreenshot(this.currentTest.title);
+ await driver.logTestArtifacts(this.currentTest.title);
await driver.resetApp();
await screen[root]();
}
diff --git a/e2e/modal-navigation/e2e/modal-page.e2e-spec.ts b/e2e/modal-navigation/e2e/modal-page.e2e-spec.ts
index 6ccec5546..8d891a284 100644
--- a/e2e/modal-navigation/e2e/modal-page.e2e-spec.ts
+++ b/e2e/modal-navigation/e2e/modal-page.e2e-spec.ts
@@ -35,8 +35,7 @@ describe("modal-page:", () => {
afterEach(async function () {
if (this.currentTest.state === "failed") {
- await driver.logPageSource(this.currentTest.title);
- await driver.logScreenshot(this.currentTest.title);
+ await driver.logTestArtifacts(this.currentTest.title);
await driver.resetApp();
await screen[root]();
}
diff --git a/e2e/modal-navigation/e2e/modal-tab.e2e-spec.ts b/e2e/modal-navigation/e2e/modal-tab.e2e-spec.ts
index f5a505760..8726e35ac 100644
--- a/e2e/modal-navigation/e2e/modal-tab.e2e-spec.ts
+++ b/e2e/modal-navigation/e2e/modal-tab.e2e-spec.ts
@@ -38,8 +38,7 @@ describe("modal-tab:", () => {
afterEach(async function () {
if (this.currentTest.state === "failed") {
- await driver.logPageSource(this.currentTest.title);
- await driver.logScreenshot(this.currentTest.title);
+ await driver.logTestArtifacts(this.currentTest.title);
await driver.resetApp();
await screen[root]();
}
diff --git a/e2e/modal-navigation/package.json b/e2e/modal-navigation/package.json
index 1b2392472..f2e994c31 100644
--- a/e2e/modal-navigation/package.json
+++ b/e2e/modal-navigation/package.json
@@ -23,10 +23,12 @@
"nativescript-dev-appium": "next",
"nativescript-dev-typescript": "next",
"nativescript-dev-webpack": "next",
+ "rimraf": "^2.6.2",
"typescript": "^3.0.3"
},
"scripts": {
- "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json",
- "e2e-watch": "tsc -p e2e --watch"
+ "e2e": "npm run clean-e2e && tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json",
+ "e2e-watch": "tsc -p e2e --watch",
+ "clean-e2e": "rimraf 'e2e/**/*.js' 'e2e/**/*.js.map' 'e2e/**/*.map'"
}
}