use of com.seleniumtests.connectors.tms.squash.SquashTMApi in project seleniumRobot by bhecquet.
the class TestSquashTMApi method testDoNotCreateIteration.
/**
* Iteration already exist, do not recreate it
*/
@Test(groups = { "ut" })
public void testDoNotCreateIteration() {
PowerMockito.when(Project.getAll()).thenReturn(Arrays.asList(project1, project2));
SquashTMApi api = new SquashTMApi("http://localhost:4321", "user", "password", "project1");
doReturn(Arrays.asList(iteration1, iteration2)).when(campaign1).getIterations();
PowerMockito.when(Iteration.create(campaign1, "myIteration")).thenReturn(iteration1);
Assert.assertEquals(api.createIteration(campaign1, "iteration1"), iteration1);
// check campaign creation has been called
PowerMockito.verifyStatic(Iteration.class, never());
Iteration.create(campaign1, "iteration1");
}
use of com.seleniumtests.connectors.tms.squash.SquashTMApi in project seleniumRobot by bhecquet.
the class TestSquashTM method testCreateCampaign.
@Test(groups = "no-ti", enabled = false, attributes = { @CustomAttribute(name = "testId", values = "12") })
public void testCreateCampaign(ITestContext testContext) {
SquashTMConnector tm = new SquashTMConnector("http://localhost:8080/squash", "admin", "admin", "Test Project-1");
SquashTMApi api = tm.getApi();
Campaign campaign = api.createCampaign("AutoTest", "SubFolder/foo");
Iteration iteration = api.createIteration(campaign, "myiteration");
IterationTestPlanItem tpi = api.addTestCaseInIteration(iteration, 239);
api.setExecutionResult(tpi, ExecutionStatus.FAILURE);
}
use of com.seleniumtests.connectors.tms.squash.SquashTMApi in project seleniumRobot by bhecquet.
the class TestSquashTMApi method testDoNotAddTestCase.
/**
* Iteration already exist, do not recreate it
*/
@Test(groups = { "ut" })
public void testDoNotAddTestCase() {
PowerMockito.when(Project.getAll()).thenReturn(Arrays.asList(project1, project2));
SquashTMApi api = new SquashTMApi("http://localhost:4321", "user", "password", "project1");
doReturn(Arrays.asList(testPlanItem1, testPlanItem2)).when(iteration1).getAllTestCases();
PowerMockito.when(TestCase.get(3)).thenReturn(testCase1);
doReturn(testPlanItem1).when(iteration1).addTestCase(testCase1);
IterationTestPlanItem itpi = api.addTestCaseInIteration(iteration1, 2);
Assert.assertEquals(itpi, testPlanItem2);
// check test case has been added
verify(iteration1, never()).addTestCase(any(TestCase.class));
}
use of com.seleniumtests.connectors.tms.squash.SquashTMApi in project seleniumRobot by bhecquet.
the class TestSquashTMApi method testGetNoExistingProject.
/**
* Project does not exist on Squash TM => raise error
*/
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class)
public void testGetNoExistingProject() {
PowerMockito.when(Project.getAll()).thenReturn(Arrays.asList(project1, project2));
SquashTMApi api = new SquashTMApi("http://localhost:4321", "user", "password", "project3");
Assert.assertEquals(api.getCurrentProject(), project1);
}
use of com.seleniumtests.connectors.tms.squash.SquashTMApi in project seleniumRobot by bhecquet.
the class TestSquashTMApi method testCannotAddTestCaseDoesNotExist.
/**
* Check exception is raised if test case does not exist
*/
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class)
public void testCannotAddTestCaseDoesNotExist() {
PowerMockito.when(Project.getAll()).thenReturn(Arrays.asList(project1, project2));
SquashTMApi api = new SquashTMApi("http://localhost:4321", "user", "password", "project1");
doReturn(Arrays.asList(testPlanItem1, testPlanItem2)).when(iteration1).getAllTestCases();
PowerMockito.doThrow(new ScenarioException("")).when(TestCase.class);
TestCase.get(3);
doReturn(testPlanItem1).when(iteration1).addTestCase(any(TestCase.class));
IterationTestPlanItem itpi = api.addTestCaseInIteration(iteration1, 3);
}
Aggregations