@@ -19,29 +19,45 @@ describe("Single page app", () => {
1919 } ) ;
2020
2121 it ( "should load second(1) page" , async ( ) => {
22- await findAndClick ( driver , "SECOND(1)" )
22+ await findAndClick ( driver , "SECOND(1)" ) ;
2323
2424 await driver . findElementByAutomationText ( "Second Component: 1" ) ;
25-
25+
2626 // ActionBar Title and item
2727 await driver . findElementByAutomationText ( "Second Title" ) ;
2828 await driver . findElementByAutomationText ( "ACTION2" ) ;
2929 } ) ;
3030
3131 it ( "should load second(2) page" , async ( ) => {
32- await findAndClick ( driver , "SECOND(2)" )
32+ await findAndClick ( driver , "SECOND(2)" ) ;
33+
34+ await driver . findElementByAutomationText ( "Second Component: 2" ) ;
3335
34- await driver . findElementByAutomationText ( "Second Component: 1" ) ;
35-
3636 // ActionBar Title and items
3737 await driver . findElementByAutomationText ( "Second Title" ) ;
3838 await driver . findElementByAutomationText ( "ACTION2" ) ;
3939 await driver . findElementByAutomationText ( "ADD" ) ;
4040 } ) ;
41+
42+ it ( "should open and close modal view" , async ( ) => {
43+ await findAndClick ( driver , "Show Modal" ) ;
44+
45+ await driver . findElementByAutomationText ( "Welcome to modal" ) ;
46+ await findAndClick ( driver , "Close Modal" ) ;
47+
48+ await driver . findElementByAutomationText ( "Second Component: 2" ) ;
49+ } ) ;
50+
51+ it ( "should go back to second(1) and first" , async ( ) => {
52+ await findAndClick ( driver , "Back" ) ;
53+ await driver . findElementByAutomationText ( "Second Component: 1" ) ;
54+ await findAndClick ( driver , "Back" ) ;
55+ await driver . findElementByAutomationText ( "First Title" ) ;
56+ await driver . findElementByAutomationText ( "ACTION1" ) ;
57+ } ) ;
4158} ) ;
4259
4360async function findAndClick ( driver : AppiumDriver , text : string ) {
44- const navigationButton =
45- await driver . findElementByAutomationText ( text ) ;
46- navigationButton . click ( ) ;
61+ const navigationButton = await driver . findElementByAutomationText ( text ) ;
62+ await navigationButton . click ( ) ;
4763}
0 commit comments