@Test public void testDefaultIssueTypePreselect() { jira.gotoLoginPage().login("fred", "fred", DashboardPage.class); backdoor.project().setDefaultIssueType(10000, "2"); JiraHeader header = pageBinder.bind(JiraHeader.class); CreateIssueDialog createIssueDialog = header.createIssue(); assertEquals("New Feature", createIssueDialog.getIssueType()); }
@Test public void testIssueTypePreselect() { // Should select first issue type in list as we have no history jira.gotoLoginPage().login("fred", "fred", DashboardPage.class); backdoor.project().setDefaultIssueType(10000, null); JiraHeader header = pageBinder.bind(JiraHeader.class); CreateIssueDialog createIssueDialog = header.createIssue(); assertEquals("Bug", createIssueDialog.getIssueType()); createIssueDialog.close(); }
@Test public void testCreatedIssuesGetAddedToHistory() { jira.gotoLoginPage().login("fred", "fred", DashboardPage.class); CreateIssueDialog createIssueDialog = pageBinder.bind(JiraHeader.class).createIssue(); createIssueDialog.fill("summary", "My Summary").submit(DashboardPage.class); JiraHeader header = pageBinder.bind(JiraHeader.class); IssuesMenu issuesMenu = header.getIssuesMenu().open(); List<String> recentIssues = issuesMenu.getRecentIssues(); assertTrue(recentIssues.get(0).endsWith("My Summary")); issuesMenu.createIssue().fill("summary", "My Summary 2").submit(DashboardPage.class); header = pageBinder.bind(JiraHeader.class); issuesMenu = header.getIssuesMenu().open(); recentIssues = issuesMenu.getRecentIssues(); assertTrue(recentIssues.get(0).endsWith("My Summary 2")); assertTrue(recentIssues.get(1).endsWith("My Summary")); }