public ReportBuilder( List<String> jsonReports, File reportDirectory, String pluginUrlPath, String buildNumber, String buildProject, boolean skippedFails, boolean undefinedFails, boolean flashCharts, boolean runWithJenkins, boolean artifactsEnabled, String artifactConfig) throws Exception { ConfigurationOptions.setSkippedFailsBuild(skippedFails); ConfigurationOptions.setUndefinedFailsBuild(undefinedFails); ConfigurationOptions.setArtifactsEnabled(artifactsEnabled); if (artifactsEnabled) { ArtifactProcessor artifactProcessor = new ArtifactProcessor(artifactConfig); ConfigurationOptions.setArtifactConfiguration(artifactProcessor.process()); } ReportParser reportParser = new ReportParser(jsonReports); this.ri = new ReportInformation(reportParser.getFeatures()); this.reportDirectory = reportDirectory; this.buildNumber = buildNumber; this.buildProject = buildProject; this.pluginUrlPath = getPluginUrlPath(pluginUrlPath); this.flashCharts = flashCharts; this.runWithJenkins = runWithJenkins; this.artifactsEnabled = artifactsEnabled; }
@Test public void shouldDisplayArtifacts() throws Exception { ConfigurationOptions.setArtifactsEnabled(true); String configuration = "Account has sufficient funds again~the account balance is 300~balance~account_balance.txt~xml"; ArtifactProcessor artifactProcessor = new ArtifactProcessor(configuration); Map<String, Artifact> map = artifactProcessor.process(); ConfigurationOptions.setArtifactConfiguration(map); reportInformation = new ReportInformation(reportParser.getFeatures()); assertThat( reportInformation.getFeatures().get(2).getElements().get(7).getSteps().get(0).getName(), is( "<div class=\"passed\"><span class=\"step-keyword\">Given </span><span class=\"step-name\">the account <div style=\"display:none;\"><textarea id=\"Account_has_sufficient_funds_againthe_account_balance_is_300\" class=\"brush: xml;\"></textarea></div><a onclick=\"applyArtifact('Account_has_sufficient_funds_againthe_account_balance_is_300','account_balance.txt')\" href=\"#\">balance</a> is 300</span><span class=\"step-duration\">0 ms</span></div>")); }