@@ -5,6 +5,7 @@ const home = "Home"
55const first = "First"
66const modal = "Modal" ;
77const modalFirst = "Modal First" ;
8+ const dialogConfirm = "Dialog" ;
89const modalSecond = "Modal Second" ;
910const modalNested = "Modal Nested" ;
1011
@@ -13,13 +14,16 @@ const modalPage = "Show Modal Page";
1314const modalLayout = "Show Modal Layout" ;
1415const modalTabView = "Show Modal TabView" ;
1516const navToSecondPage = "Navigate To Second Page" ;
17+ const showDialog = "Show Dialog" ;
1618const resetFrameRootView = "Reset Frame Root View" ;
1719const resetTabRootView = "Reset Tab Root View" ;
1820const resetLayoutRootView = "Reset Layout Root View" ;
1921
2022const showNestedModalFrame = "Show Nested Modal Page With Frame" ;
2123const showNestedModalPage = "Show Nested Modal Page" ;
2224
25+ const confirmDialog = "Yes" ;
26+ const confirmDialogMessage = "Message" ;
2327const closeModalNested = "Close Modal Nested" ;
2428const closeModal = "Close Modal" ;
2529const goBack = "Go Back" ;
@@ -131,6 +135,11 @@ export class Screen {
131135 await btnNavToSecondPage . tap ( ) ;
132136 }
133137
138+ showDialogConfirm = async ( ) => {
139+ const btnShowDialogConfirm = await this . _driver . findElementByText ( showDialog ) ;
140+ await btnShowDialogConfirm . tap ( ) ;
141+ }
142+
134143 navigateToFirstItem = async ( ) => {
135144 const itemModalFirst = await this . _driver . findElementByText ( modalFirst ) ;
136145 await itemModalFirst . tap ( ) ;
@@ -141,6 +150,12 @@ export class Screen {
141150 await itemModalSecond . tap ( ) ;
142151 }
143152
153+ loadedConfirmDialog = async ( ) => {
154+ const lblDialogMessage = await this . _driver . findElementByText ( confirmDialogMessage ) ;
155+ assert . isTrue ( await lblDialogMessage . isDisplayed ( ) ) ;
156+ console . log ( dialogConfirm + " shown!" ) ;
157+ }
158+
144159 loadedSecondPage = async ( ) => {
145160 const lblModalSecond = await this . _driver . findElementByText ( modalSecond ) ;
146161 assert . isTrue ( await lblModalSecond . isDisplayed ( ) ) ;
@@ -159,6 +174,11 @@ export class Screen {
159174 console . log ( "Second Item loaded!" ) ;
160175 }
161176
177+ closeDialog = async ( ) => {
178+ const btnYesDialog = await this . _driver . findElementByText ( confirmDialog ) ;
179+ await btnYesDialog . tap ( ) ;
180+ }
181+
162182 goBackFromSecondPage = async ( ) => {
163183 const btnGoBackFromSecondPage = await this . _driver . findElementByText ( goBack ) ;
164184 await btnGoBackFromSecondPage . tap ( ) ;
0 commit comments