Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.appium.java_client.android.options.UiAutomator2Options;
import io.appium.java_client.service.local.AppiumDriverLocalService;
import io.appium.java_client.service.local.AppiumServiceBuilder;
import io.appium.java_client.utils.TestUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;

Expand All @@ -45,7 +46,7 @@ public class BaseAndroidTest {
UiAutomator2Options options = new UiAutomator2Options()
.setDeviceName("Android Emulator")
.enableBiDi()
.setApp(TestResources.API_DEMOS_APK.toString())
.setApp(TestUtils.ANDROID_APIDEMOS_APK_URL)
.eventTimings();
driver = new AndroidDriver(service.getUrl(), options);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.appium.java_client.android.options.EspressoOptions;
import io.appium.java_client.service.local.AppiumDriverLocalService;
import io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException;
import io.appium.java_client.utils.TestUtils;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;

Expand All @@ -42,7 +43,7 @@ public class BaseEspressoTest {

EspressoOptions options = new EspressoOptions()
.setDeviceName("Android Emulator")
.setApp(TestResources.API_DEMOS_APK.toString())
.setApp(TestUtils.ANDROID_APIDEMOS_APK_URL)
.eventTimings();
driver = new AndroidDriver(service.getUrl(), options);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.appium.java_client.service.local;

import io.appium.java_client.android.TestResources;
import io.appium.java_client.android.options.UiAutomator2Options;
import io.appium.java_client.utils.TestUtils;
import io.github.bonigarcia.wdm.WebDriverManager;
Expand Down Expand Up @@ -148,7 +147,7 @@ void checkAbilityToStartServiceUsingCapabilities() {
.setNewCommandTimeout(Duration.ofSeconds(60))
.setAppPackage("io.appium.android.apis")
.setAppActivity(".view.WebView1")
.setApp(TestResources.API_DEMOS_APK.toString())
.setApp(TestUtils.ANDROID_APIDEMOS_APK_URL)
.setChromedriverExecutable(chromeManager.getDownloadedDriverPath());

service = new AppiumServiceBuilder().withCapabilities(options).build();
Expand All @@ -164,7 +163,7 @@ void checkAbilityToStartServiceUsingCapabilitiesAndFlags() {
.setNewCommandTimeout(Duration.ofSeconds(60))
.setAppPackage("io.appium.android.apis")
.setAppActivity(".view.WebView1")
.setApp(TestResources.API_DEMOS_APK.toString())
.setApp(TestUtils.ANDROID_APIDEMOS_APK_URL)
.setChromedriverExecutable(chromeManager.getDownloadedDriverPath())
.amend("winPath", "C:\\selenium\\app.apk")
.amend("unixPath", "/selenium/app.apk")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
package io.appium.java_client.service.local;

import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.TestResources;
import io.appium.java_client.android.options.UiAutomator2Options;
import io.appium.java_client.remote.AutomationName;
import io.appium.java_client.remote.MobilePlatform;
import io.appium.java_client.service.local.flags.GeneralServerFlag;
import io.appium.java_client.utils.TestUtils;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.Capabilities;
Expand All @@ -44,7 +44,7 @@ void startingAndroidAppWithCapabilitiesOnlyTest() {
AndroidDriver driver = new AndroidDriver(new UiAutomator2Options()
.setDeviceName("Android Emulator")
.autoGrantPermissions()
.setApp(TestResources.API_DEMOS_APK.toString()));
.setApp(TestUtils.ANDROID_APIDEMOS_APK_URL));
try {
Capabilities caps = driver.getCapabilities();

Expand All @@ -53,7 +53,7 @@ void startingAndroidAppWithCapabilitiesOnlyTest() {
);
assertEquals(AutomationName.ANDROID_UIAUTOMATOR2, caps.getCapability(AUTOMATION_NAME_OPTION));
assertNotNull(caps.getCapability(DEVICE_NAME_OPTION));
assertEquals(TestResources.API_DEMOS_APK.toString(), caps.getCapability(APP_OPTION));
assertEquals(TestUtils.ANDROID_APIDEMOS_APK_URL, caps.getCapability(APP_OPTION));
} finally {
driver.quit();
}
Expand All @@ -68,7 +68,7 @@ void startingAndroidAppWithCapabilitiesAndServiceTest() {
AndroidDriver driver = new AndroidDriver(builder, new UiAutomator2Options()
.setDeviceName("Android Emulator")
.autoGrantPermissions()
.setApp(TestResources.API_DEMOS_APK.toString()));
.setApp(TestUtils.ANDROID_APIDEMOS_APK_URL));
try {
Capabilities caps = driver.getCapabilities();

Expand All @@ -88,7 +88,7 @@ void startingAndroidAppWithCapabilitiesAndFlagsOnServerSideTest() {
.fullReset()
.autoGrantPermissions()
.setNewCommandTimeout(Duration.ofSeconds(60))
.setApp(TestResources.API_DEMOS_APK.toString());
.setApp(TestUtils.ANDROID_APIDEMOS_APK_URL);

WebDriverManager chromeManager = chromedriver();
chromeManager.setup();
Expand Down
Binary file removed src/e2eAndroidTest/resources/ApiDemos-debug.apk
Binary file not shown.
2 changes: 2 additions & 0 deletions src/test/java/io/appium/java_client/utils/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
public class TestUtils {
public static final String IOS_SIM_VODQA_RELEASE_URL =
"https://github.com/appium/VodQAReactNative/releases/download/v1.2.3/VodQAReactNative-simulator-release.zip";
public static final String ANDROID_APIDEMOS_APK_URL =
"https://github.com/appium/android-apidemos/releases/download/v6.0.2/ApiDemos-debug.apk";

private TestUtils() {
}
Expand Down