]> source.dussan.org Git - sonarqube.git/commitdiff
migrate project services tests
authorStas Vilchik <vilchiks@gmail.com>
Fri, 5 Feb 2016 09:09:13 +0000 (10:09 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 5 Feb 2016 09:09:13 +0000 (10:09 +0100)
21 files changed:
it/it-tests/src/test/java/it/Category1Suite.java
it/it-tests/src/test/java/it/projectComparison/ToDoTest.java [deleted file]
it/it-tests/src/test/java/it/projectServices/AllProjectsTest.java [new file with mode: 0644]
it/it-tests/src/test/java/it/projectServices/ProjectComparisonTest.java [new file with mode: 0644]
it/it-tests/src/test/java/it/projectServices/ProjectDrilldownTest.java [new file with mode: 0644]
it/it-tests/src/test/java/it/projectServices/ProjectOverviewTest.java
it/it-tests/src/test/java/it/projectServices/ProjectWidgetsTest.java [new file with mode: 0644]
it/it-tests/src/test/resources/projectServices/AllProjectsTest/test_all_projects_page.html [new file with mode: 0644]
it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-add-metrics.html [new file with mode: 0644]
it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-add-projects.html [new file with mode: 0644]
it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-display-basic-set-of-metrics.html [new file with mode: 0644]
it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-move-and-remove-metrics.html [new file with mode: 0644]
it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-move-and-remove-projects.html [new file with mode: 0644]
it/it-tests/src/test/resources/projectServices/ProjectComparisonTest/should-not-add-differential-metrics.html [new file with mode: 0644]
it/it-tests/src/test/resources/projectServices/ProjectDrilldownTest/should_display_measure_drilldown.html [new file with mode: 0644]
it/it-tests/src/test/resources/projectServices/ProjectOverviewTest/should-display-nice-error-on-unknown-project.html [new file with mode: 0644]
it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/complexity/complexity-widget.html [new file with mode: 0644]
it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/custom_measures/should-exclude-new-metrics.html [new file with mode: 0644]
it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/description/description-widget.html [new file with mode: 0644]
it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/hotspots/hide-if-no-measures.html [new file with mode: 0644]
it/it-tests/src/test/resources/projectServices/ProjectWidgetsTest/hotspots/hotspot-metric-widget.html [new file with mode: 0644]

index b5bdb5574da8a727d3ee04f42265b002ab8a8a21..73152c2c2d5b3fea060d5eff5f0519a949213bfb 100644 (file)
@@ -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 (file)
index fe4e779..0000000
+++ /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 (file)
index 0000000..77fff59
--- /dev/null
@@ -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 (file)
index 0000000..ae8faaf
--- /dev/null
@@ -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 (file)
index 0000000..e885160
--- /dev/null
@@ -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);
+  }
+
+}
index 1e95ac126fb90ff05d5f46ae4d9c5d28cefe41a7..c079be46c25ed56b2922c13a48800fde94f951df 100644 (file)
@@ -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 (file)
index 0000000..47be732
--- /dev/null
@@ -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 (file)
index 0000000..551ede1
--- /dev/null
@@ -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 (file)
index 0000000..7ed09d6
--- /dev/null
@@ -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 (file)
index 0000000..18c8823
--- /dev/null
@@ -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 (file)
index 0000000..491a99c
--- /dev/null
@@ -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 (file)
index 0000000..c4ae78e
--- /dev/null
@@ -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 (file)
index 0000000..f7d71db
--- /dev/null
@@ -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 (file)
index 0000000..a47a119
--- /dev/null
@@ -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 (file)
index 0000000..192440c
--- /dev/null
@@ -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&amp;metric=ncloc</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForElementPresent</td>
+       <td>css=a[data-key=&quot;project-drilldown-test-project:src/main/xoo/sample/Sample.xoo&quot;]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>css=a[data-key=&quot;project-drilldown-test-project:src/main/xoo/sample/Sample.xoo&quot;]</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 (file)
index 0000000..3cbf2bf
--- /dev/null
@@ -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 (file)
index 0000000..e29192a
--- /dev/null
@@ -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&amp;resource=project-widgets-test-project&amp;metric1=complexity&amp;metric2=ncloc&amp;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 (file)
index 0000000..1f059bb
--- /dev/null
@@ -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 (file)
index 0000000..a3f2b8f
--- /dev/null
@@ -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&amp;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 (file)
index 0000000..53abb62
--- /dev/null
@@ -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&amp;resource=project-widgets-test-project&amp;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 (file)
index 0000000..9d2358b
--- /dev/null
@@ -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&amp;resource=project-widgets-test-project&amp;metric=ncloc&amp;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>