@@ -19,29 +19,45 @@ describe("Single page app", () => {
19
19
} ) ;
20
20
21
21
it ( "should load second(1) page" , async ( ) => {
22
- await findAndClick ( driver , "SECOND(1)" )
22
+ await findAndClick ( driver , "SECOND(1)" ) ;
23
23
24
24
await driver . findElementByAutomationText ( "Second Component: 1" ) ;
25
-
25
+
26
26
// ActionBar Title and item
27
27
await driver . findElementByAutomationText ( "Second Title" ) ;
28
28
await driver . findElementByAutomationText ( "ACTION2" ) ;
29
29
} ) ;
30
30
31
31
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" ) ;
33
35
34
- await driver . findElementByAutomationText ( "Second Component: 1" ) ;
35
-
36
36
// ActionBar Title and items
37
37
await driver . findElementByAutomationText ( "Second Title" ) ;
38
38
await driver . findElementByAutomationText ( "ACTION2" ) ;
39
39
await driver . findElementByAutomationText ( "ADD" ) ;
40
40
} ) ;
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
+ } ) ;
41
58
} ) ;
42
59
43
60
async 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 ( ) ;
47
63
}
0 commit comments