Skip to content

Commit 03b4386

Browse files
Add-support-for-env-deviceName
1 parent 87fa9d8 commit 03b4386

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/test/java/SmartuiAppAndroid.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ public class SmartuiAppAndroid {
1616
: System.getenv("LT_ACCESS_KEY");
1717
public static String projectToken = System.getenv("PROJECT_TOKEN") == null ? "YOUR_PROJECT_TOKEN" // Add project token here
1818
: System.getenv("PROJECT_TOKEN");
19+
public static String deviceName = System.getenv("DEVICE_NAME") == null ? ".*" // This will pick a random device for you
20+
: System.getenv("DEVICE_NAME");
21+
public static String app = System.getenv("APP") == null ? "lt://proverbial-android" // Sample app
22+
: System.getenv("APP");
1923

2024

2125
public static void main(String[] args) throws Exception {
2226
DesiredCapabilities caps = new DesiredCapabilities();
2327
Map<String, Object> ltOptions = new HashMap<>();
24-
ltOptions.put("deviceName", ".*");
25-
ltOptions.put("app", "lt://proverbial-android"); // Enter your app url
28+
ltOptions.put("deviceName", deviceName);
29+
ltOptions.put("app", app); // Enter your app url
2630
ltOptions.put("isRealMobile", true);
2731
ltOptions.put("platformName", "Android");
2832
ltOptions.put("build", "Java - Android");

src/test/java/SmartuiAppIos.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ public class SmartuiAppIos {
1414
: System.getenv("LT_ACCESS_KEY");
1515
public static String projectToken = System.getenv("PROJECT_TOKEN") == null ? "YOUR_PROJECT_TOKEN" // Add project token here
1616
: System.getenv("PROJECT_TOKEN");
17+
public static String deviceName = System.getenv("DEVICE_NAME") == null ? ".*" // This will pick a random device for you
18+
: System.getenv("DEVICE_NAME");
19+
public static String app = System.getenv("APP") == null ? "lt://proverbial-ios" // Sample app
20+
: System.getenv("APP");
1721

1822

1923
public static void main(String[] args) throws Exception {
2024
DesiredCapabilities caps = new DesiredCapabilities();
2125
Map<String, Object> ltOptions = new HashMap<>();
22-
ltOptions.put("deviceName", ".*");
23-
ltOptions.put("app", "lt://proverbial-ios"); // Enter your app url
26+
ltOptions.put("deviceName", deviceName);
27+
ltOptions.put("app", app); // Enter your app url
2428
ltOptions.put("isRealMobile", true);
2529
ltOptions.put("platformName", "iOS");
2630
ltOptions.put("build", "Java - iOS");

0 commit comments

Comments
 (0)