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);
}
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());
}
Aggregations