diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-07-07 16:21:18 +0200 |
---|---|---|
committer | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-07-13 14:34:17 +0200 |
commit | f0da51dc6ad711b31f92af91050357d41187eb5b (patch) | |
tree | 19b800b190b238ed4d9e15c373008baf36323370 /tests | |
parent | b5e582ccc44788e5d57dde7df2ed0b0050f82c1a (diff) | |
download | sonarqube-f0da51dc6ad711b31f92af91050357d41187eb5b.tar.gz sonarqube-f0da51dc6ad711b31f92af91050357d41187eb5b.zip |
SONAR-8611 Add shortcuts to project activity page on project dashboard
Diffstat (limited to 'tests')
-rw-r--r-- | tests/src/test/java/org/sonarqube/pageobjects/ProjectDashboardPage.java | 9 | ||||
-rw-r--r-- | tests/src/test/java/org/sonarqube/tests/measure/ProjectDashboardTest.java | 16 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/ProjectDashboardPage.java b/tests/src/test/java/org/sonarqube/pageobjects/ProjectDashboardPage.java index f576ea4cc32..60969c43fa5 100644 --- a/tests/src/test/java/org/sonarqube/pageobjects/ProjectDashboardPage.java +++ b/tests/src/test/java/org/sonarqube/pageobjects/ProjectDashboardPage.java @@ -19,13 +19,16 @@ */ package org.sonarqube.pageobjects; +import com.codeborne.selenide.ElementsCollection; import com.codeborne.selenide.SelenideElement; import java.util.Arrays; import static com.codeborne.selenide.Condition.exist; import static com.codeborne.selenide.Condition.hasText; +import static com.codeborne.selenide.Condition.text; import static com.codeborne.selenide.Condition.visible; import static com.codeborne.selenide.Selenide.$; +import static com.codeborne.selenide.Selenide.$$; public class ProjectDashboardPage { @@ -45,6 +48,12 @@ public class ProjectDashboardPage { return element; } + public SelenideElement getOverviewMeasure(String measure) { + ElementsCollection measures = $$(".overview-domain-measure"); + SelenideElement element = measures.find(text(measure)).shouldBe(visible); + return element; + } + private SelenideElement getTagsMeta() { SelenideElement element = $(".overview-meta-tags"); element.shouldBe(visible); diff --git a/tests/src/test/java/org/sonarqube/tests/measure/ProjectDashboardTest.java b/tests/src/test/java/org/sonarqube/tests/measure/ProjectDashboardTest.java index 584938877da..956c8e7f109 100644 --- a/tests/src/test/java/org/sonarqube/tests/measure/ProjectDashboardTest.java +++ b/tests/src/test/java/org/sonarqube/tests/measure/ProjectDashboardTest.java @@ -34,8 +34,10 @@ import org.sonarqube.pageobjects.Navigation; import org.sonarqube.pageobjects.ProjectDashboardPage; import util.user.UserRule; +import static com.codeborne.selenide.Condition.exist; import static com.codeborne.selenide.Condition.hasText; import static com.codeborne.selenide.Condition.text; +import static com.codeborne.selenide.Condition.visible; import static util.ItUtils.newAdminWsClient; import static util.ItUtils.projectDir; import static util.selenium.Selenese.runSelenese; @@ -122,6 +124,20 @@ public class ProjectDashboardTest { } @Test + public void display_project_activity_shortcut() { + executeBuild("shared/xoo-sample", "sample-with-tags", "Sample with tags"); + // Add some tags to another project to have them in the list + wsClient.wsConnector().call( + new PostRequest("api/project_tags/set") + .setParam("project", "sample-with-tags") + .setParam("tags", "foo,bar,baz")); + + executeBuild("shared/xoo-sample", "sample", "Sample"); + ProjectDashboardPage page = nav.logIn().submitCredentials(adminUser).openProjectDashboard("sample"); + page.getOverviewMeasure("Debt").$(".overview-domain-measure-history-link").should(exist); + } + + @Test @Ignore("there is no more place to show the error") public void display_a_nice_error_when_requesting_unknown_project() { Navigation nav = Navigation.create(orchestrator); |