use of com.seleniumtests.browserfactory.AndroidCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestAndroidCapabilitiesFactory method testCreateDefaultCapabilitiesWithAutomationName.
/**
* issue #367: check automationName is set in capabilities when overriden
*/
@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithAutomationName() {
SeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());
context.setBrowser(BrowserType.CHROME.toString());
context.setMobilePlatformVersion("8.0");
context.setPlatform("android");
context.setDeviceName("Samsung Galasy S8");
context.setAutomationName("UiAutomator1");
context.setApp("");
DriverConfig config = new DriverConfig(context);
AndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);
MutableCapabilities capa = capaFactory.createCapabilities();
Assert.assertEquals(capa.getCapability(CapabilityType.BROWSER_NAME), BrowserType.CHROME.toString().toLowerCase());
Assert.assertEquals(capa.getCapability(MobileCapabilityType.AUTOMATION_NAME), "UiAutomator1");
Assert.assertNull(capa.getCapability(MobileCapabilityType.FULL_RESET));
}
use of com.seleniumtests.browserfactory.AndroidCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestAndroidCapabilitiesFactory method testCreateDefaultCapabilitiesWithNodeTagsInGridMode.
/**
* Check default behaviour when node tags are defined in grid mode
* tags are transferred to driver
*/
@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithNodeTagsInGridMode() {
SeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());
context.setBrowser(BrowserType.CHROME.toString());
context.setNodeTags("foo,bar");
context.setRunMode("grid");
context.setMobilePlatformVersion("8.0");
context.setPlatform("android");
context.setDeviceName("Samsung Galasy S8");
context.setApp("");
DriverConfig config = new DriverConfig(context);
AndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);
MutableCapabilities capa = capaFactory.createCapabilities();
Assert.assertEquals(capa.getCapability(SeleniumRobotCapabilityType.NODE_TAGS), Arrays.asList("foo", "bar"));
}
use of com.seleniumtests.browserfactory.AndroidCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestAndroidCapabilitiesFactory method testCreateCapabilitiesWithRelativeApplicationPath.
/**
* Check mobile test with app relative path => check absolute path is set in capabilities
*/
@Test(groups = { "ut" })
public void testCreateCapabilitiesWithRelativeApplicationPath() {
SeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());
context.setMobilePlatformVersion("8.0");
context.setPlatform("android");
context.setDeviceName("Samsung Galasy S8");
context.setAppPackage("appPackage");
context.setAppActivity("appActivity");
context.setApp("data/core/app.apk");
DriverConfig config = new DriverConfig(context);
AndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);
MutableCapabilities capa = capaFactory.createCapabilities();
Assert.assertEquals(capa.getCapability(CapabilityType.BROWSER_NAME), "");
logger.info("app path: " + capa.getCapability("app"));
Assert.assertTrue(capa.getCapability("app").toString().contains("/data/core/app.apk"));
}
use of com.seleniumtests.browserfactory.AndroidCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestAndroidCapabilitiesFactory method testCreateCapabilitiesWithAbsoluteApplicationPath.
/**
* Check mobile test with app relative path => check absolute path is set in capabilities
*/
@Test(groups = { "ut" })
public void testCreateCapabilitiesWithAbsoluteApplicationPath() {
SeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());
context.setMobilePlatformVersion("8.0");
context.setPlatform("android");
context.setDeviceName("Samsung Galasy S8");
context.setAppPackage("appPackage");
context.setAppActivity("appActivity");
String path = new File("data/core/app.apk").getAbsolutePath();
context.setApp(path);
DriverConfig config = new DriverConfig(context);
AndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);
MutableCapabilities capa = capaFactory.createCapabilities();
Assert.assertEquals(capa.getCapability(CapabilityType.BROWSER_NAME), "");
Assert.assertEquals(capa.getCapability("app"), path.replace("\\", "/"));
}
use of com.seleniumtests.browserfactory.AndroidCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestAndroidCapabilitiesFactory method testCreateCapabilitiesWithApplicationOldAndroid.
/**
* Check automationName capability with android < 4
*/
@Test(groups = { "ut" })
public void testCreateCapabilitiesWithApplicationOldAndroid() {
SeleniumTestsContext context = new SeleniumTestsContext(SeleniumTestsContextManager.getThreadContext());
context.setMobilePlatformVersion("2.3");
context.setPlatform("android");
context.setDeviceName("Samsung Galasy S1");
context.setAppPackage("appPackage");
context.setAppActivity("appActivity");
context.setFullReset(true);
context.setApp("com.covea.mobileapp");
DriverConfig config = new DriverConfig(context);
AndroidCapabilitiesFactory capaFactory = new AndroidCapabilitiesFactory(config);
MutableCapabilities capa = capaFactory.createCapabilities();
Assert.assertEquals(capa.getCapability(MobileCapabilityType.AUTOMATION_NAME), "Selendroid");
}
Aggregations