use of com.seleniumtests.connectors.bugtracker.IssueBean 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.IssueBean 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);
}
use of com.seleniumtests.connectors.bugtracker.IssueBean in project seleniumRobot by bhecquet.
the class TestJiraConnector method testCreateJiraBeanWithErrorCauseAndDetails.
@Test(groups = { "ut" })
public void testCreateJiraBeanWithErrorCauseAndDetails() throws Exception {
jiraOptions.put("priority", "P1");
jiraOptions.put("assignee", "me");
jiraOptions.put("reporter", "you");
jiraOptions.put("jira.issueType", "Bug");
jiraOptions.put("jira.components", "comp1,comp2");
jiraOptions.put("jira.field.foo", "bar");
SeleniumTestsContextManager.getThreadContext().setStartedBy("http://foo/bar/job/1");
JiraConnector jiraConnector = new JiraConnector("http://foo/bar", PROJECT_KEY, "user", "password", jiraOptions);
IssueBean issueBean = jiraConnector.createIssueBean("[Selenium][selenium][DEV][ngName] test myTest KO", "testCreateJiraBean", "some description", Arrays.asList(step1, stepWithErrorCauseAndDetails, stepEnd), jiraOptions);
Assert.assertTrue(issueBean instanceof JiraBean);
JiraBean jiraBean = (JiraBean) issueBean;
// check only step2 is seen as a failed step
// detailed result is not provided because 'startedBy' is set
Assert.assertEquals(jiraBean.getDescription(), "*Test:* testCreateJiraBean\n" + "*Description:* some description\n" + "*Started by:* http://foo/bar/job/1\n" + "*Error step #1 (step 3):* *{color:#de350b}java.lang.NullPointerException: Error clicking{color}*\n" + "h2. Steps in error\n" + "* *Step 1: step 3*\n" + "+Possible cause:+ REGRESSION => Check your script\n" + "{code:java}Step step 3\n" + " - action1\n" + " - action2{code}\n" + "\n" + "h2. Last logs\n" + "{code:java}Step Test end{code}\n" + "\n" + "h2. Associated screenshots\n" + "!N-A_0-2_Test_end--123456.png|thumbnail!\n" + "!N-A_0-2_Test_end--123456.png|thumbnail!\n");
}
Aggregations