diff --git a/.gitignore b/.gitignore index 610c9ed25..9399b9cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ ng-sample/app/**/*.js # Webpack configuration files webpack.config.js tsconfig.esm.json +tsconfig.tns.json # IDEs and editors /.idea diff --git a/e2e/config/mocha.opts b/e2e/config/mocha.opts index ea635b0dc..65bcb91f7 100644 --- a/e2e/config/mocha.opts +++ b/e2e/config/mocha.opts @@ -1,4 +1,4 @@ ---timeout 140000 +--timeout 60000 --recursive e2e --reporter mocha-multi --reporter-options spec=-,mocha-junit-reporter=test-results.xml \ No newline at end of file diff --git a/e2e/modal-navigation-ng/app/navigation/basic.navigation.component.ts b/e2e/modal-navigation-ng/app/navigation/basic.navigation.component.ts index ad0cd0031..49f7a2567 100644 --- a/e2e/modal-navigation-ng/app/navigation/basic.navigation.component.ts +++ b/e2e/modal-navigation-ng/app/navigation/basic.navigation.component.ts @@ -16,8 +16,8 @@ import { ModalViewComponent } from "~/modal-shared/modal-view.component"; + - ` }) diff --git a/e2e/modal-navigation-ng/e2e/modal.shared.e2e-spec.ts b/e2e/modal-navigation-ng/e2e/modal.shared.e2e-spec.ts index fd76f81eb..1ad368ff2 100644 --- a/e2e/modal-navigation-ng/e2e/modal.shared.e2e-spec.ts +++ b/e2e/modal-navigation-ng/e2e/modal.shared.e2e-spec.ts @@ -15,7 +15,7 @@ describe("modal-shared:", () => { }); roots.forEach(root => { - describe("Shared modal from second and back", () => { + describe("Shared modal from home component and back", () => { before(async () => { await screen[root](); @@ -46,6 +46,11 @@ describe("modal-shared:", () => { await screen.closeModal(); }); + it("should open/close shared modal with presentation style from home component", async () => { + await screen.loadSharedModalWithPresentationStyle(true); + await screen.closeModal(); + }); + it("should find home component again", async () => { await screen.loadedHome(); }); diff --git a/e2e/modal-navigation-ng/e2e/screens/screen.ts b/e2e/modal-navigation-ng/e2e/screens/screen.ts index 107d34b41..690edd0ab 100644 --- a/e2e/modal-navigation-ng/e2e/screens/screen.ts +++ b/e2e/modal-navigation-ng/e2e/screens/screen.ts @@ -1,4 +1,4 @@ -import { AppiumDriver } from "nativescript-dev-appium"; +import { AppiumDriver, SearchOptions } from "nativescript-dev-appium"; import { assert } from "chai"; const home = "Home Component" @@ -165,6 +165,11 @@ export class Screen { await btnTap.click(); } + private showSharedModalPresentationStyle = async () => { + const btnTap = await this._driver.findElementByText("popover", SearchOptions.contains); + await btnTap.click(); + } + loadedModalPage = async () => { const btnShowNestedModalPage = await this._driver.findElementByAutomationText(showNestedModalPage); assert.isTrue(await btnShowNestedModalPage.isDisplayed(), `${showNestedModalPage} is not displayed`); @@ -212,6 +217,7 @@ export class Screen { } loadedModalNoFrame = async () => { + await this._driver.wait(2000); const btnShowDialogConfirm = await this._driver.waitForElement(showDialog); const btnCloseModal = await this._driver.waitForElement(closeModal); assert.isTrue(await btnShowDialogConfirm.isDisplayed()); @@ -309,4 +315,13 @@ export class Screen { const lbl = await this._driver.waitForElement(sharedModalView, 5000); assert.isTrue(await lbl.isDisplayed()); } + + loadSharedModalWithPresentationStyle = async (loadShowModalPageWithFrame: boolean) => { + if (loadShowModalPageWithFrame) { + await this.showSharedModalPresentationStyle(); + } + + const lbl = await this._driver.waitForElement(sharedModalView, 5000); + assert.isTrue(await lbl.isDisplayed()); + } } \ No newline at end of file