Search in sources :

Example 1 with ProcessInfo

use of com.seleniumtests.util.osutility.ProcessInfo in project seleniumRobot by bhecquet.

the class TestProcessInfo method testObjectEquals.

@Test(groups = { "ut" })
public void testObjectEquals() {
    ProcessInfo pi = new ProcessInfo();
    ProcessInfo info = new ProcessInfo();
    assertEquals(pi, info);
}
Also used : ProcessInfo(com.seleniumtests.util.osutility.ProcessInfo) MockitoTest(com.seleniumtests.MockitoTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 2 with ProcessInfo

use of com.seleniumtests.util.osutility.ProcessInfo in project seleniumRobot by bhecquet.

the class TestProcessInfo method testToStringNull.

@Test(groups = { "ut" })
public void testToStringNull() {
    ProcessInfo pi = new ProcessInfo();
    pi.setPid(null);
    pi.setName(null);
    String piString = pi.toString();
    assertEquals(piString, "Process #null = null");
}
Also used : ProcessInfo(com.seleniumtests.util.osutility.ProcessInfo) MockitoTest(com.seleniumtests.MockitoTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 3 with ProcessInfo

use of com.seleniumtests.util.osutility.ProcessInfo in project seleniumRobot by bhecquet.

the class TestOsUtility method testIsProcessRunningByPid.

@Test(groups = { "it" })
public void testIsProcessRunningByPid() {
    String processName = "";
    if (OSUtility.isWindows()) {
        processName = "svchost";
    } else if (OSUtility.isLinux()) {
        processName = "dbus-daemon";
    } else if (OSUtility.isMac()) {
        processName = "sysmond";
    }
    ProcessInfo pi = osUtil.getRunningProcess(processName);
    Assert.assertTrue(osUtil.isProcessRunningByPid(pi.getPid()));
}
Also used : ProcessInfo(com.seleniumtests.util.osutility.ProcessInfo) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 4 with ProcessInfo

use of com.seleniumtests.util.osutility.ProcessInfo in project seleniumRobot by bhecquet.

the class TestOsUtility method testWhichFirefoxWebBrowserRunning.

@Test(groups = { "it" })
public void testWhichFirefoxWebBrowserRunning() {
    osUtil.killAllWebBrowserProcess(true);
    SeleniumTestsContextManager.getThreadContext().setBrowser("firefox");
    WebUIDriver.getWebDriver(true);
    List<ProcessInfo> pis = osUtil.whichWebBrowserRunning(true);
    for (ProcessInfo pi : pis) {
        if (pi.getName().contains("firefox")) {
            return;
        }
    }
    Assert.fail("Firefox has not been found");
}
Also used : ProcessInfo(com.seleniumtests.util.osutility.ProcessInfo) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Example 5 with ProcessInfo

use of com.seleniumtests.util.osutility.ProcessInfo in project seleniumRobot by bhecquet.

the class TestOsUtility method testWhichChromeWebBrowserRunning.

@Test(groups = { "it" })
public void testWhichChromeWebBrowserRunning() {
    osUtil.killAllWebBrowserProcess(true);
    SeleniumTestsContextManager.getThreadContext().setBrowser("chrome");
    WebUIDriver.getWebDriver(true);
    List<ProcessInfo> pis = osUtil.whichWebBrowserRunning();
    for (ProcessInfo pi : pis) {
        if (pi.getName().contains("chrome")) {
            return;
        }
    }
    Assert.fail("Chrome has not been found");
}
Also used : ProcessInfo(com.seleniumtests.util.osutility.ProcessInfo) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest)

Aggregations

ProcessInfo (com.seleniumtests.util.osutility.ProcessInfo)16 GenericTest (com.seleniumtests.GenericTest)15 Test (org.testng.annotations.Test)15 MockitoTest (com.seleniumtests.MockitoTest)8 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)8 ConfigurationException (com.seleniumtests.customexception.ConfigurationException)1