Search in sources :

Example 6 with DashboardView

use of org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView in project acceptance-test-harness by jenkinsci.

the class DashboardViewPluginTest method latestsBuildsPortlet_correctJobLink.

@Test
public void latestsBuildsPortlet_correctJobLink() {
    DashboardView v = createDashboardView();
    LatestBuildsPortlet latestBuilds = v.addBottomPortlet(LatestBuildsPortlet.class);
    v.save();
    FreeStyleJob job = createFreeStyleJob();
    buildSuccessfulJob(job);
    v.open();
    latestBuilds.openJob(job.name);
    assertThat(driver, hasContent("Project " + job.name));
}
Also used : LatestBuildsPortlet(org.jenkinsci.test.acceptance.plugins.dashboard_view.LatestBuildsPortlet) DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) Test(org.junit.Test)

Example 7 with DashboardView

use of org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView in project acceptance-test-harness by jenkinsci.

the class DashboardViewPluginTest method testPortletPositioning_bottomPortlets.

@Test
public void testPortletPositioning_bottomPortlets() {
    DashboardView v = createDashboardView();
    v.addBottomPortlet(TestStatisticsChartPortlet.class);
    v.save();
    createFreeStyleJob();
    assertThat(v.getPortletInTopTable(TestStatisticsChartPortlet.TEST_STATISTICS_CHART), nullValue());
    assertThat(v.getPortletInLeftTable(TestStatisticsChartPortlet.TEST_STATISTICS_CHART), nullValue());
    assertThat(v.getPortletInRightTable(TestStatisticsChartPortlet.TEST_STATISTICS_CHART), nullValue());
    assertThat(v.getPortletInBottomTable(TestStatisticsChartPortlet.TEST_STATISTICS_CHART), notNullValue());
}
Also used : DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) Test(org.junit.Test)

Example 8 with DashboardView

use of org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView in project acceptance-test-harness by jenkinsci.

the class DashboardViewPluginTest method testPortletPositioning_topPortlets.

@Test
public void testPortletPositioning_topPortlets() {
    DashboardView v = createDashboardView();
    v.addTopPortlet(TestStatisticsChartPortlet.class);
    v.save();
    createFreeStyleJob();
    assertThat(v.getPortletInTopTable(TestStatisticsChartPortlet.TEST_STATISTICS_CHART), notNullValue());
    assertThat(v.getPortletInLeftTable(TestStatisticsChartPortlet.TEST_STATISTICS_CHART), nullValue());
    assertThat(v.getPortletInRightTable(TestStatisticsChartPortlet.TEST_STATISTICS_CHART), nullValue());
    assertThat(v.getPortletInBottomTable(TestStatisticsChartPortlet.TEST_STATISTICS_CHART), nullValue());
}
Also used : DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) Test(org.junit.Test)

Example 9 with DashboardView

use of org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView in project acceptance-test-harness by jenkinsci.

the class DashboardViewPluginTest method buildStatisticsPortlet_unstableNr.

@Test
public void buildStatisticsPortlet_unstableNr() {
    DashboardView v = createDashboardView();
    BuildStatisticsPortlet stats = v.addBottomPortlet(BuildStatisticsPortlet.class);
    v.save();
    buildUnstableJob(createUnstableFreeStyleJob());
    v.open();
    assertThat(stats.getNumberOfBuilds(JobType.UNSTABLE), is(1));
}
Also used : BuildStatisticsPortlet(org.jenkinsci.test.acceptance.plugins.dashboard_view.BuildStatisticsPortlet) DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) Test(org.junit.Test)

Example 10 with DashboardView

use of org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView in project acceptance-test-harness by jenkinsci.

the class DashboardViewPluginTest method buildStatisticsPortlet_totalBuilds.

@Test
public void buildStatisticsPortlet_totalBuilds() {
    DashboardView v = createDashboardView();
    BuildStatisticsPortlet stats = v.addBottomPortlet(BuildStatisticsPortlet.class);
    v.save();
    FreeStyleJob successJob = createFreeStyleJob();
    FreeStyleJob failingJob = createFailingFreeStyleJob();
    FreeStyleJob unstableJob = createUnstableFreeStyleJob();
    buildUnstableJob(unstableJob);
    buildSuccessfulJob(successJob);
    buildSuccessfulJob(successJob);
    buildFailingJob(failingJob);
    v.open();
    assertThat(stats.getNumberOfBuilds(JobType.TOTAL), is(4));
}
Also used : BuildStatisticsPortlet(org.jenkinsci.test.acceptance.plugins.dashboard_view.BuildStatisticsPortlet) DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) Test(org.junit.Test)

Aggregations

DashboardView (org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView)35 Test (org.junit.Test)32 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)16 BuildStatisticsPortlet (org.jenkinsci.test.acceptance.plugins.dashboard_view.BuildStatisticsPortlet)7 JobsGridPortlet (org.jenkinsci.test.acceptance.plugins.dashboard_view.JobsGridPortlet)4 LatestBuildsPortlet (org.jenkinsci.test.acceptance.plugins.dashboard_view.LatestBuildsPortlet)4 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)3 TestStatisticsChartPortlet (org.jenkinsci.test.acceptance.plugins.dashboard_view.TestStatisticsChartPortlet)3 UnstableJobsPortlet (org.jenkinsci.test.acceptance.plugins.dashboard_view.UnstableJobsPortlet)3 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)2 NestedView (org.jenkinsci.test.acceptance.plugins.nested_view.NestedView)2 Build (org.jenkinsci.test.acceptance.po.Build)2 Folder (org.jenkinsci.test.acceptance.po.Folder)2 Issue (org.jvnet.hudson.test.Issue)2 Description (org.hamcrest.Description)1 Matcher (org.jenkinsci.test.acceptance.Matcher)1 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)1 WithCredentials (org.jenkinsci.test.acceptance.junit.WithCredentials)1 WithDocker (org.jenkinsci.test.acceptance.junit.WithDocker)1 AnalysisPlugin (org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisPlugin)1