Search in sources :

Example 6 with ActivityPage

use of io.blueocean.ath.pages.blue.ActivityPage 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 7 with ActivityPage

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

the class CommitMessagesTest method commitMessagesTest.

/**
 * This tests the commit messages are being picked up from git and displayed on the run in activity.
 */
@Test
public void commitMessagesTest() throws IOException, GitAPIException {
    final String pipelineName = "CommitMessagesTest_commitMessagesTest";
    final String branchName = "master";
    URL jenkinsFile = getResourceURL("Jenkinsfile");
    Files.copy(new File(jenkinsFile.getFile()), new File(git.gitDirectory, "Jenkinsfile"));
    git.addAll();
    git.commit("initial commit");
    logger.info("Commited Jenkinsfile");
    MultiBranchPipeline pipeline = mbpFactory.pipeline(pipelineName).createPipeline(git);
    sseClientRule.untilEvents(pipeline.buildsFinished);
    sseClientRule.clear();
    JGitTestUtil.writeTrashFile(git.client.getRepository(), "trash", "hi");
    git.addAll();
    git.commit("2nd commit");
    logger.info("Commited a second time");
    pipeline.buildBranch(branchName);
    sseClientRule.untilEvents(pipeline.buildsFinished);
    ActivityPage activityPage = pipeline.getActivityPage().open();
    activityPage.checkForCommitMessage("2nd commit");
    // Do some assertions on the run data
    WebElement row = activityPage.getRunRowForBranch(branchName);
    List<WebElement> cells = row.findElements(activityPage.getSelectorForRowCells());
    assertEquals("Number of cells in row", 8, cells.size());
    assertEquals("Branch label cell text", branchName, cells.get(3).getText());
    assertNotEquals("Run duration cell text", "-", cells.get(5).getText().trim());
    activityPage.assertIsDuration(cells.get(5).getText());
}
Also used : ActivityPage(io.blueocean.ath.pages.blue.ActivityPage) MultiBranchPipeline(io.blueocean.ath.model.MultiBranchPipeline) WebElement(org.openqa.selenium.WebElement) File(java.io.File) URL(java.net.URL) Test(org.junit.Test) BlueOceanAcceptanceTest(io.blueocean.ath.BlueOceanAcceptanceTest)

Aggregations

ActivityPage (io.blueocean.ath.pages.blue.ActivityPage)7 MultiBranchPipeline (io.blueocean.ath.model.MultiBranchPipeline)5 Test (org.junit.Test)5 BlueOceanAcceptanceTest (io.blueocean.ath.BlueOceanAcceptanceTest)3 BranchPage (io.blueocean.ath.pages.blue.BranchPage)3 Retry (io.blueocean.ath.Retry)1 ClassicPipeline (io.blueocean.ath.model.ClassicPipeline)1 FreestyleJob (io.blueocean.ath.model.FreestyleJob)1 PullRequestsPage (io.blueocean.ath.pages.blue.PullRequestsPage)1 File (java.io.File)1 URL (java.net.URL)1 GHContentUpdateResponse (org.kohsuke.github.GHContentUpdateResponse)1 WebElement (org.openqa.selenium.WebElement)1