diff --git a/src/main/java/Ellithium/core/driver/DriverFactory.java b/src/main/java/Ellithium/core/driver/DriverFactory.java index 274deb3..ee293d5 100644 --- a/src/main/java/Ellithium/core/driver/DriverFactory.java +++ b/src/main/java/Ellithium/core/driver/DriverFactory.java @@ -31,33 +31,33 @@ public class DriverFactory { private static ThreadLocal IOSDriverThread = new ThreadLocal<>(); @SuppressWarnings("unchecked") - public static T getNewDriver(LocalDriverType driverType,HeadlessMode headlessMode, PrivateMode privateMode, PageLoadStrategyMode pageLoadStrategyMode,WebSecurityMode webSecurityMode, SandboxMode sandboxMode) { + public static T getNewLocalDriver(LocalDriverType driverType,HeadlessMode headlessMode, PrivateMode privateMode, PageLoadStrategyMode pageLoadStrategyMode,WebSecurityMode webSecurityMode, SandboxMode sandboxMode) { ConfigContext.setConfig(driverType,headlessMode,pageLoadStrategyMode,privateMode,sandboxMode,webSecurityMode); webSetUp(); return (T) WebDriverThread.get(); } @SuppressWarnings("unchecked") - public static T getNewDriver(LocalDriverType driverType,HeadlessMode headlessMode, PrivateMode privateMode, PageLoadStrategyMode pageLoadStrategyMode,WebSecurityMode webSecurityMode) { - return getNewDriver(driverType,headlessMode,privateMode,pageLoadStrategyMode,webSecurityMode,SandboxMode.Sandbox); + public static T getNewLocalDriver(LocalDriverType driverType,HeadlessMode headlessMode, PrivateMode privateMode, PageLoadStrategyMode pageLoadStrategyMode,WebSecurityMode webSecurityMode) { + return getNewLocalDriver(driverType,headlessMode,privateMode,pageLoadStrategyMode,webSecurityMode,SandboxMode.Sandbox); } @SuppressWarnings("unchecked") - public static T getNewDriver(LocalDriverType driverType,HeadlessMode headlessMode, PrivateMode privateMode, PageLoadStrategyMode pageLoadStrategyMode) { - return getNewDriver(driverType,headlessMode,privateMode,pageLoadStrategyMode,WebSecurityMode.SecureMode,SandboxMode.Sandbox); + public static T getNewLocalDriver(LocalDriverType driverType,HeadlessMode headlessMode, PrivateMode privateMode, PageLoadStrategyMode pageLoadStrategyMode) { + return getNewLocalDriver(driverType,headlessMode,privateMode,pageLoadStrategyMode,WebSecurityMode.SecureMode,SandboxMode.Sandbox); } @SuppressWarnings("unchecked") - public static T getNewDriver(LocalDriverType driverType,HeadlessMode headlessMode, PrivateMode privateMode) { - return getNewDriver(driverType,headlessMode,privateMode,PageLoadStrategyMode.Normal,WebSecurityMode.SecureMode,SandboxMode.Sandbox); + public static T getNewLocalDriver(LocalDriverType driverType,HeadlessMode headlessMode, PrivateMode privateMode) { + return getNewLocalDriver(driverType,headlessMode,privateMode,PageLoadStrategyMode.Normal,WebSecurityMode.SecureMode,SandboxMode.Sandbox); } @SuppressWarnings("unchecked") - public static T getNewDriver(LocalDriverType driverType,HeadlessMode headlessMode) { - return getNewDriver(driverType,headlessMode,PrivateMode.True,PageLoadStrategyMode.Normal,WebSecurityMode.SecureMode,SandboxMode.Sandbox); + public static T getNewLocalDriver(LocalDriverType driverType,HeadlessMode headlessMode) { + return getNewLocalDriver(driverType,headlessMode,PrivateMode.True,PageLoadStrategyMode.Normal,WebSecurityMode.SecureMode,SandboxMode.Sandbox); } @SuppressWarnings("unchecked") - public static T getNewDriver(LocalDriverType driverType) { - return getNewDriver(driverType,HeadlessMode.False,PrivateMode.True,PageLoadStrategyMode.Normal,WebSecurityMode.SecureMode,SandboxMode.Sandbox); + public static T getNewLocalDriver(LocalDriverType driverType) { + return getNewLocalDriver(driverType,HeadlessMode.False,PrivateMode.True,PageLoadStrategyMode.Normal,WebSecurityMode.SecureMode,SandboxMode.Sandbox); } @SuppressWarnings("unchecked") - public static T getNewDriver(MobileDriverType driverType, URL remoteAddress, Capabilities capabilities) { + public static T getNewMobileDriver(MobileDriverType driverType, URL remoteAddress, Capabilities capabilities) { ConfigContext.setDriverType(driverType); ConfigContext.setRemoteAddress(remoteAddress); ConfigContext.setCapabilities(capabilities); @@ -90,7 +90,7 @@ public static T getNewDriver(MobileDriverType driverTyp // Remote web Driver Section @SuppressWarnings("unchecked") - public static T getNewDriver(RemoteDriverType driverType, URL remoteAddress, Capabilities capabilities, HeadlessMode headlessMode, PrivateMode privateMode, PageLoadStrategyMode pageLoadStrategyMode, WebSecurityMode webSecurityMode, SandboxMode sandboxMode) { + public static T getNewRemoteDriver(RemoteDriverType driverType, URL remoteAddress, Capabilities capabilities, HeadlessMode headlessMode, PrivateMode privateMode, PageLoadStrategyMode pageLoadStrategyMode, WebSecurityMode webSecurityMode, SandboxMode sandboxMode) { ConfigContext.setConfig(driverType,headlessMode,pageLoadStrategyMode,privateMode,sandboxMode,webSecurityMode); ConfigContext.setCapabilities(capabilities); ConfigContext.setRemoteAddress(remoteAddress); @@ -98,24 +98,24 @@ public static T getNewDriver(RemoteDriverType driver return (T)RemoteWebDriverThreadLocal.get(); } @SuppressWarnings("unchecked") - public static T getNewDriver(RemoteDriverType driverType, URL remoteAddress, Capabilities capabilities, HeadlessMode headlessMode, PrivateMode privateMode, PageLoadStrategyMode pageLoadStrategyMode, WebSecurityMode webSecurityMode) { - return getNewDriver(driverType,remoteAddress,capabilities,headlessMode,privateMode,pageLoadStrategyMode,webSecurityMode,SandboxMode.Sandbox); + public static T getNewRemoteDriver(RemoteDriverType driverType, URL remoteAddress, Capabilities capabilities, HeadlessMode headlessMode, PrivateMode privateMode, PageLoadStrategyMode pageLoadStrategyMode, WebSecurityMode webSecurityMode) { + return getNewRemoteDriver(driverType,remoteAddress,capabilities,headlessMode,privateMode,pageLoadStrategyMode,webSecurityMode,SandboxMode.Sandbox); } @SuppressWarnings("unchecked") - public static T getNewDriver(RemoteDriverType driverType, URL remoteAddress, Capabilities capabilities, HeadlessMode headlessMode, PrivateMode privateMode, PageLoadStrategyMode pageLoadStrategyMode) { - return getNewDriver(driverType,remoteAddress,capabilities,headlessMode,privateMode,pageLoadStrategyMode,WebSecurityMode.SecureMode,SandboxMode.Sandbox); + public static T getNewRemoteDriver(RemoteDriverType driverType, URL remoteAddress, Capabilities capabilities, HeadlessMode headlessMode, PrivateMode privateMode, PageLoadStrategyMode pageLoadStrategyMode) { + return getNewRemoteDriver(driverType,remoteAddress,capabilities,headlessMode,privateMode,pageLoadStrategyMode,WebSecurityMode.SecureMode,SandboxMode.Sandbox); } @SuppressWarnings("unchecked") - public static T getNewDriver(RemoteDriverType driverType, URL remoteAddress, Capabilities capabilities, HeadlessMode headlessMode, PrivateMode privateMode) { - return getNewDriver(driverType,remoteAddress,capabilities,headlessMode,privateMode,PageLoadStrategyMode.Normal,WebSecurityMode.SecureMode,SandboxMode.Sandbox); + public static T getNewRemoteDriver(RemoteDriverType driverType, URL remoteAddress, Capabilities capabilities, HeadlessMode headlessMode, PrivateMode privateMode) { + return getNewRemoteDriver(driverType,remoteAddress,capabilities,headlessMode,privateMode,PageLoadStrategyMode.Normal,WebSecurityMode.SecureMode,SandboxMode.Sandbox); } @SuppressWarnings("unchecked") - public static T getNewDriver(RemoteDriverType driverType, URL remoteAddress, Capabilities capabilities, HeadlessMode headlessMode) { - return getNewDriver(driverType,remoteAddress,capabilities,headlessMode,PrivateMode.True,PageLoadStrategyMode.Normal,WebSecurityMode.SecureMode,SandboxMode.Sandbox); + public static T getNgetNewRemoteDriverewDriver(RemoteDriverType driverType, URL remoteAddress, Capabilities capabilities, HeadlessMode headlessMode) { + return getNewRemoteDriver(driverType,remoteAddress,capabilities,headlessMode,PrivateMode.True,PageLoadStrategyMode.Normal,WebSecurityMode.SecureMode,SandboxMode.Sandbox); } @SuppressWarnings("unchecked") - public static T getNewDriver(RemoteDriverType driverType, URL remoteAddress, Capabilities capabilities) { - return getNewDriver(driverType,remoteAddress,capabilities,HeadlessMode.False,PrivateMode.True,PageLoadStrategyMode.Normal,WebSecurityMode.SecureMode,SandboxMode.Sandbox); + public static T getNewRemoteDriver(RemoteDriverType driverType, URL remoteAddress, Capabilities capabilities) { + return getNewRemoteDriver(driverType,remoteAddress,capabilities,HeadlessMode.False,PrivateMode.True,PageLoadStrategyMode.Normal,WebSecurityMode.SecureMode,SandboxMode.Sandbox); } @SuppressWarnings("unchecked") public static T getCurrentDriver() { diff --git a/src/test/java/Base/AppiumBase.java b/src/test/java/Base/AppiumBase.java deleted file mode 100644 index 78eb5d3..0000000 --- a/src/test/java/Base/AppiumBase.java +++ /dev/null @@ -1,30 +0,0 @@ -package Base; - -import Ellithium.Utilities.interactions.DriverActions; -import Ellithium.core.base.NonBDDSetup; -import io.appium.java_client.android.AndroidDriver; -import io.appium.java_client.service.local.AppiumDriverLocalService; -import io.appium.java_client.service.local.AppiumServiceBuilder; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; - -import java.io.File; - -public class AppiumBase extends NonBDDSetup { - protected AndroidDriver androidDriver; - protected AppiumDriverLocalService serviceBuilder; - protected DriverActions driverActions; - @BeforeClass - public void setup() { - String appiumMainJsPath=System.getProperty("user.home").concat("\\AppData\\Roaming\\npm\\node_modules\\appium\\build\\lib\\main.js"); - serviceBuilder=new AppiumServiceBuilder(). - withAppiumJS(new File(appiumMainJsPath)).withIPAddress("0.0.0.0").usingPort(4723).build(); - //serviceBuilder.start(); - } - @AfterClass - public void tareDown(){ - androidDriver.quit(); - serviceBuilder.stop(); - serviceBuilder.close(); - } -} diff --git a/src/test/java/Base/BaseRemote.java b/src/test/java/Base/BaseRemote.java index 3729621..7225d7a 100644 --- a/src/test/java/Base/BaseRemote.java +++ b/src/test/java/Base/BaseRemote.java @@ -20,7 +20,7 @@ public class BaseRemote { @BeforeClass public void Setup() throws MalformedURLException { DesiredCapabilities capabilities=new DesiredCapabilities(); - driver= DriverFactory.getNewDriver(RemoteDriverType.REMOTE_Chrome ,new URL("http://localhost:4444/wd/hub"),capabilities); + driver= DriverFactory.getNewRemoteDriver(RemoteDriverType.REMOTE_Chrome ,new URL("http://localhost:4444/wd/hub"),capabilities); home=new HomPage(driver); } @AfterClass diff --git a/src/test/java/Base/BaseStepDefinitions.java b/src/test/java/Base/BaseStepDefinitions.java index 110d9e9..315f79a 100644 --- a/src/test/java/Base/BaseStepDefinitions.java +++ b/src/test/java/Base/BaseStepDefinitions.java @@ -5,6 +5,6 @@ public class BaseStepDefinitions { protected WebDriver driver; public BaseStepDefinitions(){ - driver= DriverFactory.getNewDriver(LocalDriverType.Chrome, HeadlessMode.False, PrivateMode.True); + driver= DriverFactory.getNewLocalDriver(LocalDriverType.Chrome, HeadlessMode.False, PrivateMode.True); } } \ No newline at end of file diff --git a/src/test/java/Base/BaseTests.java b/src/test/java/Base/BaseTests.java index 2705653..bee4d5a 100644 --- a/src/test/java/Base/BaseTests.java +++ b/src/test/java/Base/BaseTests.java @@ -11,7 +11,7 @@ public class BaseTests extends NonBDDSetup { protected HomPage home; @BeforeClass public void Setup(){ - driver= DriverFactory.getNewDriver(LocalDriverType.Chrome, HeadlessMode.False, PrivateMode.True, PageLoadStrategyMode.Normal,WebSecurityMode.SecureMode,SandboxMode.Sandbox); + driver= DriverFactory.getNewLocalDriver(LocalDriverType.Chrome, HeadlessMode.False, PrivateMode.True, PageLoadStrategyMode.Normal,WebSecurityMode.SecureMode,SandboxMode.Sandbox); home=new HomPage(driver); } @AfterClass