Search in sources :

Example 11 with BugTracker

use of com.seleniumtests.connectors.bugtracker.BugTracker in project seleniumRobot by bhecquet.

the class TestBugTracker method testJiraBugtracker.

@Test(groups = { "ut" })
public void testJiraBugtracker() throws Exception {
    PowerMockito.whenNew(JiraConnector.class).withAnyArguments().thenReturn(jiraConnector);
    BugTracker bugtracker = BugTracker.getInstance("jira", "http://foo/bar", "selenium", "user", "password", new HashMap<>());
    Assert.assertTrue(bugtracker instanceof JiraConnector);
}
Also used : JiraConnector(com.seleniumtests.connectors.bugtracker.jira.JiraConnector) BugTracker(com.seleniumtests.connectors.bugtracker.BugTracker) FakeBugTracker(com.seleniumtests.connectors.bugtracker.FakeBugTracker) Test(org.testng.annotations.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) MockitoTest(com.seleniumtests.MockitoTest)

Example 12 with BugTracker

use of com.seleniumtests.connectors.bugtracker.BugTracker 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);
}
Also used : FakeBugTracker(com.seleniumtests.connectors.bugtracker.FakeBugTracker) IssueBean(com.seleniumtests.connectors.bugtracker.IssueBean) BugTracker(com.seleniumtests.connectors.bugtracker.BugTracker) FakeBugTracker(com.seleniumtests.connectors.bugtracker.FakeBugTracker) Test(org.testng.annotations.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) MockitoTest(com.seleniumtests.MockitoTest)

Example 13 with BugTracker

use of com.seleniumtests.connectors.bugtracker.BugTracker 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);
}
Also used : FakeBugTracker(com.seleniumtests.connectors.bugtracker.FakeBugTracker) IssueBean(com.seleniumtests.connectors.bugtracker.IssueBean) BugTracker(com.seleniumtests.connectors.bugtracker.BugTracker) FakeBugTracker(com.seleniumtests.connectors.bugtracker.FakeBugTracker) Test(org.testng.annotations.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) MockitoTest(com.seleniumtests.MockitoTest)

Aggregations

BugTracker (com.seleniumtests.connectors.bugtracker.BugTracker)13 MockitoTest (com.seleniumtests.MockitoTest)12 FakeBugTracker (com.seleniumtests.connectors.bugtracker.FakeBugTracker)12 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)12 Test (org.testng.annotations.Test)12 IssueBean (com.seleniumtests.connectors.bugtracker.IssueBean)10 JiraConnector (com.seleniumtests.connectors.bugtracker.jira.JiraConnector)1 SeleniumTestsContext (com.seleniumtests.core.SeleniumTestsContext)1 TestVariable (com.seleniumtests.core.TestVariable)1 HyperlinkInfo (com.seleniumtests.reporter.info.HyperlinkInfo)1 StringInfo (com.seleniumtests.reporter.info.StringInfo)1 TestStep (com.seleniumtests.reporter.logger.TestStep)1 SeleniumTestsReporter2 (com.seleniumtests.reporter.reporters.SeleniumTestsReporter2)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Set (java.util.Set)1 ITestContext (org.testng.ITestContext)1 ITestResult (org.testng.ITestResult)1