aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-06-23 11:45:49 +0200
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-07-04 14:15:34 +0200
commitd55ab331ed66b29cfd99c0a41f94c4ddf521f4ca (patch)
treebb561751117453751b27af781dece5661da143b1 /tests/src
parentb41d68b7105b3d9704319183dcb7e573e6dd1386 (diff)
downloadsonarqube-d55ab331ed66b29cfd99c0a41f94c4ddf521f4ca.tar.gz
sonarqube-d55ab331ed66b29cfd99c0a41f94c4ddf521f4ca.zip
SONAR-8550 Group analyses by version in the project activity list
Diffstat (limited to 'tests/src')
-rw-r--r--tests/src/test/java/org/sonarqube/pageobjects/ProjectAnalysisItem.java23
-rw-r--r--tests/src/test/java/org/sonarqube/tests/projectEvent/ProjectActivityPageTest.java8
2 files changed, 17 insertions, 14 deletions
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/ProjectAnalysisItem.java b/tests/src/test/java/org/sonarqube/pageobjects/ProjectAnalysisItem.java
index 2589fa20f02..dfd1520b812 100644
--- a/tests/src/test/java/org/sonarqube/pageobjects/ProjectAnalysisItem.java
+++ b/tests/src/test/java/org/sonarqube/pageobjects/ProjectAnalysisItem.java
@@ -39,16 +39,19 @@ public class ProjectAnalysisItem {
}
public ProjectAnalysisItem shouldHaveDeleteButton() {
+ elt.find(".js-analysis-actions").click();
elt.find(".js-delete-analysis").shouldBe(visible);
return this;
}
public ProjectAnalysisItem shouldNotHaveDeleteButton() {
+ elt.find(".js-analysis-actions").click();
elt.find(".js-delete-analysis").shouldNotBe(visible);
return this;
}
public void delete() {
+ elt.find(".js-analysis-actions").click();
elt.find(".js-delete-analysis").click();
SelenideElement modal = $(".modal");
@@ -59,7 +62,7 @@ public class ProjectAnalysisItem {
}
public ProjectAnalysisItem addCustomEvent(String name) {
- elt.find(".js-create").click();
+ elt.find(".js-analysis-actions").click();
elt.find(".js-add-event").click();
SelenideElement modal = $(".modal");
@@ -67,30 +70,28 @@ public class ProjectAnalysisItem {
modal.find("input").setValue(name);
modal.find("button[type=\"submit\"]").click();
- elt.find(".project-activity-event:last-child").shouldHave(text(name));
-
+ elt.find(".project-activity-event:first-child").shouldHave(text(name));
return this;
}
- public ProjectAnalysisItem changeLastEvent(String newName) {
- SelenideElement lastEvent = elt.find(".project-activity-event:last-child");
- lastEvent.find(".js-change-event").click();
+ public ProjectAnalysisItem changeFirstEvent(String newName) {
+ SelenideElement firstEvent = elt.find(".project-activity-event:first-child");
+ firstEvent.find(".js-change-event").click();
SelenideElement modal = $(".modal");
modal.shouldBe(visible);
modal.find("input").setValue(newName);
modal.find("button[type=\"submit\"]").click();
- lastEvent.shouldHave(text(newName));
-
+ firstEvent.shouldHave(text(newName));
return this;
}
- public ProjectAnalysisItem deleteLastEvent() {
+ public ProjectAnalysisItem deleteFirstEvent() {
int eventsCount = elt.findAll(".project-activity-event").size();
- SelenideElement lastEvent = elt.find(".project-activity-event:last-child");
- lastEvent.find(".js-delete-event").click();
+ SelenideElement firstEvent = elt.find(".project-activity-event:first-child");
+ firstEvent.find(".js-delete-event").click();
SelenideElement modal = $(".modal");
modal.shouldBe(visible);
diff --git a/tests/src/test/java/org/sonarqube/tests/projectEvent/ProjectActivityPageTest.java b/tests/src/test/java/org/sonarqube/tests/projectEvent/ProjectActivityPageTest.java
index 5a10c83e607..d6514a930f0 100644
--- a/tests/src/test/java/org/sonarqube/tests/projectEvent/ProjectActivityPageTest.java
+++ b/tests/src/test/java/org/sonarqube/tests/projectEvent/ProjectActivityPageTest.java
@@ -72,15 +72,17 @@ public class ProjectActivityPageTest {
analyzeProject();
openPage().getLastAnalysis()
.addCustomEvent("foo")
- .changeLastEvent("bar")
- .deleteLastEvent();
+ .changeFirstEvent("bar")
+ .deleteFirstEvent();
}
@Test
public void delete_analysis() {
analyzeProject();
analyzeProject();
- openPage().getFirstAnalysis().delete();
+ ProjectActivityPage page = openPage();
+ page.getAnalyses().shouldHaveSize(2);
+ page.getFirstAnalysis().delete();
}
private ProjectActivityPage openPage() {