diff --git a/e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts b/e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts index 2aa94460a..2c9b95206 100644 --- a/e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts +++ b/e2e/modal-navigation/e2e/modal-frame.e2e-spec.ts @@ -6,7 +6,8 @@ import { testSecondPageBackground, testSecondPageClose, testNestedModalFrameBackground, - testNestedModalPageBackground + testNestedModalPageBackground, + testDialogBackground } from "./shared.e2e-spec" describe("modal-frame:", () => { @@ -44,6 +45,10 @@ describe("modal-frame:", () => { await screen.loadedHome(); }); + it("should show dialog confirm, run in background", async () => { + await testDialogBackground(driver, screen); + }); + it("should run modal page with frame in background", async () => { await modalFrameBackground(driver, screen); }); diff --git a/e2e/modal-navigation/e2e/modal-layout.e2e-spec.ts b/e2e/modal-navigation/e2e/modal-layout.e2e-spec.ts index e36238969..7145be191 100644 --- a/e2e/modal-navigation/e2e/modal-layout.e2e-spec.ts +++ b/e2e/modal-navigation/e2e/modal-layout.e2e-spec.ts @@ -6,7 +6,8 @@ import { testSecondPageBackground, testSecondPageClose, testNestedModalFrameBackground, - testNestedModalPageBackground + testNestedModalPageBackground, + testDialogBackground } from "./shared.e2e-spec" describe("modal-layout:", () => { @@ -47,6 +48,10 @@ describe("modal-layout:", () => { await screen.loadedHome(); }); + it("should show dialog confirm, run in background", async () => { + await testDialogBackground(driver, screen); + }); + it("should run modal layout in background", async () => { await modalFrameBackground(driver, screen); }); diff --git a/e2e/modal-navigation/e2e/modal-page.e2e-spec.ts b/e2e/modal-navigation/e2e/modal-page.e2e-spec.ts index b678319b2..6ccec5546 100644 --- a/e2e/modal-navigation/e2e/modal-page.e2e-spec.ts +++ b/e2e/modal-navigation/e2e/modal-page.e2e-spec.ts @@ -5,7 +5,8 @@ import { modalPageBackground, testSecondPageBackground, testNestedModalFrameBackground, - testNestedModalPageBackground + testNestedModalPageBackground, + testDialogBackground } from "./shared.e2e-spec" describe("modal-page:", () => { @@ -46,6 +47,10 @@ describe("modal-page:", () => { await screen.loadedHome(); }); + it("should show dialog confirm, run in background", async () => { + await testDialogBackground(driver, screen, false); + }); + it("should run modal page in background", async () => { await modalPageBackground(driver, screen, false); }); diff --git a/e2e/modal-navigation/e2e/modal-tab.e2e-spec.ts b/e2e/modal-navigation/e2e/modal-tab.e2e-spec.ts index 9a7cb224b..f5a505760 100644 --- a/e2e/modal-navigation/e2e/modal-tab.e2e-spec.ts +++ b/e2e/modal-navigation/e2e/modal-tab.e2e-spec.ts @@ -8,7 +8,8 @@ import { testSecondPageClose, testNestedModalFrameBackground, testNestedModalPageBackground, - testSecondItemBackground + testSecondItemBackground, + testDialogBackground } from "./shared.e2e-spec" describe("modal-tab:", () => { @@ -49,6 +50,10 @@ describe("modal-tab:", () => { await screen.loadedHome(); }); + it("should show dialog confirm, run in background", async () => { + await testDialogBackground(driver, screen); + }); + it("should run modal tab view in background", async () => { await modalTabViewBackground(driver, screen); }); diff --git a/e2e/modal-navigation/e2e/screen.ts b/e2e/modal-navigation/e2e/screen.ts index 164c0a165..d2b4bb58a 100644 --- a/e2e/modal-navigation/e2e/screen.ts +++ b/e2e/modal-navigation/e2e/screen.ts @@ -5,6 +5,7 @@ const home = "Home" const first = "First" const modal = "Modal"; const modalFirst = "Modal First"; +const dialogConfirm = "Dialog"; const modalSecond = "Modal Second"; const modalNested = "Modal Nested"; @@ -13,6 +14,7 @@ const modalPage = "Show Modal Page"; const modalLayout = "Show Modal Layout"; const modalTabView = "Show Modal TabView"; const navToSecondPage = "Navigate To Second Page"; +const showDialog = "Show Dialog"; const resetFrameRootView = "Reset Frame Root View"; const resetTabRootView = "Reset Tab Root View"; const resetLayoutRootView = "Reset Layout Root View"; @@ -20,6 +22,8 @@ const resetLayoutRootView = "Reset Layout Root View"; const showNestedModalFrame = "Show Nested Modal Page With Frame"; const showNestedModalPage = "Show Nested Modal Page"; +const confirmDialog = "Yes"; +const confirmDialogMessage = "Message"; const closeModalNested = "Close Modal Nested"; const closeModal = "Close Modal"; const goBack = "Go Back"; @@ -131,6 +135,11 @@ export class Screen { await btnNavToSecondPage.tap(); } + showDialogConfirm = async () => { + const btnShowDialogConfirm = await this._driver.findElementByText(showDialog); + await btnShowDialogConfirm.tap(); + } + navigateToFirstItem = async () => { const itemModalFirst = await this._driver.findElementByText(modalFirst); await itemModalFirst.tap(); @@ -141,6 +150,12 @@ export class Screen { await itemModalSecond.tap(); } + loadedConfirmDialog = async () => { + const lblDialogMessage = await this._driver.findElementByText(confirmDialogMessage); + assert.isTrue(await lblDialogMessage.isDisplayed()); + console.log(dialogConfirm + " shown!"); + } + loadedSecondPage = async () => { const lblModalSecond = await this._driver.findElementByText(modalSecond); assert.isTrue(await lblModalSecond.isDisplayed()); @@ -159,6 +174,11 @@ export class Screen { console.log("Second Item loaded!"); } + closeDialog = async () => { + const btnYesDialog = await this._driver.findElementByText(confirmDialog); + await btnYesDialog.tap(); + } + goBackFromSecondPage = async () => { const btnGoBackFromSecondPage = await this._driver.findElementByText(goBack); await btnGoBackFromSecondPage.tap(); diff --git a/e2e/modal-navigation/e2e/shared.e2e-spec.ts b/e2e/modal-navigation/e2e/shared.e2e-spec.ts index 84f7d5456..c1f6dd3a6 100644 --- a/e2e/modal-navigation/e2e/shared.e2e-spec.ts +++ b/e2e/modal-navigation/e2e/shared.e2e-spec.ts @@ -10,6 +10,19 @@ export async function modalFrameBackground(driver: AppiumDriver, screen: Screen) await screen.loadedModalFrame(); } +export async function testDialogBackground(driver: AppiumDriver, screen: Screen, isInFrame: boolean = true) { + await screen.showDialogConfirm(); + await screen.loadedConfirmDialog(); + + await driver.backgroundApp(time); + await screen.loadedConfirmDialog(); + + await screen.closeDialog(); + if (isInFrame) { + await screen.loadedModalFrame(); + } +} + export async function testSecondPageBackground(driver: AppiumDriver, screen: Screen) { await screen.navigateToSecondPage(); await screen.loadedSecondPage();