-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from testvagrant/java_client_selenium_new_fixes
Java client selenium new fixes
- Loading branch information
Showing
5 changed files
with
44 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 12 additions & 13 deletions
25
src/main/java/com/testvagrant/ekam/drivers/mobile/MobileDriverManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
package com.testvagrant.ekam.drivers.mobile; | ||
|
||
import io.appium.java_client.AppiumDriver; | ||
import io.appium.java_client.MobileElement; | ||
import io.appium.java_client.android.AndroidDriver; | ||
import io.appium.java_client.ios.IOSDriver; | ||
import org.openqa.selenium.Platform; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.remote.DesiredCapabilities; | ||
|
||
import java.net.URL; | ||
|
||
public class MobileDriverManager { | ||
private final DesiredCapabilities desiredCapabilities; | ||
private final URL url; | ||
private final DesiredCapabilities desiredCapabilities; | ||
private final URL url; | ||
|
||
public MobileDriverManager(URL url, DesiredCapabilities desiredCapabilities) { | ||
this.url = url; | ||
this.desiredCapabilities = desiredCapabilities; | ||
} | ||
public MobileDriverManager(URL url, DesiredCapabilities desiredCapabilities) { | ||
this.url = url; | ||
this.desiredCapabilities = desiredCapabilities; | ||
} | ||
|
||
public AppiumDriver<MobileElement> createDriver() { | ||
return desiredCapabilities.getPlatform() == Platform.IOS | ||
? new IOSDriver<>(url, desiredCapabilities) | ||
: new AndroidDriver<>(url, desiredCapabilities); | ||
} | ||
public WebDriver createDriver() { | ||
return desiredCapabilities.getPlatformName() == Platform.IOS | ||
? new IOSDriver(url, desiredCapabilities) | ||
: new AndroidDriver(url, desiredCapabilities); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters