Search in sources :

Example 1 with FreestyleJob

use of io.blueocean.ath.model.FreestyleJob in project blueocean-plugin by jenkinsci.

the class FavoritesAddRemoveTest method testFreestyle.

@Test
public void testFreestyle() throws IOException {
    String jobName = "addremove-freestyle";
    FreestyleJob freestyle = freestyleFactory.pipeline(FOLDER, jobName).create("echo hi");
    String fullName = freestyle.getFullName();
    dashboardPage.open();
    dashboardPage.togglePipelineListFavorite(jobName);
    dashboardPage.checkFavoriteCardCount(1);
    dashboardPage.togglePipelineListFavorite(jobName);
    dashboardPage.checkFavoriteCardCount(0);
    Assert.assertTrue("should not be favorited", !dashboardPage.isPipelineListItemFavorited(jobName));
}
Also used : FreestyleJob(io.blueocean.ath.model.FreestyleJob) Test(org.junit.Test)

Example 2 with FreestyleJob

use of io.blueocean.ath.model.FreestyleJob in project blueocean-plugin by jenkinsci.

the class FavoritesCardsTest method testFreestyle.

@Test
public void testFreestyle() throws IOException {
    String jobName = "favoritescards-freestyle";
    FreestyleJob freestyle = freestyleFactory.pipeline(FOLDER, jobName).create("echo hello\nsleep 5\necho world");
    String fullName = freestyle.getFullName();
    dashboardPage.open();
    dashboardPage.togglePipelineListFavorite(jobName);
    dashboardPage.checkFavoriteCardCount(1);
    dashboardPage.clickFavoriteCardRunButton(fullName);
    dashboardPage.checkFavoriteCardStatus(fullName, RUNNING, SUCCESS);
    dashboardPage.removeFavoriteCard(fullName);
    dashboardPage.checkFavoriteCardCount(0);
    dashboardPage.checkIsPipelineListItemFavorited(jobName, false);
}
Also used : FreestyleJob(io.blueocean.ath.model.FreestyleJob) Test(org.junit.Test)

Example 3 with FreestyleJob

use of io.blueocean.ath.model.FreestyleJob in project blueocean-plugin by jenkinsci.

the class ArtifactsTest method testNoArtifacts.

@Test
public void testNoArtifacts() throws IOException {
    FreestyleJob testNoArtifacts = freestyleJobFactory.pipeline("testNoArtifacts").create("echo hi").build();
    sseClientRule.untilEvents(SSEEvents.activityComplete("testNoArtifacts"));
    testNoArtifacts.getRunDetailsArtifactsPage().open(1);
    wait.until(ExpectedConditions.invisibilityOfElementLocated(By.cssSelector("a[title='Download all artifact as zip'")));
}
Also used : FreestyleJob(io.blueocean.ath.model.FreestyleJob) Test(org.junit.Test) BlueOceanAcceptanceTest(io.blueocean.ath.BlueOceanAcceptanceTest)

Example 4 with FreestyleJob

use of io.blueocean.ath.model.FreestyleJob in project blueocean-plugin by jenkinsci.

the class UpstreamLinkTest method upstreamLinkTest.

@Test
public void upstreamLinkTest() throws IOException {
    String jenkinsFile = loadJenkinsFile();
    FreestyleJob upstreamJob = freestyleJobFactory.pipeline("upstreamJob").create("echo blah");
    ClassicPipeline downstreamJob = pipelineFactory.pipeline("downstreamJob").createPipeline(jenkinsFile).build();
    sseClient.untilEvents(downstreamJob.buildsFinished);
    sseClient.clear();
    upstreamJob.build();
    sseClient.untilEvents(upstreamJob.buildsFinished);
    sseClient.untilEvents(downstreamJob.buildsFinished);
    sseClient.clear();
    ActivityPage activityPage = downstreamJob.getActivityPage().open();
    find("//*[contains(text(),'Started by upstream pipeline')]").isVisible();
    downstreamJob.getRunDetailsPipelinePage().open(2);
    find("//*[contains(text(),'Started by upstream pipeline')]").isVisible();
}
Also used : ActivityPage(io.blueocean.ath.pages.blue.ActivityPage) FreestyleJob(io.blueocean.ath.model.FreestyleJob) ClassicPipeline(io.blueocean.ath.model.ClassicPipeline) Test(org.junit.Test) BlueOceanAcceptanceTest(io.blueocean.ath.BlueOceanAcceptanceTest)

Example 5 with FreestyleJob

use of io.blueocean.ath.model.FreestyleJob in project blueocean-plugin by jenkinsci.

the class FavoritesNavigationTest method testFreestyle.

@Test
public void testFreestyle() throws IOException {
    String jobName = "navigation-freestyle";
    FreestyleJob freestyle = freestyleFactory.pipeline(FOLDER, jobName).create("echo hi");
    String fullName = freestyle.getFullName();
    // build and wait for completion so that "run details" link works
    freestyle.build();
    sseClient.untilEvents(SSEEvents.activityComplete(fullName));
    addAsFavorite(freestyle);
    checkRunDetails(freestyle);
    back();
    checkActivity(freestyle).toggleFavorite();
    back();
    dashboardPage.checkFavoriteCardCount(0);
}
Also used : FreestyleJob(io.blueocean.ath.model.FreestyleJob) Test(org.junit.Test)

Aggregations

FreestyleJob (io.blueocean.ath.model.FreestyleJob)5 Test (org.junit.Test)5 BlueOceanAcceptanceTest (io.blueocean.ath.BlueOceanAcceptanceTest)2 ClassicPipeline (io.blueocean.ath.model.ClassicPipeline)1 ActivityPage (io.blueocean.ath.pages.blue.ActivityPage)1