use of pageobjects.ProjectActivityPage in project sonarqube by SonarSource.
the class QualityGateUiTest method display_alerts_correctly_in_history_page.
/**
* SONAR-3326
*/
@Test
public void display_alerts_correctly_in_history_page() {
QualityGateClient qgClient = qgClient();
QualityGate qGate = qgClient.create("AlertsForHistory");
qgClient.setDefault(qGate.id());
String firstAnalysisDate = DateFormatUtils.ISO_DATE_FORMAT.format(addDays(new Date(), -2));
String secondAnalysisDate = DateFormatUtils.ISO_DATE_FORMAT.format(addDays(new Date(), -1));
// with this configuration, project should have an Orange alert
QualityGateCondition lowThresholds = qgClient.createCondition(NewCondition.create(qGate.id()).metricKey("lines").operator("GT").warningThreshold("5").errorThreshold("50"));
scanSampleWithDate(firstAnalysisDate);
// with this configuration, project should have a Green alert
qgClient.updateCondition(UpdateCondition.create(lowThresholds.id()).metricKey("lines").operator("GT").warningThreshold("5000").errorThreshold("5000"));
scanSampleWithDate(secondAnalysisDate);
ProjectActivityPage page = Navigation.get(orchestrator).openProjectActivity("sample");
page.assertFirstAnalysisOfTheDayHasText(secondAnalysisDate, "Green (was Orange)").assertFirstAnalysisOfTheDayHasText(firstAnalysisDate, "Orange");
qgClient.unsetDefault();
qgClient.destroy(qGate.id());
}
use of pageobjects.ProjectActivityPage in project sonarqube by SonarSource.
the class ProjectActivityPageTest method should_list_snapshots.
@Test
public void should_list_snapshots() {
analyzeProject("shared/xoo-history-v1", "2014-10-19");
analyzeProject("shared/xoo-history-v2", "2014-11-13");
ProjectActivityPage page = openPage();
page.getAnalyses().shouldHaveSize(2);
List<ProjectAnalysisItem> analyses = page.getAnalysesAsItems();
analyses.get(0).shouldHaveEventWithText("1.0-SNAPSHOT").shouldNotHaveDeleteButton();
analyses.get(1).shouldHaveEventWithText("0.9-SNAPSHOT").shouldHaveDeleteButton();
}
Aggregations