@@ -5,131 +5,130 @@ public class EnvironmentFactory {
55 private static String BROWSER ;
66
77 public static boolean isMobile () {
8- String IS_MOBILE = System .getenv (" IS_MOBILE" ) != null ? System .getenv (" IS_MOBILE" ) : System .getProperty (" IS_MOBILE" );
8+ String IS_MOBILE = System .getenv (EnvironmentConstants . IS_MOBILE ) != null ? System .getenv (EnvironmentConstants . IS_MOBILE ) : System .getProperty (EnvironmentConstants . IS_MOBILE );
99 return IS_MOBILE != null && IS_MOBILE .toUpperCase ().equals ("TRUE" );
1010 }
1111
1212 public static boolean isLocal () {
13- String IS_LOCAL = System .getenv (" IS_LOCAL" ) != null ? System .getenv (" IS_LOCAL" ) : System .getProperty (" IS_LOCAL" );
13+ String IS_LOCAL = System .getenv (EnvironmentConstants . IS_LOCAL ) != null ? System .getenv (EnvironmentConstants . IS_LOCAL ) : System .getProperty (EnvironmentConstants . IS_LOCAL );
1414 return IS_LOCAL != null && IS_LOCAL .toUpperCase ().equals ("TRUE" );
1515 }
1616
1717 public static boolean isRemote () {
18- String IS_REMOTE = System .getenv (" IS_REMOTE" ) != null ? System .getenv (" IS_REMOTE" ) : System .getProperty (" IS_REMOTE" );
18+ String IS_REMOTE = System .getenv (EnvironmentConstants . IS_REMOTE ) != null ? System .getenv (EnvironmentConstants . IS_REMOTE ) : System .getProperty (EnvironmentConstants . IS_REMOTE );
1919 return IS_REMOTE != null && IS_REMOTE .toUpperCase ().equals ("TRUE" );
2020 }
2121
2222 public static boolean isHeadless () {
23-
24- String IS_HEADLESS = System .getenv ("IS_HEADLESS" ) != null ? System .getenv ("IS_HEADLESS" ) : System .getProperty ("IS_HEADLESS" );
23+ String IS_HEADLESS = System .getenv (EnvironmentConstants .IS_HEADLESS ) != null ? System .getenv (EnvironmentConstants .IS_HEADLESS ) : System .getProperty (EnvironmentConstants .IS_HEADLESS );
2524 return IS_HEADLESS != null && IS_HEADLESS .toUpperCase ().equals ("TRUE" );
2625 }
2726
2827 public static boolean isSauce () {
29- String IS_SAUCE = System .getenv (" IS_SAUCE" ) != null ? System .getenv (" IS_SAUCE" ) : System .getProperty (" IS_SAUCE" );
28+ String IS_SAUCE = System .getenv (EnvironmentConstants . IS_SAUCE ) != null ? System .getenv (EnvironmentConstants . IS_SAUCE ) : System .getProperty (EnvironmentConstants . IS_SAUCE );
3029 return IS_SAUCE != null && IS_SAUCE .toUpperCase ().equals ("TRUE" );
3130 }
3231
3332 public static boolean isFirefox () {
34- BROWSER = System .getenv (" BROWSER" ) != null ? System .getenv (" BROWSER" ) : System .getProperty (" BROWSER" );
33+ BROWSER = System .getenv (EnvironmentConstants . BROWSER ) != null ? System .getenv (EnvironmentConstants . BROWSER ) : System .getProperty (EnvironmentConstants . BROWSER );
3534 return BROWSER != null && BROWSER .toUpperCase ().equals ("FIREFOX" );
3635 }
3736
3837 public static boolean isChrome () {
39- BROWSER = System .getenv (" BROWSER" ) != null ? System .getenv (" BROWSER" ) : System .getProperty (" BROWSER" );
38+ BROWSER = System .getenv (EnvironmentConstants . BROWSER ) != null ? System .getenv (EnvironmentConstants . BROWSER ) : System .getProperty (EnvironmentConstants . BROWSER );
4039 return BROWSER != null && BROWSER .toUpperCase ().equals ("CHROME" );
4140 }
4241
4342 public static boolean isSafari () {
44- BROWSER = System .getenv (" BROWSER" ) != null ? System .getenv (" BROWSER" ) : System .getProperty (" BROWSER" );
43+ BROWSER = System .getenv (EnvironmentConstants . BROWSER ) != null ? System .getenv (EnvironmentConstants . BROWSER ) : System .getProperty (EnvironmentConstants . BROWSER );
4544 return BROWSER != null && BROWSER .toUpperCase ().equals ("SAFARI" );
4645 }
4746
4847 public static boolean isInternetExplorer () {
49- BROWSER = System .getenv (" BROWSER" ) != null ? System .getenv (" BROWSER" ) : System .getProperty (" BROWSER" );
48+ BROWSER = System .getenv (EnvironmentConstants . BROWSER ) != null ? System .getenv (EnvironmentConstants . BROWSER ) : System .getProperty (EnvironmentConstants . BROWSER );
5049 return BROWSER != null && BROWSER .toUpperCase ().equals ("IE" );
5150 }
5251
5352 public static boolean isAndroid () {
54- String PLATFORM = System .getenv (" PLATFORM" ) != null ? System .getenv (" PLATFORM" ) : System .getProperty (" PLATFORM" );
53+ String PLATFORM = System .getenv (EnvironmentConstants . PLATFORM ) != null ? System .getenv (EnvironmentConstants . PLATFORM ) : System .getProperty (EnvironmentConstants . PLATFORM );
5554 return PLATFORM != null && PLATFORM .toUpperCase ().equals ("ANDROID" );
5655 }
5756
5857 public static boolean isIOS () {
59- String PLATFORM = System .getenv (" PLATFORM" ) != null ? System .getenv (" PLATFORM" ) : System .getProperty (" PLATFORM" );
58+ String PLATFORM = System .getenv (EnvironmentConstants . PLATFORM ) != null ? System .getenv (EnvironmentConstants . PLATFORM ) : System .getProperty (EnvironmentConstants . PLATFORM );
6059 return PLATFORM != null && PLATFORM .toUpperCase ().equals ("IOS" );
6160 }
6261
6362 public static String getRemoteUrlPath () {
64- return System .getenv (" EXECUTOR" ) != null ? System .getenv (" EXECUTOR" ) : System .getProperty (" EXECUTOR" );
63+ return System .getenv (EnvironmentConstants . EXECUTOR ) != null ? System .getenv (EnvironmentConstants . EXECUTOR ) : System .getProperty (EnvironmentConstants . EXECUTOR );
6564 }
6665
6766 public static String getPlatformVersion () {
68- return System .getenv (" PLATFORM_VERSION" ) != null ? System .getenv (" PLATFORM_VERSION" ) : System .getProperty (" PLATFORM_VERSION" );
67+ return System .getenv (EnvironmentConstants . PLATFORM_VERSION ) != null ? System .getenv (EnvironmentConstants . PLATFORM_VERSION ) : System .getProperty (EnvironmentConstants . PLATFORM_VERSION );
6968 }
7069
7170 public static String getPhantomJsPath () {
72- return System .getenv (" PHANTOM_JS_PATH" ) != null ? System .getenv (" PHANTOM_JS_PATH" ) : System .getProperty (" PHANTOM_JS_PATH" );
71+ return System .getenv (EnvironmentConstants . PHANTOM_JS_PATH ) != null ? System .getenv (EnvironmentConstants . PHANTOM_JS_PATH ) : System .getProperty (EnvironmentConstants . PHANTOM_JS_PATH );
7372 }
7473
7574 public static String getDevice () {
76- return System .getenv (" DEVICE" ) != null ? System .getenv (" DEVICE" ) : System .getProperty (" DEVICE" );
75+ return System .getenv (EnvironmentConstants . DEVICE ) != null ? System .getenv (EnvironmentConstants . DEVICE ) : System .getProperty (EnvironmentConstants . DEVICE );
7776 }
7877
7978 public static String getMobileDeviveEmulation () {
80- return System .getenv (" MOBILE_DEVICE_EMULATION" ) != null ? System .getenv (" MOBILE_DEVICE_EMULATION" ) : System .getProperty (" MOBILE_DEVICE_EMULATION" );
79+ return System .getenv (EnvironmentConstants . MOBILE_DEVICE_EMULATION ) != null ? System .getenv (EnvironmentConstants . MOBILE_DEVICE_EMULATION ) : System .getProperty (EnvironmentConstants . MOBILE_DEVICE_EMULATION );
8180 }
8281
8382 public static String getName () {
84- return System .getenv (" NAME" ) != null ? System .getenv (" NAME" ) : System .getProperty (" NAME" );
83+ return System .getenv (EnvironmentConstants . NAME ) != null ? System .getenv (EnvironmentConstants . NAME ) : System .getProperty (EnvironmentConstants . NAME );
8584 }
8685
8786 public static String getBrowserName () {
88- BROWSER = System .getenv (" BROWSER" ) != null ? System .getenv (" BROWSER" ) : System .getProperty (" BROWSER" );
87+ BROWSER = System .getenv (EnvironmentConstants . BROWSER ) != null ? System .getenv (EnvironmentConstants . BROWSER ) : System .getProperty (EnvironmentConstants . BROWSER );
8988 return BROWSER ;
9089 }
9190
9291 public static String getAppPackage () {
93- return System .getenv (" APP_PACKAGE" ) != null ? System .getenv (" APP_PACKAGE" ) : System .getProperty (" APP_PACKAGE" );
92+ return System .getenv (EnvironmentConstants . APP_PACKAGE ) != null ? System .getenv (EnvironmentConstants . APP_PACKAGE ) : System .getProperty (EnvironmentConstants . APP_PACKAGE );
9493 }
9594
9695 public static String getAppActivity () {
97- return System .getenv (" APP_ACTIVITY" ) != null ? System .getenv (" APP_ACTIVITY" ) : System .getProperty (" APP_ACTIVITY" );
96+ return System .getenv (EnvironmentConstants . APP_ACTIVITY ) != null ? System .getenv (EnvironmentConstants . APP_ACTIVITY ) : System .getProperty (EnvironmentConstants . APP_ACTIVITY );
9897 }
9998
10099 public static String getApp () {
101- return System .getenv (" APP" ) != null ? System .getenv (" APP" ) : System .getProperty (" APP" );
100+ return System .getenv (EnvironmentConstants . APP ) != null ? System .getenv (EnvironmentConstants . APP ) : System .getProperty (EnvironmentConstants . APP );
102101 }
103102
104103 public static String getAutomationName () {
105- return System .getenv (" AUTOMATION_NAME" ) != null ? System .getenv (" AUTOMATION_NAME" ) : System .getProperty (" AUTOMATION_NAME" );
104+ return System .getenv (EnvironmentConstants . AUTOMATION_NAME ) != null ? System .getenv (EnvironmentConstants . AUTOMATION_NAME ) : System .getProperty (EnvironmentConstants . AUTOMATION_NAME );
106105 }
107106
108107 public static String getAppiumVersion () {
109- return System .getenv (" APPIUM_VERSION" ) != null ? System .getenv (" APPIUM_VERSION" ) : System .getProperty (" APPIUM_VERSION" );
108+ return System .getenv (EnvironmentConstants . APPIUM_VERSION ) != null ? System .getenv (EnvironmentConstants . APPIUM_VERSION ) : System .getProperty (EnvironmentConstants . APPIUM_VERSION );
110109 }
111110
112111 public static String getUDIDDevice () {
113- return System .getenv (" UDID" ) != null ? System .getenv (" UDID" ) : System .getProperty (" UDID" );
112+ return System .getenv (EnvironmentConstants . UDID ) != null ? System .getenv (EnvironmentConstants . UDID ) : System .getProperty (EnvironmentConstants . UDID );
114113 }
115114
116115 public static String getMobileBrowser () {
117- return System .getenv (" MOBILE_BROWSER" ) != null ? System .getenv (" MOBILE_BROWSER" ) : System .getProperty (" MOBILE_BROWSER" );
116+ return System .getenv (EnvironmentConstants . MOBILE_BROWSER ) != null ? System .getenv (EnvironmentConstants . MOBILE_BROWSER ) : System .getProperty (EnvironmentConstants . MOBILE_BROWSER );
118117 }
119118
120119 public static String getNewCommandTimeout () {
121- return System .getenv (" NEW_COMMAND_TIMEOUT" ) != null ? System .getenv (" NEW_COMMAND_TIMEOUT" ) : System .getProperty (" NEW_COMMAND_TIMEOUT" );
120+ return System .getenv (EnvironmentConstants . NEW_COMMAND_TIMEOUT ) != null ? System .getenv (EnvironmentConstants . NEW_COMMAND_TIMEOUT ) : System .getProperty (EnvironmentConstants . NEW_COMMAND_TIMEOUT );
122121 }
123122
124123 public static String getSlDesktopPlatform () {
125- return System .getenv (" SL_DESKTOP_PLATFORM" ) != null ? System .getenv (" SL_DESKTOP_PLATFORM" ) : System .getProperty (" SL_DESKTOP_PLATFORM" );
124+ return System .getenv (EnvironmentConstants . SL_DESKTOP_PLATFORM ) != null ? System .getenv (EnvironmentConstants . SL_DESKTOP_PLATFORM ) : System .getProperty (EnvironmentConstants . SL_DESKTOP_PLATFORM );
126125 }
127126
128127 public static String getSlBrowserVersion () {
129- return System .getenv (" SL_BROWSER_VERSION" ) != null ? System .getenv (" SL_BROWSER_VERSION" ) : System .getProperty (" SL_BROWSER_VERSION" );
128+ return System .getenv (EnvironmentConstants . SL_BROWSER_VERSION ) != null ? System .getenv (EnvironmentConstants . SL_BROWSER_VERSION ) : System .getProperty (EnvironmentConstants . SL_BROWSER_VERSION );
130129 }
131130
132131 public static String getSlDesktopResolution () {
133- return System .getenv (" SL_DESKTOP_RESOLUTION" ) != null ? System .getenv (" SL_DESKTOP_RESOLUTION" ) : System .getProperty (" SL_DESKTOP_RESOLUTION" );
132+ return System .getenv (EnvironmentConstants . SL_DESKTOP_RESOLUTION ) != null ? System .getenv (EnvironmentConstants . SL_DESKTOP_RESOLUTION ) : System .getProperty (EnvironmentConstants . SL_DESKTOP_RESOLUTION );
134133 }
135134}
0 commit comments