| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0b9d4ae commit 0c3ecbc
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,8 @@ import { | |||
| 6 | 6 | testSecondPageBackground, | |
| 7 | 7 | testSecondPageClose, | |
| 8 | 8 | testNestedModalFrameBackground, | |
| 9 | - testNestedModalPageBackground | ||
| 9 | + testNestedModalPageBackground, | ||
| 10 | + testDialogBackground | ||
| 10 | 11 | } from "./shared.e2e-spec" | |
| 11 | 12 | ||
| 12 | 13 | describe("modal-frame:", () => { | |
@@ -44,6 +45,10 @@ describe("modal-frame:", () => { | |||
| 44 | 45 | await screen.loadedHome(); | |
| 45 | 46 | }); | |
| 46 | 47 | ||
| 48 | + it("should show dialog confirm, run in background", async () => { | ||
| 49 | + await testDialogBackground(driver, screen); | ||
| 50 | + }); | ||
| 51 | + | ||
| 47 | 52 | it("should run modal page with frame in background", async () => { | |
| 48 | 53 | await modalFrameBackground(driver, screen); | |
| 49 | 54 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,7 +6,8 @@ import { | |||
| 6 | 6 | testSecondPageBackground, | |
| 7 | 7 | testSecondPageClose, | |
| 8 | 8 | testNestedModalFrameBackground, | |
| 9 | - testNestedModalPageBackground | ||
| 9 | + testNestedModalPageBackground, | ||
| 10 | + testDialogBackground | ||
| 10 | 11 | } from "./shared.e2e-spec" | |
| 11 | 12 | ||
| 12 | 13 | describe("modal-layout:", () => { | |
@@ -47,6 +48,10 @@ describe("modal-layout:", () => { | |||
| 47 | 48 | await screen.loadedHome(); | |
| 48 | 49 | }); | |
| 49 | 50 | ||
| 51 | + it("should show dialog confirm, run in background", async () => { | ||
| 52 | + await testDialogBackground(driver, screen); | ||
| 53 | + }); | ||
| 54 | + | ||
| 50 | 55 | it("should run modal layout in background", async () => { | |
| 51 | 56 | await modalFrameBackground(driver, screen); | |
| 52 | 57 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,8 @@ import { | |||
| 5 | 5 | modalPageBackground, | |
| 6 | 6 | testSecondPageBackground, | |
| 7 | 7 | testNestedModalFrameBackground, | |
| 8 | - testNestedModalPageBackground | ||
| 8 | + testNestedModalPageBackground, | ||
| 9 | + testDialogBackground | ||
| 9 | 10 | } from "./shared.e2e-spec" | |
| 10 | 11 | ||
| 11 | 12 | describe("modal-page:", () => { | |
@@ -46,6 +47,10 @@ describe("modal-page:", () => { | |||
| 46 | 47 | await screen.loadedHome(); | |
| 47 | 48 | }); | |
| 48 | 49 | ||
| 50 | + it("should show dialog confirm, run in background", async () => { | ||
| 51 | + await testDialogBackground(driver, screen, false); | ||
| 52 | + }); | ||
| 53 | + | ||
| 49 | 54 | it("should run modal page in background", async () => { | |
| 50 | 55 | await modalPageBackground(driver, screen, false); | |
| 51 | 56 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,8 @@ import { | |||
| 8 | 8 | testSecondPageClose, | |
| 9 | 9 | testNestedModalFrameBackground, | |
| 10 | 10 | testNestedModalPageBackground, | |
| 11 | - testSecondItemBackground | ||
| 11 | + testSecondItemBackground, | ||
| 12 | + testDialogBackground | ||
| 12 | 13 | } from "./shared.e2e-spec" | |
| 13 | 14 | ||
| 14 | 15 | describe("modal-tab:", () => { | |
@@ -49,6 +50,10 @@ describe("modal-tab:", () => { | |||
| 49 | 50 | await screen.loadedHome(); | |
| 50 | 51 | }); | |
| 51 | 52 | ||
| 53 | + it("should show dialog confirm, run in background", async () => { | ||
| 54 | + await testDialogBackground(driver, screen); | ||
| 55 | + }); | ||
| 56 | + | ||
| 52 | 57 | it("should run modal tab view in background", async () => { | |
| 53 | 58 | await modalTabViewBackground(driver, screen); | |
| 54 | 59 | }); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,7 @@ const home = "Home" | |||
| 5 | 5 | const first = "First" | |
| 6 | 6 | const modal = "Modal"; | |
| 7 | 7 | const modalFirst = "Modal First"; | |
| 8 | + const dialogConfirm = "Dialog"; | ||
| 8 | 9 | const modalSecond = "Modal Second"; | |
| 9 | 10 | const modalNested = "Modal Nested"; | |
| 10 | 11 | ||
@@ -13,13 +14,16 @@ const modalPage = "Show Modal Page"; | |||
| 13 | 14 | const modalLayout = "Show Modal Layout"; | |
| 14 | 15 | const modalTabView = "Show Modal TabView"; | |
| 15 | 16 | const navToSecondPage = "Navigate To Second Page"; | |
| 17 | + const showDialog = "Show Dialog"; | ||
| 16 | 18 | const resetFrameRootView = "Reset Frame Root View"; | |
| 17 | 19 | const resetTabRootView = "Reset Tab Root View"; | |
| 18 | 20 | const resetLayoutRootView = "Reset Layout Root View"; | |
| 19 | 21 | ||
| 20 | 22 | const showNestedModalFrame = "Show Nested Modal Page With Frame"; | |
| 21 | 23 | const showNestedModalPage = "Show Nested Modal Page"; | |
| 22 | 24 | ||
| 25 | + const confirmDialog = "Yes"; | ||
| 26 | + const confirmDialogMessage = "Message"; | ||
| 23 | 27 | const closeModalNested = "Close Modal Nested"; | |
| 24 | 28 | const closeModal = "Close Modal"; | |
| 25 | 29 | const goBack = "Go Back"; | |
@@ -131,6 +135,11 @@ export class Screen { | |||
| 131 | 135 | await btnNavToSecondPage.tap(); | |
| 132 | 136 | } | |
| 133 | 137 | ||
| 138 | + showDialogConfirm = async () => { | ||
| 139 | + const btnShowDialogConfirm = await this._driver.findElementByText(showDialog); | ||
| 140 | + await btnShowDialogConfirm.tap(); | ||
| 141 | + } | ||
| 142 | + | ||
| 134 | 143 | navigateToFirstItem = async () => { | |
| 135 | 144 | const itemModalFirst = await this._driver.findElementByText(modalFirst); | |
| 136 | 145 | await itemModalFirst.tap(); | |
@@ -141,6 +150,12 @@ export class Screen { | |||
| 141 | 150 | await itemModalSecond.tap(); | |
| 142 | 151 | } | |
| 143 | 152 | ||
| 153 | + loadedConfirmDialog = async () => { | ||
| 154 | + const lblDialogMessage = await this._driver.findElementByText(confirmDialogMessage); | ||
| 155 | + assert.isTrue(await lblDialogMessage.isDisplayed()); | ||
| 156 | + console.log(dialogConfirm + " shown!"); | ||
| 157 | + } | ||
| 158 | + | ||
| 144 | 159 | loadedSecondPage = async () => { | |
| 145 | 160 | const lblModalSecond = await this._driver.findElementByText(modalSecond); | |
| 146 | 161 | assert.isTrue(await lblModalSecond.isDisplayed()); | |
@@ -159,6 +174,11 @@ export class Screen { | |||
| 159 | 174 | console.log("Second Item loaded!"); | |
| 160 | 175 | } | |
| 161 | 176 | ||
| 177 | + closeDialog = async () => { | ||
| 178 | + const btnYesDialog = await this._driver.findElementByText(confirmDialog); | ||
| 179 | + await btnYesDialog.tap(); | ||
| 180 | + } | ||
| 181 | + | ||
| 162 | 182 | goBackFromSecondPage = async () => { | |
| 163 | 183 | const btnGoBackFromSecondPage = await this._driver.findElementByText(goBack); | |
| 164 | 184 | await btnGoBackFromSecondPage.tap(); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,6 +10,19 @@ export async function modalFrameBackground(driver: AppiumDriver, screen: Screen) | |||
| 10 | 10 | await screen.loadedModalFrame(); | |
| 11 | 11 | } | |
| 12 | 12 | ||
| 13 | + export async function testDialogBackground(driver: AppiumDriver, screen: Screen, isInFrame: boolean = true) { | ||
| 14 | + await screen.showDialogConfirm(); | ||
| 15 | + await screen.loadedConfirmDialog(); | ||
| 16 | + | ||
| 17 | + await driver.backgroundApp(time); | ||
| 18 | + await screen.loadedConfirmDialog(); | ||
| 19 | + | ||
| 20 | + await screen.closeDialog(); | ||
| 21 | + if (isInFrame) { | ||
| 22 | + await screen.loadedModalFrame(); | ||
| 23 | + } | ||
| 24 | + } | ||
| 25 | + | ||
| 13 | 26 | export async function testSecondPageBackground(driver: AppiumDriver, screen: Screen) { | |
| 14 | 27 | await screen.navigateToSecondPage(); | |
| 15 | 28 | await screen.loadedSecondPage(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments