use of com.seleniumtests.browserfactory.mobile.LocalAppiumLauncher in project seleniumRobot by bhecquet.
the class TestLocalAppiumLauncher method testNodeFoundInSystemPath.
/**
* Test when node is found in system path
* @throws IOException
*/
@Test(groups = { "ut" })
public void testNodeFoundInSystemPath() throws IOException {
initValidAppiumInstallation();
PowerMockito.mockStatic(OSCommand.class);
when(OSCommand.executeCommandAndWait("node -v")).thenReturn("v6.2.1");
LocalAppiumLauncher appium = new LocalAppiumLauncher();
Assert.assertEquals(appium.getNodeVersion(), "v6.2.1");
}
use of com.seleniumtests.browserfactory.mobile.LocalAppiumLauncher in project seleniumRobot by bhecquet.
the class TestLocalAppiumLauncher method testAppiumStartup.
@Test(groups = { "ut" })
public void testAppiumStartup() throws IOException {
initValidAppiumInstallation();
initValidNodeInstallation();
when(OSCommand.executeCommand(contains("node_modules/appium/"))).thenReturn(nodeProcess);
LocalAppiumLauncher appium = new LocalAppiumLauncher();
appium.setAppiumPort(4723);
appium.startAppiumWithoutWait();
Assert.assertEquals(appium.getAppiumProcess(), nodeProcess);
}
use of com.seleniumtests.browserfactory.mobile.LocalAppiumLauncher in project seleniumRobot by bhecquet.
the class TestLocalAppiumLauncher method testAppiumFoundInvalid.
/**
* Test when appium_home path does not contain a right appiumConfig file
* @throws IOException
*/
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class)
public void testAppiumFoundInvalid() throws IOException {
PowerMockito.mockStatic(FileUtils.class);
PowerMockito.mockStatic(System.class);
PowerMockito.mockStatic(OSCommand.class);
when(System.getenv("APPIUM_HOME")).thenReturn("/opt/appium/");
when(FileUtils.readFileToString(new File("/opt/appium/node_modules/appium/package.json"))).thenReturn("{\"name\":\"application\"}");
new LocalAppiumLauncher();
}
use of com.seleniumtests.browserfactory.mobile.LocalAppiumLauncher in project seleniumRobot by bhecquet.
the class TestLocalAppiumLauncher method testAppiumStopWithoutStart.
@Test(groups = { "ut" }, expectedExceptions = ScenarioException.class)
public void testAppiumStopWithoutStart() throws IOException {
initValidAppiumInstallation();
initValidNodeInstallation();
LocalAppiumLauncher appium = new LocalAppiumLauncher();
appium.stopAppium();
}
use of com.seleniumtests.browserfactory.mobile.LocalAppiumLauncher in project seleniumRobot by bhecquet.
the class TestLocalAppiumLauncher method testAppiumStop.
@Test(groups = { "ut" })
public void testAppiumStop() throws IOException {
initValidAppiumInstallation();
initValidNodeInstallation();
when(OSCommand.executeCommand(contains("node_modules/appium/"))).thenReturn(nodeProcess);
LocalAppiumLauncher appium = new LocalAppiumLauncher();
appium.setAppiumPort(4723);
appium.startAppiumWithoutWait();
appium.stopAppium();
Mockito.verify(nodeProcess).destroy();
}
Aggregations