Search in sources :

Example 1 with BranchPage

use of io.blueocean.ath.pages.blue.BranchPage in project blueocean-plugin by jenkinsci.

the class NavigationTest method testBranchHistory.

/**
 * This test clicks on the history button on a branch, and makes sure that it navigates to the activity page
 * on the correct url.
 */
@Test
public void testBranchHistory() throws IOException, GitAPIException {
    git.writeJenkinsFile(loadJenkinsFile());
    git.addAll();
    git.commit("Added Jenkinsfile");
    git.createBranch("feature/1");
    git.createBranch("feature@2");
    MultiBranchPipeline pipeline = multiBranchPipelineFactory.pipeline(Folder.folders("a folder", "bfolder", "folder"), "NavigationTest_testNavigation");
    pipeline.createPipeline(git);
    dashboardPage.open();
    dashboardPage.clickPipeline(pipeline.getName());
    ActivityPage activityPage = pipeline.getActivityPage().checkUrl();
    BranchPage branchPage = activityPage.clickBranchTab();
    branchPage.clickHistoryButton("feature/1");
    activityPage.open();
    activityPage.getRunRowForBranch("feature@2").click();
    pipeline.getRunDetailsPipelinePage().checkUrl("feature%402", 1);
    pipeline.getRunDetailsPipelinePage().checkBasicDomElements();
}
Also used : ActivityPage(io.blueocean.ath.pages.blue.ActivityPage) MultiBranchPipeline(io.blueocean.ath.model.MultiBranchPipeline) BranchPage(io.blueocean.ath.pages.blue.BranchPage) Test(org.junit.Test) BlueOceanAcceptanceTest(io.blueocean.ath.BlueOceanAcceptanceTest)

Example 2 with BranchPage

use of io.blueocean.ath.pages.blue.BranchPage in project blueocean-plugin by jenkinsci.

the class GithubEditorTest method testEditor.

/**
 * This test covers e2e usage of the editor.
 *
 * Creates a blank github repo, and then uses editor to create a simple pipeline.
 */
@Test
public void testEditor() throws IOException {
    creationPage.createPipeline(token, organization, repo, true);
    MultiBranchPipeline pipeline = mbpFactory.pipeline(repo);
    editorPage.simplePipeline();
    ActivityPage activityPage = pipeline.getActivityPage().checkUrl();
    driver.navigate().refresh();
    sseClient.untilEvents(pipeline.buildsFinished);
    sseClient.clear();
    BranchPage branchPage = activityPage.clickBranchTab();
    branchPage.openEditor("master");
    editorPage.saveBranch("new - branch");
    activityPage.checkUrl();
    activityPage.getRunRowForBranch("new-branch");
    sseClient.untilEvents(pipeline.buildsFinished);
}
Also used : ActivityPage(io.blueocean.ath.pages.blue.ActivityPage) MultiBranchPipeline(io.blueocean.ath.model.MultiBranchPipeline) BranchPage(io.blueocean.ath.pages.blue.BranchPage) Test(org.junit.Test)

Example 3 with BranchPage

use of io.blueocean.ath.pages.blue.BranchPage in project blueocean-plugin by jenkinsci.

the class GithubEditorTest method testEditorParallel.

/**
 * This test covers e2e usage of the editor. Does so with a parallel pipeline.
 *
 * Creates a blank github repo, and then uses editor to create a parallel pipeline.
 */
@Test
public void testEditorParallel() throws IOException {
    creationPage.createPipeline(token, organization, repo, true);
    MultiBranchPipeline pipeline = mbpFactory.pipeline(repo);
    editorPage.parallelPipeline("branch-with-parallels", 3);
    ActivityPage activityPage = pipeline.getActivityPage().checkUrl();
    driver.navigate().refresh();
    sseClient.untilEvents(pipeline.buildsFinished);
    sseClient.clear();
    BranchPage branchPage = activityPage.clickBranchTab();
    branchPage.openEditor("branch-with-parallels");
    editorPage.saveBranch("new - branch");
    activityPage.checkUrl();
    activityPage.getRunRowForBranch("branch-with-parallels");
    sseClient.untilEvents(pipeline.buildsFinished);
}
Also used : ActivityPage(io.blueocean.ath.pages.blue.ActivityPage) MultiBranchPipeline(io.blueocean.ath.model.MultiBranchPipeline) BranchPage(io.blueocean.ath.pages.blue.BranchPage) Test(org.junit.Test)

Example 4 with BranchPage

use of io.blueocean.ath.pages.blue.BranchPage in project blueocean-plugin by jenkinsci.

the class FavoritesNavigationTest method testMultibranch.

@Test
public void testMultibranch() throws IOException, GitAPIException {
    String branchMaster = "master";
    String branchOther = "feature/1";
    git.writeJenkinsFile(resources.loadJenkinsFile());
    git.addAll();
    git.commit("First");
    git.createBranch(branchOther);
    String jobName = "navigation-multibranch";
    MultiBranchPipeline pipeline = multibranchFactory.pipeline(FOLDER, jobName).createPipeline(git);
    String fullName = pipeline.getFullName();
    // the basics
    addAsFavorite(pipeline);
    checkRunDetails(pipeline);
    back();
    checkActivity(pipeline);
    dashboardPage.open();
    // check the branches tab
    BranchPage branches = navigateBranches(pipeline).checkFavoriteStatus(branchMaster, true).checkFavoriteStatus(branchOther, false).toggleFavoriteStatus(branchOther);
    // test linking to run details
    branches.openRunDetails(branchMaster).checkBasicDomElements().back();
    branches.openRunDetails(branchOther).checkBasicDomElements().back();
    // check dashboard favorites
    go(-2);
    dashboardPage.checkFavoriteCardCount(2);
}
Also used : MultiBranchPipeline(io.blueocean.ath.model.MultiBranchPipeline) BranchPage(io.blueocean.ath.pages.blue.BranchPage) Test(org.junit.Test)

Aggregations

MultiBranchPipeline (io.blueocean.ath.model.MultiBranchPipeline)4 BranchPage (io.blueocean.ath.pages.blue.BranchPage)4 Test (org.junit.Test)4 ActivityPage (io.blueocean.ath.pages.blue.ActivityPage)3 BlueOceanAcceptanceTest (io.blueocean.ath.BlueOceanAcceptanceTest)1