@@ -26,22 +26,30 @@ public static class AppManager
2626 /// <summary>
2727 /// Gets the instance of the started Windows application.
2828 /// </summary>
29- public static WindowsDriver < WindowsElement > WindowsApp => WebApp as WindowsDriver < WindowsElement > ;
29+ public static WindowsDriver < WindowsElement > WindowsApp => App as WindowsDriver < WindowsElement > ;
3030
3131 /// <summary>
3232 /// Gets the instance of the started Android application.
3333 /// </summary>
34- public static AndroidDriver < AndroidElement > AndroidApp => WebApp as AndroidDriver < AndroidElement > ;
34+ public static AndroidDriver < AndroidElement > AndroidApp => App as AndroidDriver < AndroidElement > ;
3535
3636 /// <summary>
3737 /// Gets the instance of the started iOS application.
3838 /// </summary>
39- public static IOSDriver < IOSElement > IOSApp => WebApp as IOSDriver < IOSElement > ;
39+ public static IOSDriver < IOSElement > IOSApp => App as IOSDriver < IOSElement > ;
4040
4141 /// <summary>
4242 /// Get the instance of the started web application.
4343 /// </summary>
44- public static RemoteWebDriver WebApp { get ; set ; }
44+ public static RemoteWebDriver WebApp => App ;
45+
46+ /// <summary>
47+ /// Gets the instance of the started application.
48+ /// <para>
49+ /// This could be a <see cref="WindowsDriver{W}"/>, <see cref="AndroidDriver{W}"/>, <see cref="IOSDriver{W}"/>, or web driver.
50+ /// </para>
51+ /// </summary>
52+ public static RemoteWebDriver App { get ; set ; }
4553
4654 /// <summary>
4755 /// Starts the application ready for testing.
@@ -62,29 +70,29 @@ public static void StartApp(AppManagerOptions opts)
6270 {
6371 case WebAppManagerOptions webOpts :
6472 {
65- WebApp = webOpts . DriverType switch
73+ App = webOpts . DriverType switch
6674 {
6775 WebAppDriverType . Chrome => new ChromeDriver ( webOpts . DriverUri ) ,
6876 WebAppDriverType . Firefox => new FirefoxDriver ( webOpts . DriverUri ) ,
6977 WebAppDriverType . Opera => new OperaDriver ( webOpts . DriverUri ) ,
7078 WebAppDriverType . Safari => new SafariDriver ( webOpts . DriverUri ) ,
7179 WebAppDriverType . Edge => new EdgeDriver ( webOpts . DriverUri ) ,
7280 WebAppDriverType . InternetExplorer => new InternetExplorerDriver ( webOpts . DriverUri ) ,
73- _ => WebApp
81+ _ => App
7482 } ;
7583
76- VerifyAppDriver ( WebApp , webOpts ) ;
84+ VerifyAppDriver ( App , webOpts ) ;
7785
7886 if ( webOpts . Maximize )
7987 {
80- WebApp . Manage ( ) . Window . Maximize ( ) ;
88+ App . Manage ( ) . Window . Maximize ( ) ;
8189 }
8290 else
8391 {
84- WebApp . Manage ( ) . Window . Size = webOpts . DesiredSize ;
92+ App . Manage ( ) . Window . Size = webOpts . DesiredSize ;
8593 }
8694
87- WebApp . Url = webOpts . Url ;
95+ App . Url = webOpts . Url ;
8896 break ;
8997 }
9098 case WindowsAppManagerOptions winOpts :
@@ -94,22 +102,23 @@ public static void StartApp(AppManagerOptions opts)
94102 WinAppDriverHelper . Run ( ) ;
95103 }
96104
97- WebApp = new WindowsDriver < WindowsElement > (
105+ App = new WindowsDriver < WindowsElement > (
98106 new Uri ( winOpts . DriverUri ) ,
99107 winOpts . AppiumOptions ) ;
100108
101109 VerifyAppDriver ( WindowsApp , winOpts ) ;
102110
103111 if ( winOpts . Maximize )
104112 {
105- WebApp . Manage ( ) . Window . Maximize ( ) ;
113+ App . Manage ( ) . Window . Maximize ( ) ;
106114 }
115+
107116 break ;
108117 }
109118
110119 case AndroidAppManagerOptions androidOpts :
111120 {
112- WebApp = new AndroidDriver < AndroidElement > (
121+ App = new AndroidDriver < AndroidElement > (
113122 new Uri ( androidOpts . DriverUri ) ,
114123 androidOpts . AppiumOptions ) ;
115124
@@ -119,7 +128,7 @@ public static void StartApp(AppManagerOptions opts)
119128
120129 case IOSAppManagerOptions iosOpts :
121130 {
122- WebApp = new IOSDriver < IOSElement > ( new Uri ( iosOpts . DriverUri ) , iosOpts . AppiumOptions ) ;
131+ App = new IOSDriver < IOSElement > ( new Uri ( iosOpts . DriverUri ) , iosOpts . AppiumOptions ) ;
123132
124133 VerifyAppDriver ( IOSApp , iosOpts ) ;
125134 break ;
@@ -132,10 +141,10 @@ public static void StartApp(AppManagerOptions opts)
132141 /// </summary>
133142 public static void StopApp ( )
134143 {
135- if ( WebApp != null )
144+ if ( App != null )
136145 {
137- WebApp . Quit ( ) ;
138- WebApp = null ;
146+ App . Quit ( ) ;
147+ App = null ;
139148 }
140149
141150 WinAppDriverHelper . Stop ( ) ;
0 commit comments