-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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 #1562 from joelpramos/issue-1560
Issue 1560
- Loading branch information
Showing
23 changed files
with
542 additions
and
108 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
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
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
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
10 changes: 10 additions & 0 deletions
10
karate-core/src/main/java/com/intuit/karate/driver/DriverRunner.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.intuit.karate.driver; | ||
|
||
import com.intuit.karate.core.ScenarioRuntime; | ||
|
||
import java.util.Map; | ||
|
||
@FunctionalInterface | ||
public interface DriverRunner<D extends Driver> { | ||
D start(Map<String, Object> options, ScenarioRuntime sr); | ||
} |
70 changes: 36 additions & 34 deletions
70
karate-core/src/main/java/com/intuit/karate/driver/appium/AndroidDriver.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,34 +1,36 @@ | ||
package com.intuit.karate.driver.appium; | ||
|
||
import com.intuit.karate.FileUtils; | ||
import com.intuit.karate.core.ScenarioRuntime; | ||
import java.util.Map; | ||
|
||
/** | ||
* @author babusekaran | ||
*/ | ||
public class AndroidDriver extends AppiumDriver { | ||
|
||
protected AndroidDriver(MobileDriverOptions options) { | ||
super(options); | ||
} | ||
|
||
public static AndroidDriver start(Map<String, Object> map, ScenarioRuntime sr) { | ||
MobileDriverOptions options = new MobileDriverOptions(map, sr, 4723, FileUtils.isOsWindows() ? "cmd.exe" : "appium"); | ||
// additional commands needed to start appium on windows | ||
if (FileUtils.isOsWindows()){ | ||
options.arg("/C"); | ||
options.arg("cmd.exe"); | ||
options.arg("/K"); | ||
options.arg("appium"); | ||
} | ||
options.arg("--port=" + options.port); | ||
return new AndroidDriver(options); | ||
} | ||
|
||
@Override | ||
public void activate() { | ||
super.setContext("NATIVE_APP"); | ||
} | ||
|
||
} | ||
package com.intuit.karate.driver.appium; | ||
|
||
import com.intuit.karate.FileUtils; | ||
import com.intuit.karate.core.ScenarioRuntime; | ||
import java.util.Map; | ||
|
||
/** | ||
* @author babusekaran | ||
*/ | ||
public class AndroidDriver extends AppiumDriver { | ||
|
||
public static final String DRIVER_TYPE = "android"; | ||
|
||
protected AndroidDriver(MobileDriverOptions options) { | ||
super(options); | ||
} | ||
|
||
public static AndroidDriver start(Map<String, Object> map, ScenarioRuntime sr) { | ||
MobileDriverOptions options = new MobileDriverOptions(map, sr, 4723, FileUtils.isOsWindows() ? "cmd.exe" : "appium"); | ||
// additional commands needed to start appium on windows | ||
if (FileUtils.isOsWindows()){ | ||
options.arg("/C"); | ||
options.arg("cmd.exe"); | ||
options.arg("/K"); | ||
options.arg("appium"); | ||
} | ||
options.arg("--port=" + options.port); | ||
return new AndroidDriver(options); | ||
} | ||
|
||
@Override | ||
public void activate() { | ||
super.setContext("NATIVE_APP"); | ||
} | ||
|
||
} |
54 changes: 28 additions & 26 deletions
54
karate-core/src/main/java/com/intuit/karate/driver/appium/IosDriver.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,28 @@ | ||
package com.intuit.karate.driver.appium; | ||
|
||
import com.intuit.karate.core.ScenarioRuntime; | ||
import java.util.Map; | ||
|
||
/** | ||
* @author babusekaran | ||
*/ | ||
public class IosDriver extends AppiumDriver { | ||
|
||
public IosDriver(MobileDriverOptions options) { | ||
super(options); | ||
} | ||
|
||
public static IosDriver start(Map<String, Object> map, ScenarioRuntime sr) { | ||
MobileDriverOptions options = new MobileDriverOptions(map, sr, 4723, "appium"); | ||
options.arg("--port=" + options.port); | ||
return new IosDriver(options); | ||
} | ||
|
||
@Override | ||
public void activate() { | ||
super.setContext("NATIVE_APP"); | ||
} | ||
|
||
} | ||
package com.intuit.karate.driver.appium; | ||
|
||
import com.intuit.karate.core.ScenarioRuntime; | ||
import java.util.Map; | ||
|
||
/** | ||
* @author babusekaran | ||
*/ | ||
public class IosDriver extends AppiumDriver { | ||
|
||
public static final String DRIVER_TYPE = "ios"; | ||
|
||
public IosDriver(MobileDriverOptions options) { | ||
super(options); | ||
} | ||
|
||
public static IosDriver start(Map<String, Object> map, ScenarioRuntime sr) { | ||
MobileDriverOptions options = new MobileDriverOptions(map, sr, 4723, "appium"); | ||
options.arg("--port=" + options.port); | ||
return new IosDriver(options); | ||
} | ||
|
||
@Override | ||
public void activate() { | ||
super.setContext("NATIVE_APP"); | ||
} | ||
|
||
} |
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
Oops, something went wrong.