use of com.seleniumtests.connectors.extools.Uft in project seleniumRobot by bhecquet.
the class TestUft method testPrepareArgumentsWithAlmTestAndParamAndClean.
@Test(groups = { "ut" })
public void testPrepareArgumentsWithAlmTestAndParamAndClean() {
Map<String, String> params = new HashMap<>();
params.put("User", "toto");
Uft uft = new Uft("http://almserver/qcbin", "usr", "pwd", "dom", "proj", "[QualityCenter]Subject\\Tools\\Tests\\test1");
uft.setKillUftOnStartup(false);
uft.setParameters(params);
List<String> args = uft.prepareArguments(true, true);
Assert.assertEquals(args.size(), 10);
Assert.assertTrue(args.get(0).startsWith(System.getProperty("java.io.tmpdir")));
Assert.assertTrue(args.get(0).endsWith("uft.vbs"));
Assert.assertTrue(args.get(1).equals("[QualityCenter]Subject\\Tools\\Tests\\test1"));
Assert.assertTrue(args.get(2).equals("/execute"));
Assert.assertTrue(args.get(3).equals("\"User=toto\""));
Assert.assertTrue(args.get(4).equals("/server:http://almserver/qcbin"));
Assert.assertTrue(args.get(5).equals("/user:usr"));
Assert.assertTrue(args.get(6).equals("/password:pwd"));
Assert.assertTrue(args.get(7).equals("/domain:dom"));
Assert.assertTrue(args.get(8).equals("/project:proj"));
Assert.assertTrue(args.get(9).equals("/load"));
}
use of com.seleniumtests.connectors.extools.Uft in project seleniumRobot by bhecquet.
the class TestUft method testReadReport.
/**
* Check report file is correctly read
*
* @throws IOException
*/
@Test(groups = { "ut" })
public void testReadReport() throws IOException {
String report = GenericTest.readResourceToString("tu/uftReport.xml");
Uft uft = new Uft("[QualityCenter]Subject\\Tools\\Tests\\test1");
List<TestStep> stepList = uft.readXmlResult(report);
// check all content has been read
Assert.assertEquals(stepList.get(0).getName(), "UFT: IP_Config_Poste_W10 [IP_Config_Poste_W10]");
// check all content has been read
Assert.assertEquals(stepList.size(), 1);
// check the while content
Assert.assertEquals(stepList.get(0).toString(), "Step UFT: IP_Config_Poste_W10 [IP_Config_Poste_W10]");
}
use of com.seleniumtests.connectors.extools.Uft in project seleniumRobot by bhecquet.
the class TestUft method testPrepareLoadArgumentsWithAlmTestMissingDomainValues.
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class)
public void testPrepareLoadArgumentsWithAlmTestMissingDomainValues() {
Uft uft = new Uft("http://almserver/qcbin", "usr", "pwd", null, "proj", "[QualityCenter]Subject\\Tools\\Tests\\test1");
uft.setKillUftOnStartup(false);
uft.prepareArguments(true, false);
}
use of com.seleniumtests.connectors.extools.Uft in project seleniumRobot by bhecquet.
the class TestUft method testReadNoReport.
/**
* Test when no report is available
* the main test step is still present
* @throws IOException
*/
@Test(groups = { "ut" })
public void testReadNoReport() throws IOException {
String report = "some bad report";
Uft uft = new Uft("[QualityCenter]Subject\\Tools\\Tests\\test1");
List<TestStep> testSteps = uft.readXmlResult(report);
Assert.assertEquals(testSteps.get(0).getStepActions().size(), 1);
Assert.assertEquals(((TestMessage) testSteps.get(0).getStepActions().get(0)).getMessageType(), MessageType.ERROR);
}
use of com.seleniumtests.connectors.extools.Uft in project seleniumRobot by bhecquet.
the class TestUft method testPrepareArgumentsWithLocalTest.
/**
* Check uft.vbs file is copied to temp folder test is stored locally
*/
@Test(groups = { "ut" })
public void testPrepareArgumentsWithLocalTest() {
Uft uft = new Uft("D:\\Subject\\Tools\\Tests\\test1");
uft.setKillUftOnStartup(false);
List<String> args = uft.prepareArguments(true, true);
Assert.assertEquals(args.size(), 4);
Assert.assertTrue(args.get(0).startsWith(System.getProperty("java.io.tmpdir")));
Assert.assertTrue(args.get(0).endsWith("uft.vbs"));
Assert.assertTrue(args.get(1).equals("D:\\Subject\\Tools\\Tests\\test1"));
Assert.assertTrue(args.get(2).equals("/execute"));
}
Aggregations