use of com.seleniumtests.connectors.bugtracker.FakeBugTracker in project seleniumRobot by bhecquet.
the class TestBugTracker method testDoNotCreateIssue.
/**
* Test issue is not created if no failed step is present during execution
* @throws Exception
*/
@Test(groups = { "ut" })
public void testDoNotCreateIssue() throws Exception {
FakeBugTracker fbt = spy(new FakeBugTracker());
PowerMockito.whenNew(FakeBugTracker.class).withAnyArguments().thenReturn(fbt);
BugTracker bugtracker = BugTracker.getInstance("fake", "http://foo/bar", "selenium", "user", "password", new HashMap<>());
bugtracker.createIssue("selenium", "DEV", "ngName", "testDoNotCreateIssue", "some description", Arrays.asList(step1, stepEnd), issueOptions);
// check that we check if the issue already exists
verify(fbt, never()).issueAlreadyExists(any(IssueBean.class));
// check that issue is created
verify(fbt, never()).createIssue(any(IssueBean.class));
}
use of com.seleniumtests.connectors.bugtracker.FakeBugTracker in project seleniumRobot by bhecquet.
the class TestBugTracker method testDoNotUpdateIssue.
/**
* Do not update existing issue as we fail on the same step
* @throws Exception
*/
@Test(groups = { "ut" })
public void testDoNotUpdateIssue() throws Exception {
FakeBugTracker fbt = spy(new FakeBugTracker());
PowerMockito.whenNew(FakeBugTracker.class).withAnyArguments().thenReturn(fbt);
when(fbt.issueAlreadyExists(any(IssueBean.class))).thenReturn(new IssueBean("ISSUE-1", "[Selenium][app][env][ng] test Test1 KO", String.format(BugTracker.STEP_KO_PATTERN, 1)));
BugTracker bugtracker = BugTracker.getInstance("fake", "http://foo/bar", "selenium", "user", "password", new HashMap<>());
bugtracker.createIssue("selenium", "DEV", "ngName", "testDoNotUpdateIssue", "some description", Arrays.asList(step1, step2, stepEnd), issueOptions);
// check that we check if the issue already exists
verify(fbt).issueAlreadyExists(any(IssueBean.class));
// check that issue is not created
verify(fbt, never()).createIssue(any(IssueBean.class));
verify(fbt, never()).updateIssue(eq("ISSUE-1"), anyString(), anyList(), eq(step2));
}
use of com.seleniumtests.connectors.bugtracker.FakeBugTracker in project seleniumRobot by bhecquet.
the class TestBugTracker method testCreateIssueBeanNoEndStep.
/**
* If no Test end steps are available, do not create IssueBean
* @throws Exception
*/
@Test(groups = { "ut" })
public void testCreateIssueBeanNoEndStep() throws Exception {
FakeBugTracker fbt = spy(new FakeBugTracker());
PowerMockito.whenNew(FakeBugTracker.class).withAnyArguments().thenReturn(fbt);
BugTracker bugtracker = BugTracker.getInstance("fake", "http://foo/bar", "selenium", "user", "password", new HashMap<>());
IssueBean issueBean = bugtracker.createIssueBean("[Selenium][selenium][DEV][ngName] test myTest KO", "myTest", "some description", Arrays.asList(step1), issueOptions);
Assert.assertNull(issueBean);
}
use of com.seleniumtests.connectors.bugtracker.FakeBugTracker in project seleniumRobot by bhecquet.
the class TestBugTracker method testDoNotCreateIssueBeanWithStepDisabled.
/**
* Test that if the failed step disables bugtracker, the issue bean is not created
* @throws Exception
*/
@Test(groups = { "ut" })
public void testDoNotCreateIssueBeanWithStepDisabled() throws Exception {
FakeBugTracker fbt = spy(new FakeBugTracker());
PowerMockito.whenNew(FakeBugTracker.class).withAnyArguments().thenReturn(fbt);
BugTracker bugtracker = BugTracker.getInstance("fake", "http://foo/bar", "selenium", "user", "password", new HashMap<>());
IssueBean issueBean = bugtracker.createIssueBean("[Selenium][selenium][DEV][ngName] test myTest KO", "testDoNotCreateIssueBeanWithStepDisabled", "some description", Arrays.asList(step1, stepFailedWithDisabledBugtracker, stepEnd), issueOptions);
Assert.assertNull(issueBean);
}
Aggregations