@LocalData public void testMatrixBuildSummary() throws Exception { Hudson hudson = Hudson.getInstance(); List<MatrixProject> projects = hudson.getAllItems(MatrixProject.class); MatrixProject testProject = null; for (MatrixProject project : projects) { System.out.println(project.getName()); if (project.getName().equals("matrix-robot")) testProject = project; } if (testProject == null) fail("Couldn't find example project"); Future<MatrixBuild> run = testProject.scheduleBuild2(0); while (!run.isDone()) { Thread.sleep(5); } Run lastBuild = testProject.getLastBuild(); assertTrue("Build wasn't a success", lastBuild.getResult() == Result.SUCCESS); WebClient wc = getWebClient(); HtmlPage page = wc.goTo("job/matrix-robot"); WebAssert.assertElementPresentByXPath( page, "//div[@id='navigation']//a[@href='/job/matrix-robot/robot']"); WebAssert.assertElementPresentByXPath(page, "//td[@id='main-panel']//img[@src='robot/graph']"); page = wc.goTo("job/matrix-robot/3"); WebAssert.assertElementPresentByXPath( page, "//div[@id='navigation']//a[@href='/job/matrix-robot/3/robot']"); WebAssert.assertElementPresentByXPath( page, "//td[@id='main-panel']//h4[contains(.,'Robot Test Summary:')]"); WebAssert.assertElementPresentByXPath( page, "//td[@id='main-panel']//a[@href='/job/matrix-robot/3/robot' and contains(text(),'Browse results')]"); }