diff options
21 files changed, 807 insertions, 25 deletions
diff --git a/it/it-tests/src/test/java/it/Category1Suite.java b/it/it-tests/src/test/java/it/Category1Suite.java index b5bdb5574da..73152c2c2d5 100644 --- a/it/it-tests/src/test/java/it/Category1Suite.java +++ b/it/it-tests/src/test/java/it/Category1Suite.java @@ -56,8 +56,7 @@ import it.measureHistory.TimeMachineTest; import it.projectAdministration.BackgroundTasksTest; import it.projectAdministration.BulkDeletionTest; import it.projectAdministration.ProjectAdministrationTest; -import it.projectServices.ProjectCodeTest; -import it.projectServices.ProjectOverviewTest; +import it.projectServices.*; import it.qualityGate.QualityGateNotificationTest; import it.qualityGate.QualityGateTest; import it.qualityGate.QualityGateUiTest; @@ -84,6 +83,10 @@ import static util.ItUtils.xooPlugin; // project pages ProjectOverviewTest.class, ProjectCodeTest.class, + ProjectDrilldownTest.class, + ProjectComparisonTest.class, + AllProjectsTest.class, + ProjectWidgetsTest.class, // settings PropertySetsTest.class, SubCategoriesTest.class, diff --git a/it/it-tests/src/test/java/it/projectComparison/ToDoTest.java b/it/it-tests/src/test/java/it/projectComparison/ToDoTest.java deleted file mode 100644 index fe4e779462f..00000000000 --- a/it/it-tests/src/test/java/it/projectComparison/ToDoTest.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package it.projectComparison; - -public class ToDoTest { -} diff --git a/it/it-tests/src/test/java/it/projectServices/AllProjectsTest.java b/it/it-tests/src/test/java/it/projectServices/AllProjectsTest.java new file mode 100644 index 00000000000..77fff59038c --- /dev/null +++ b/it/it-tests/src/test/java/it/projectServices/AllProjectsTest.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2009-2014 SonarSource SA + * All rights reserved + * mailto:contact AT sonarsource DOT com + */ +package it.projectServices; + +import com.sonar.orchestrator.Orchestrator; +import com.sonar.orchestrator.build.SonarRunner; +import com.sonar.orchestrator.selenium.Selenese; +import it.Category1Suite; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Test; +import util.selenium.SeleneseTest; + +import static util.ItUtils.projectDir; + +public class AllProjectsTest { + + @ClassRule + public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR; + + @BeforeClass + public static void inspectProject() { + orchestrator.executeBuild( + SonarRunner.create(projectDir("shared/xoo-sample")) + .setProjectKey("all-project-test-project") + .setProjectName("AllProjectsTest Project") + ); + } + + @Test + public void test_all_projects_page() { + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("test_all_projects_page", + "/projectServices/AllProjectsTest/test_all_projects_page.html" + ).build(); + new SeleneseTest(selenese).runOn(orchestrator); + } + +} diff --git a/it/it-tests/src/test/java/it/projectServices/ProjectComparisonTest.java b/it/it-tests/src/test/java/it/projectServices/ProjectComparisonTest.java new file mode 100644 index 00000000000..ae8faaf4b09 --- /dev/null +++ b/it/it-tests/src/test/java/it/projectServices/ProjectComparisonTest.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2009-2014 SonarSource SA + * All rights reserved + * mailto:contact AT sonarsource DOT com + */ +package it.projectServices; + +import com.sonar.orchestrator.Orchestrator; +import com.sonar.orchestrator.build.SonarRunner; +import com.sonar.orchestrator.selenium.Selenese; +import it.Category1Suite; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Test; +import util.selenium.SeleneseTest; + +import static util.ItUtils.projectDir; + +public class ProjectComparisonTest { + + @ClassRule + public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR; + + @BeforeClass + public static void inspectProject() { + orchestrator.executeBuild( + SonarRunner.create(projectDir("shared/xoo-sample")) + .setProjectKey("project-comparison-test-project") + .setProjectName("ProjectComparisonTest Project") + ); + } + + @Test + @Ignore("need to find a way to type into invisible input fields") + public void test_project_comparison_service() { + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("test_project_comparison_service", + "/projectServices/ProjectComparisonTest/should-display-basic-set-of-metrics.html", + "/projectServices/ProjectComparisonTest/should-add-projects.html", + "/projectServices/ProjectComparisonTest/should-move-and-remove-projects.html", + "/projectServices/ProjectComparisonTest/should-add-metrics.html", + "/projectServices/ProjectComparisonTest/should-not-add-differential-metrics.html", + "/projectServices/ProjectComparisonTest/should-move-and-remove-metrics.html" + ).build(); + new SeleneseTest(selenese).runOn(orchestrator); + } + +} diff --git a/it/it-tests/src/test/java/it/projectServices/ProjectDrilldownTest.java b/it/it-tests/src/test/java/it/projectServices/ProjectDrilldownTest.java new file mode 100644 index 00000000000..e885160ca2f --- /dev/null +++ b/it/it-tests/src/test/java/it/projectServices/ProjectDrilldownTest.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2009-2014 SonarSource SA + * All rights reserved + * mailto:contact AT sonarsource DOT com + */ +package it.projectServices; + +import com.sonar.orchestrator.Orchestrator; +import com.sonar.orchestrator.build.SonarRunner; +import com.sonar.orchestrator.selenium.Selenese; +import it.Category1Suite; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Test; +import org.sonar.wsclient.Sonar; +import org.sonar.wsclient.services.Resource; +import org.sonar.wsclient.services.ResourceQuery; +import util.selenium.SeleneseTest; + +import java.util.List; + +import static util.ItUtils.projectDir; + +public class ProjectDrilldownTest { + + @ClassRule + public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR; + + @BeforeClass + public static void inspectProject() { + orchestrator.executeBuild( + SonarRunner.create(projectDir("shared/xoo-sample")) + .setProjectKey("project-drilldown-test-project") + .setProjectName("ProjectDrilldownTest Project") + ); + } + + @Test + public void should_display_measure_drilldown() { + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("should_display_measure_drilldown", + "/projectServices/ProjectDrilldownTest/should_display_measure_drilldown.html" + ).build(); + new SeleneseTest(selenese).runOn(orchestrator); + } + +} diff --git a/it/it-tests/src/test/java/it/projectServices/ProjectOverviewTest.java b/it/it-tests/src/test/java/it/projectServices/ProjectOverviewTest.java index 1e95ac126fb..c079be46c25 100644 --- a/it/it-tests/src/test/java/it/projectServices/ProjectOverviewTest.java +++ b/it/it-tests/src/test/java/it/projectServices/ProjectOverviewTest.java @@ -74,6 +74,13 @@ public class ProjectOverviewTest { new SeleneseTest(selenese).runOn(orchestrator); } + @Test + public void should_display_a_nice_error_when_requesting_unknown_project() { + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("should_display_a_nice_error_when_requesting_unknown_project", + "/projectServices/ProjectOverviewTest/should-display-nice-error-on-unknown-project.html").build(); + orchestrator.executeSelenese(selenese); + } + private void executeBuild(String projectLocation, String projectKey, String projectName) { orchestrator.executeBuild( SonarRunner.create(projectDir(projectLocation)) diff --git a/it/it-tests/src/test/java/it/projectServices/ProjectWidgetsTest.java b/it/it-tests/src/test/java/it/projectServices/ProjectWidgetsTest.java new file mode 100644 index 00000000000..47be732c8ab --- /dev/null +++ b/it/it-tests/src/test/java/it/projectServices/ProjectWidgetsTest.java @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2009-2014 SonarSource SA + * All rights reserved + * mailto:contact AT sonarsource DOT com + */ +package it.projectServices; + +import com.sonar.orchestrator.Orchestrator; +import com.sonar.orchestrator.build.SonarRunner; +import com.sonar.orchestrator.selenium.Selenese; +import it.Category1Suite; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Test; +import org.sonar.wsclient.services.ResourceQuery; +import util.selenium.SeleneseTest; + +import static util.ItUtils.projectDir; + +public class ProjectWidgetsTest { + + @ClassRule + public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR; + + @BeforeClass + public static void inspectProject() { + orchestrator.executeBuild( + SonarRunner.create(projectDir("shared/xoo-sample")) + .setProjectKey("project-widgets-test-project") + .setProjectName("ProjectWidgetsTest Project") + ); + } + + @Test + public void hotspots() { + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("hotspots", + "/projectServices/ProjectWidgetsTest/hotspots/hotspot-metric-widget.html", + "/projectServices/ProjectWidgetsTest/hotspots/hide-if-no-measures.html" + ).build(); + new SeleneseTest(selenese).runOn(orchestrator); + } + + @Test + public void complexity() { + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("complexity", + "/projectServices/ProjectWidgetsTest/complexity/complexity-widget.html" + ).build(); + new SeleneseTest(selenese).runOn(orchestrator); + } + + @Test + public void description() { + long projectId = orchestrator.getServer().getWsClient() + .find(ResourceQuery.create("project-widgets-test-project")).getId(); + long qualityGateId = orchestrator.getServer().adminWsClient().qualityGateClient().show("SonarQube way").id(); + orchestrator.getServer().adminWsClient().qualityGateClient().selectProject(qualityGateId, projectId); + + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("description", + "/projectServices/ProjectWidgetsTest/description/description-widget.html" + ).build(); + new SeleneseTest(selenese).runOn(orchestrator); + } + + @Test + @Ignore + public void custom_measures() { + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("custom_measures", + "/projectServices/ProjectWidgetsTest/custom_measures/should-exclude-new-metrics.html" + ).build(); + new SeleneseTest(selenese).runOn(orchestrator); + } + +} diff --git a/it/it-tests/src/test/resources/projectServices/AllProjectsTest/test_all_projects_page.html b/it/it-tests/src/test/resources/projectServices/AllProjectsTest/test_all_projects_page.html new file mode 100644 index 00000000000..551ede118ed --- /dev/null +++ b/it/it-tests/src/test/resources/projectServices/AllProjectsTest/test_all_projects_page.html @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>should-display-all-projects-page</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<tbody> +<tr> + <td>open</td> + <td>/all_projects?qualifier=TRK</td> + <td></td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*All Projects*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*Name*</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*AllProjectsTest Project*</td> +</tr> +</tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-add-metrics.html b/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-add-metrics.html new file mode 100644 index 00000000000..7ed09d6219a --- /dev/null +++ b/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-add-metrics.html @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>should-add-metrics</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <tbody> + <tr> + <td>open</td> + <td>/comparison/index</td> + <td></td> + </tr> + <tr> + <td>assertNotText</td> + <td>comparison-page</td> + <td>*Major issues*</td> + </tr> + <tr> + <td>waitForElementPresent</td> + <td>new_metric</td> + <td></td> + </tr> + <tr> + <td>typeAndWait</td> + <td>new_metric</td> + <td>major_violations</td> + </tr> + <tr> + <td>assertText</td> + <td>comparison-page</td> + <td>*Lines of code*Complexity*Comments (%)*Duplicated lines (%)*Issues*Coverage*Major issues*</td> + </tr> + </tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-add-projects.html b/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-add-projects.html new file mode 100644 index 00000000000..18c882331ad --- /dev/null +++ b/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-add-projects.html @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>should-add-projects</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <tbody> + <tr> + <td>open</td> + <td>/comparison/index</td> + <td></td> +</tr> +<tr> + <td>waitForElementPresent</td> + <td>new_resource</td> + <td></td> +</tr> +<tr> + <td>type</td> + <td>new_resource</td> + <td>project-comparison-test-project</td> +</tr> +<tr> + <td>waitForElementPresent</td> + <td>//option[text()='1.0-SNAPSHOT']</td> + <td></td> +</tr> +<tr> + <td>selectAndWait</td> + <td>new_version</td> + <td>1.0-SNAPSHOT</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*ProjectComparisonTest Project*1.0-SNAPSHOT*</td> +</tr> +</tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-display-basic-set-of-metrics.html b/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-display-basic-set-of-metrics.html new file mode 100644 index 00000000000..491a99caee0 --- /dev/null +++ b/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-display-basic-set-of-metrics.html @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>should-display-basic-set-of-metrics</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <tbody> + <tr> + <td>open</td> + <td>/comparison/index</td> + <td></td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*Lines of code*Complexity*Comments (%)*Duplicated lines (%)*Issues*Coverage*</td> +</tr> +</tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-move-and-remove-metrics.html b/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-move-and-remove-metrics.html new file mode 100644 index 00000000000..c4ae78e748d --- /dev/null +++ b/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-move-and-remove-metrics.html @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>should-move-and-remove-metrics</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <tbody> + <tr> + <td>open</td> + <td>/comparison/index</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>comparison-page</td> + <td>*Lines of code*Complexity*Comments (%)*Duplicated lines (%)*Issues*Coverage*</td> +</tr> +<tr> + <td>clickAndWait</td> + <td>down-0</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>comparison-page</td> + <td>*Complexity*Lines of code*Comments (%)*Duplicated lines (%)*Issues*Coverage*</td> +</tr> +<tr> + <td>clickAndWait</td> + <td>up-5</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>comparison-page</td> + <td>*Complexity*Lines of code*Comments (%)*Duplicated lines (%)*Coverage*Issues*</td> +</tr> +<tr> + <td>assertText</td> + <td>comparison-page</td> + <td>*%*</td> +</tr> +<tr> + <td>clickAndWait</td> + <td>del-m-2</td> + <td></td> +</tr> +<tr> + <td>clickAndWait</td> + <td>del-m-2</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>comparison-page</td> + <td>*Complexity*Lines of code*Coverage*Issues*</td> +</tr> +<tr> + <td>assertNotText</td> + <td>comparison-page</td> + <td>*%*</td> +</tr> +</tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-move-and-remove-projects.html b/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-move-and-remove-projects.html new file mode 100644 index 00000000000..f7d71dbfd2f --- /dev/null +++ b/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-move-and-remove-projects.html @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>should-move-and-remove-projects</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <tbody> + <tr> + <td>open</td> + <td>/comparison/index</td> + <td></td> +</tr> +<tr> + <td>waitForElementPresent</td> + <td>new_resource</td> + <td></td> +</tr> +<tr> + <td>type</td> + <td>new_resource</td> + <td>project-comparison-test-project</td> +</tr> +<tr> + <td>waitForElementPresent</td> + <td>//option[text()='1.0-SNAPSHOT']</td> + <td></td> +</tr> +<tr> + <td>selectAndWait</td> + <td>new_version</td> + <td>1.0-SNAPSHOT</td> +</tr> +<tr> + <td>waitForText</td> + <td>id=content</td> + <td>*ProjectComparisonTest Project*1.0-SNAPSHOT*</td> +</tr> +<tr> + <td>clickAndWait</td> + <td>del-r-0</td> + <td></td> +</tr> +<tr> + <td>assertNotText</td> + <td>id=content</td> + <td>*Sample*</td> +</tr> +</tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-not-add-differential-metrics.html b/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-not-add-differential-metrics.html new file mode 100644 index 00000000000..a47a119367c --- /dev/null +++ b/it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-not-add-differential-metrics.html @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>should-not-add-differential-metrics</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <tbody> + <tr> + <td>open</td> + <td>/comparison/index</td> + <td></td> + </tr> + <tr> + <td>assertText</td> + <td>comparison-page</td> + <td>*Lines of code*Complexity*Comments (%)*Duplicated lines (%)*Issues*Coverage*</td> + </tr> + <tr> + <td>waitForElementPresent</td> + <td>new_metric</td> + <td></td> + </tr> + <tr> + <td>typeAndWait</td> + <td>new_metric</td> + <td>new_violations</td> + </tr> + <tr> + <td>assertText</td> + <td>comparison-page</td> + <td>*Lines of code*Complexity*Comments (%)*Duplicated lines (%)*Issues*Coverage*</td> + </tr> + <tr> + <td>assertNotText</td> + <td>comparison-page</td> + <td>*New Issues*</td> + </tr> + </tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectServices/ProjectDrilldownTest/should_display_measure_drilldown.html b/it/it-tests/src/test/resources/projectServices/ProjectDrilldownTest/should_display_measure_drilldown.html new file mode 100644 index 00000000000..192440c454c --- /dev/null +++ b/it/it-tests/src/test/resources/projectServices/ProjectDrilldownTest/should_display_measure_drilldown.html @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>should_display_measure_drilldown</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <tbody> + <tr> + <td>open</td> + <td>/drilldown/measures?id=project-drilldown-test-project&metric=ncloc</td> + <td></td> +</tr> +<tr> + <td>waitForElementPresent</td> + <td>css=a[data-key="project-drilldown-test-project:src/main/xoo/sample/Sample.xoo"]</td> + <td></td> +</tr> +<tr> + <td>click</td> + <td>css=a[data-key="project-drilldown-test-project:src/main/xoo/sample/Sample.xoo"]</td> + <td></td> +</tr> +<tr> + <td>waitForElementPresent</td> + <td>css=.source-viewer</td> + <td></td> +</tr> +<tr> + <td>waitForText</td> + <td>css=.source-viewer</td> + <td>*src/main/xoo/sample/*Sample.xoo*</td> +</tr> +<tr> + <td>waitForText</td> + <td>css=.source-viewer</td> + <td>*public class Sample {*</td> +</tr> +</tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectServices/ProjectOverviewTest/should-display-nice-error-on-unknown-project.html b/it/it-tests/src/test/resources/projectServices/ProjectOverviewTest/should-display-nice-error-on-unknown-project.html new file mode 100644 index 00000000000..3cbf2bf44fa --- /dev/null +++ b/it/it-tests/src/test/resources/projectServices/ProjectOverviewTest/should-display-nice-error-on-unknown-project.html @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>static-files</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> +<tbody> +<tr> + <td>open</td> + <td>/dashboard/index?id=unknown</td> + <td></td> +</tr> +<tr> + <td>waitForText</td> + <td>error</td> + <td>*The requested project does not exist. Either it has never been analyzed successfully or it has been deleted.*</td> +</tr> +</tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/complexity/complexity-widget.html b/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/complexity/complexity-widget.html new file mode 100644 index 00000000000..e29192aa467 --- /dev/null +++ b/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/complexity/complexity-widget.html @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>complexity</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <thead> + <tr> + <td rowspan="1" colspan="3">complexity</td> + </tr> + </thead> + <tbody> + <tr> + <td>open</td> + <td>/widget?id=complexity&resource=project-widgets-test-project&metric1=complexity&metric2=ncloc&chartTitle=MyWidget</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>block_1</td> + <td>*Complexity*</td> +</tr> +<tr> + <td>assertText</td> + <td>m_class_complexity</td> + <td>3.0</td> +</tr> +<tr> + <td>assertText</td> + <td>m_file_complexity</td> + <td>3.0</td> +</tr> +<tr> + <td>assertText</td> + <td>m_complexity</td> + <td>3</td> +</tr> +</tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/custom_measures/should-exclude-new-metrics.html b/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/custom_measures/should-exclude-new-metrics.html new file mode 100644 index 00000000000..1f059bb1017 --- /dev/null +++ b/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/custom_measures/should-exclude-new-metrics.html @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>should-exclude-new-metrics</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <thead> + <tr> + <td rowspan="1" colspan="3">should-exclude-new-metrics</td> + </tr> + </thead> + <tbody> + <tr> + <td>open</td> + <td>/sessions/new</td> + <td></td> + </tr> + <tr> + <td>type</td> + <td>login</td> + <td>admin</td> + </tr> + <tr> + <td>type</td> + <td>password</td> + <td>admin</td> + </tr> + <tr> + <td>clickAndWait</td> + <td>commit</td> + <td></td> + </tr> + <tr> + <td>clickAndWait</td> + <td>link=Configure widgets</td> + <td></td> + </tr> + <tr> + <td>waitForText</td> + <td>id=content</td> + <td>*History Table*</td> + </tr> + <tr> + <td>clickAndWait</td> + <td>id=add-widget-custom_measures</td> + <td></td> + </tr> + <tr> + <td>waitForText</td> + <td>id=content</td> + <td>*Metric 1*</td> + </tr> + <tr> + <td>assertElementPresent</td> + <td>//div[@class='widget_props' and @style='']//option[text()='Overall condition coverage']</td> + <td></td> + </tr> + <tr> + <td>assertElementNotPresent</td> + <td>//div[@class='widget_props' and @style='']//option[text()='Overall new condition coverage']</td> + <td></td> + </tr> + <tr> + <td>click</td> + <td>link=Delete</td> + <td></td> + </tr> + </tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/description/description-widget.html b/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/description/description-widget.html new file mode 100644 index 00000000000..a3f2b8fdcb6 --- /dev/null +++ b/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/description/description-widget.html @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>description-widget</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <thead> + <tr> + <td rowspan="1" colspan="3">description-widget</td> + </tr> + </thead> + <tbody> + <tr> + <td>open</td> + <td>/widget?id=description&resource=project-widgets-test-project</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>block_1</td> + <td>*ProjectWidgetsTest Project*project-widgets-test-project*Profiles:*Basic*Quality Gate*SonarQube way*</td> +</tr> +</tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/hotspots/hide-if-no-measures.html b/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/hotspots/hide-if-no-measures.html new file mode 100644 index 00000000000..53abb62658a --- /dev/null +++ b/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/hotspots/hide-if-no-measures.html @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>hide-if-no-measures</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <tbody> + <tr> + <td>open</td> + <td>/widget?id=hotspot_metric&resource=project-widgets-test-project&metric=dit</td> + <td></td> +</tr> +<tr> + <td>assertElementPresent</td> + <td>block_1</td> + <td></td> +</tr> +<tr> + <td>assertNotText</td> + <td>block_1</td> + <td>*Depth*</td> +</tr> +</tbody> +</table> +</body> +</html> diff --git a/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/hotspots/hotspot-metric-widget.html b/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/hotspots/hotspot-metric-widget.html new file mode 100644 index 00000000000..9d2358b703a --- /dev/null +++ b/it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/hotspots/hotspot-metric-widget.html @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head profile="http://selenium-ide.openqa.org/profiles/test-case"> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>hotspot_metric</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <thead> + <tr> + <td rowspan="1" colspan="3">hotspot_metric</td> + </tr> + </thead> + <tbody> + <tr> + <td>open</td> + <td>/widget?id=hotspot_metric&resource=project-widgets-test-project&metric=ncloc&title=NewTitle</td> + <td></td> +</tr> +<tr> + <td>assertText</td> + <td>class=hotspot_metric</td> + <td>*NewTitle*Sample.xoo*</td> +</tr> +<tr> + <td>assertElementPresent</td> + <td>link=Sample.xoo</td> + <td></td> +</tr> +</tbody> +</table> +</body> +</html> |