Skip to content

Commit a9812cb

Browse files
test: Use VodQA app for StartingAppLocallyIosTest suite (#2361)
1 parent 329daab commit a9812cb

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/e2eIosTest/java/io/appium/java_client/service/local/StartingAppLocallyIosTest.java

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,30 @@
2222
import io.appium.java_client.remote.AutomationName;
2323
import io.appium.java_client.remote.MobilePlatform;
2424
import io.appium.java_client.service.local.flags.GeneralServerFlag;
25-
import io.appium.java_client.utils.TestUtils;
2625
import org.junit.jupiter.api.Test;
2726
import org.openqa.selenium.Capabilities;
2827
import org.openqa.selenium.Platform;
2928

29+
import java.net.MalformedURLException;
30+
import java.net.URL;
31+
import java.util.Objects;
32+
3033
import static io.appium.java_client.remote.options.SupportsDeviceNameOption.DEVICE_NAME_OPTION;
34+
import static io.appium.java_client.utils.TestUtils.IOS_SIM_VODQA_RELEASE_URL;
3135
import static org.junit.jupiter.api.Assertions.assertEquals;
3236
import static org.junit.jupiter.api.Assertions.assertFalse;
3337
import static org.junit.jupiter.api.Assertions.assertNotNull;
3438
import static org.junit.jupiter.api.Assertions.assertTrue;
3539
import static org.openqa.selenium.remote.CapabilityType.PLATFORM_NAME;
3640

3741
class StartingAppLocallyIosTest {
38-
private static final String UI_CATALOG_ZIP = TestUtils.resourcePathToAbsolutePath("UICatalog.app.zip").toString();
39-
4042
@Test
41-
void startingIOSAppWithCapabilitiesOnlyTest() {
43+
void startingIOSAppWithCapabilitiesOnlyTest() throws MalformedURLException {
44+
var appUrl = new URL(IOS_SIM_VODQA_RELEASE_URL);
4245
XCUITestOptions options = new XCUITestOptions()
4346
.setPlatformVersion(BaseIOSTest.PLATFORM_VERSION)
4447
.setDeviceName(BaseIOSTest.DEVICE_NAME)
45-
.setApp(UI_CATALOG_ZIP)
48+
.setApp(appUrl)
4649
.setWdaLaunchTimeout(BaseIOSTest.WDA_LAUNCH_TIMEOUT);
4750
IOSDriver driver = new IOSDriver(options);
4851
try {
@@ -52,19 +55,19 @@ void startingIOSAppWithCapabilitiesOnlyTest() {
5255
assertEquals(Platform.IOS, caps.getPlatformName());
5356
assertNotNull(caps.getDeviceName().orElse(null));
5457
assertEquals(BaseIOSTest.PLATFORM_VERSION, caps.getPlatformVersion().orElse(null));
55-
assertEquals(UI_CATALOG_ZIP, caps.getApp().orElse(null));
58+
assertEquals(appUrl.toString(), caps.getApp().orElse(null));
5659
} finally {
5760
driver.quit();
5861
}
5962
}
6063

61-
6264
@Test
63-
void startingIOSAppWithCapabilitiesAndServiceTest() {
65+
void startingIOSAppWithCapabilitiesAndServiceTest() throws MalformedURLException {
66+
var appUrl = new URL(IOS_SIM_VODQA_RELEASE_URL);
6467
XCUITestOptions options = new XCUITestOptions()
6568
.setPlatformVersion(BaseIOSTest.PLATFORM_VERSION)
6669
.setDeviceName(BaseIOSTest.DEVICE_NAME)
67-
.setApp(UI_CATALOG_ZIP)
70+
.setApp(appUrl)
6871
.setWdaLaunchTimeout(BaseIOSTest.WDA_LAUNCH_TIMEOUT);
6972

7073
AppiumServiceBuilder builder = new AppiumServiceBuilder()
@@ -75,7 +78,7 @@ void startingIOSAppWithCapabilitiesAndServiceTest() {
7578
IOSDriver driver = new IOSDriver(builder, options);
7679
try {
7780
Capabilities caps = driver.getCapabilities();
78-
assertTrue(caps.getCapability(PLATFORM_NAME)
81+
assertTrue(Objects.requireNonNull(caps.getCapability(PLATFORM_NAME))
7982
.toString().equalsIgnoreCase(MobilePlatform.IOS));
8083
assertNotNull(caps.getCapability(DEVICE_NAME_OPTION));
8184
} finally {
@@ -84,14 +87,15 @@ void startingIOSAppWithCapabilitiesAndServiceTest() {
8487
}
8588

8689
@Test
87-
void startingIOSAppWithCapabilitiesAndFlagsOnServerSideTest() {
90+
void startingIOSAppWithCapabilitiesAndFlagsOnServerSideTest() throws MalformedURLException {
91+
var appUrl = new URL(IOS_SIM_VODQA_RELEASE_URL);
8892
XCUITestOptions serverOptions = new XCUITestOptions()
8993
.setPlatformVersion(BaseIOSTest.PLATFORM_VERSION)
9094
.setDeviceName(BaseIOSTest.DEVICE_NAME)
9195
.setWdaLaunchTimeout(BaseIOSTest.WDA_LAUNCH_TIMEOUT);
9296

9397
XCUITestOptions clientOptions = new XCUITestOptions()
94-
.setApp(UI_CATALOG_ZIP);
98+
.setApp(appUrl);
9599

96100
AppiumServiceBuilder builder = new AppiumServiceBuilder()
97101
.withArgument(GeneralServerFlag.SESSION_OVERRIDE)
-12.8 MB
Binary file not shown.

0 commit comments

Comments
 (0)