aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/test
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-08-11 14:26:30 +0200
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-08-14 11:44:44 +0200
commitd74de53a7245cb970e7e62057dab72eccec6bdc2 (patch)
tree6ece5a1af3a9e6b7bed1e03abe5c84567bd52ea3 /tests/src/test
parentd1feeda71f72903179446ba1d3c170414bd1ff2b (diff)
downloadsonarqube-d74de53a7245cb970e7e62057dab72eccec6bdc2.tar.gz
sonarqube-d74de53a7245cb970e7e62057dab72eccec6bdc2.zip
In facet header now only the text is clickable
Diffstat (limited to 'tests/src/test')
-rw-r--r--tests/src/test/java/org/sonarqube/pageobjects/measures/MeasuresPage.java11
-rw-r--r--tests/src/test/java/org/sonarqube/tests/measure/ProjectMeasuresPageTest.java7
2 files changed, 15 insertions, 3 deletions
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/measures/MeasuresPage.java b/tests/src/test/java/org/sonarqube/pageobjects/measures/MeasuresPage.java
index bd239267c44..414b7f8c61b 100644
--- a/tests/src/test/java/org/sonarqube/pageobjects/measures/MeasuresPage.java
+++ b/tests/src/test/java/org/sonarqube/pageobjects/measures/MeasuresPage.java
@@ -25,6 +25,7 @@ import org.openqa.selenium.Keys;
import static com.codeborne.selenide.Condition.exist;
import static com.codeborne.selenide.Condition.text;
import static com.codeborne.selenide.Selenide.$;
+import static com.codeborne.selenide.Selenide.$$;
public class MeasuresPage {
public MeasuresPage() {
@@ -75,9 +76,17 @@ public class MeasuresPage {
return this;
}
+ public MeasuresPage openFacet(String facet) {
+ SelenideElement facetBox = $$(".search-navigator-facet-box").find(text(facet));
+ if(!facetBox.find("search-navigator-facet-list").isDisplayed()) {
+ facetBox.$(".search-navigator-facet-header a").should(exist).click();
+ }
+ return this;
+ }
+
public MeasureContent openMeasureContent(String measure) {
SelenideElement sidebar = this.getSideBar();
- SelenideElement facetItem = sidebar.$("#measure-" + measure + "-name").should(exist);
+ SelenideElement facetItem = sidebar.$("#measure-" + measure + "-name");
facetItem.click();
MeasureContent content = new MeasureContent($("#component-measures .measure-details-content").should(exist));
content.shouldHaveTitle(facetItem.getText());
diff --git a/tests/src/test/java/org/sonarqube/tests/measure/ProjectMeasuresPageTest.java b/tests/src/test/java/org/sonarqube/tests/measure/ProjectMeasuresPageTest.java
index c92cb765471..158bada7d37 100644
--- a/tests/src/test/java/org/sonarqube/tests/measure/ProjectMeasuresPageTest.java
+++ b/tests/src/test/java/org/sonarqube/tests/measure/ProjectMeasuresPageTest.java
@@ -73,6 +73,7 @@ public class ProjectMeasuresPageTest {
MeasuresPage page = tester.openBrowser().openProjectMeasures(projectKey);
page
.displayBubbleChart("Risk")
+ .openFacet("Maintainability")
.measureHasValue("code_smells", 0)
.measureHasLeak("new_code_smells", 0);
page
@@ -84,7 +85,8 @@ public class ProjectMeasuresPageTest {
@Test
public void should_drilldown_on_list_view() {
MeasuresPage page = tester.openBrowser().openProjectMeasures(projectKey);
- MeasureContent content = page.openMeasureContent("ncloc");
+ MeasureContent content = page
+ .openFacet("Size").openMeasureContent("ncloc");
content
.drillDown("src/main/xoo/sample/Sample.xoo")
.shouldHaveHeaderValue("13")
@@ -99,7 +101,8 @@ public class ProjectMeasuresPageTest {
@Test
public void should_drilldown_on_tree_view() {
MeasuresPage page = tester.openBrowser().openProjectMeasures(projectKey);
- MeasureContent content = page.openMeasureContent("ncloc");
+ MeasureContent content = page
+ .openFacet("Size").openMeasureContent("ncloc");
page.switchView("tree");
content
.shouldHaveFile("src/main/xoo/sample");