]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6355 Fix IT 605/head
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Wed, 28 Oct 2015 17:04:29 +0000 (18:04 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Fri, 30 Oct 2015 10:25:31 +0000 (11:25 +0100)
12 files changed:
it/it-tests/src/test/java/it/Category1Suite.java
it/it-tests/src/test/java/it/projectAdministration/ProjectAdministrationTest.java
it/it-tests/src/test/java/it/qualityGate/QualityGateNotificationTest.java
it/it-tests/src/test/java/it/qualityGate/QualityGateUiTest.java [new file with mode: 0644]
it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/display-alerts-history-page/should-display-alerts-correctly-history-page.html [deleted file]
it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/display-alerts/should-display-period-alerts-correctly.html [deleted file]
it/it-tests/src/test/resources/qualityGate/QualityGateUiTest/should-display-alerts-correctly-history-page.html [new file with mode: 0644]
it/it-tests/src/test/resources/qualityGate/QualityGateUiTest/should-display-period-alerts-correctly.html [new file with mode: 0644]
it/it-tests/src/test/resources/qualityGate/notifications/activate_notification_channels.html [new file with mode: 0644]
it/it-tests/src/test/resources/qualityGate/notifications/email_configuration.html [new file with mode: 0644]
it/it-tests/src/test/resources/qualitygate/notifications/activate_notification_channels.html [deleted file]
it/it-tests/src/test/resources/qualitygate/notifications/email_configuration.html [deleted file]

index 8c4aca7b0bad1918119c2b9b8f60828dd3f0b705..6cb1b658a8ae841c5eafc1133823f225271101ab 100644 (file)
@@ -51,6 +51,7 @@ import it.projectAdministration.BulkDeletionTest;
 import it.projectAdministration.ProjectAdministrationTest;
 import it.qualityGate.QualityGateNotificationTest;
 import it.qualityGate.QualityGateTest;
+import it.qualityGate.QualityGateUiTest;
 import it.settings.PropertySetsTest;
 import it.settings.SettingsTest;
 import it.settings.SettingsTestRestartingOrchestrator;
@@ -76,6 +77,7 @@ import static util.ItUtils.xooPlugin;
   I18nTest.class,
   // quality gate
   QualityGateTest.class,
+  QualityGateUiTest.class,
   QualityGateNotificationTest.class,
   // permission
   IssuePermissionTest.class,
index d59e2e4d154950412de53cd2b006871be065fd7b..b943c962b54601ce0cbb2503f7fb21124e8c7751 100644 (file)
@@ -35,11 +35,6 @@ import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.sonar.wsclient.SonarClient;
 import org.sonar.wsclient.base.HttpException;
-import org.sonar.wsclient.qualitygate.NewCondition;
-import org.sonar.wsclient.qualitygate.QualityGate;
-import org.sonar.wsclient.qualitygate.QualityGateClient;
-import org.sonar.wsclient.qualitygate.QualityGateCondition;
-import org.sonar.wsclient.qualitygate.UpdateCondition;
 import org.sonar.wsclient.services.PropertyQuery;
 import org.sonar.wsclient.services.ResourceQuery;
 import org.sonar.wsclient.user.UserParameters;
@@ -162,59 +157,6 @@ public class ProjectAdministrationTest {
     assertThat(count("events where category='Version'")).as("Different number of events").isEqualTo(7);
   }
 
-  // SONAR-3326
-  // TODO should be moved to qualityGate
-  @Test
-  public void display_alerts_correctly_in_history_page() {
-    QualityGateClient qgClient = orchestrator.getServer().adminWsClient().qualityGateClient();
-    QualityGate qGate = qgClient.create("AlertsForHistory");
-    qgClient.setDefault(qGate.id());
-
-    // with this configuration, project should have an Orange alert
-    QualityGateCondition lowThresholds = qgClient.createCondition(NewCondition.create(qGate.id()).metricKey("lines").operator("GT").warningThreshold("5").errorThreshold("50"));
-    scanSampleWithDate("2012-01-01");
-    // with this configuration, project should have a Green alert
-    qgClient.updateCondition(UpdateCondition.create(lowThresholds.id()).metricKey("lines").operator("GT").warningThreshold("5000").errorThreshold("5000"));
-    scanSampleWithDate("2012-01-02");
-
-    Selenese selenese = Selenese.builder()
-      .setHtmlTestsInClasspath("display-alerts-history-page",
-        "/projectAdministration/ProjectAdministrationTest/display-alerts-history-page/should-display-alerts-correctly-history-page.html"
-      ).build();
-    new SeleneseTest(selenese).runOn(orchestrator);
-
-    qgClient.unsetDefault();
-    qgClient.destroy(qGate.id());
-  }
-
-  /**
-   * SONAR-1352
-   */
-  // TODO should be moved to qualityGate
-  @Test
-  public void display_period_alert_on_project_dashboard() {
-    QualityGateClient qgClient = orchestrator.getServer().adminWsClient().qualityGateClient();
-    QualityGate qGate = qgClient.create("AlertsForDashboard");
-    qgClient.createCondition(NewCondition.create(qGate.id()).metricKey("lines").operator("LT").warningThreshold("0").errorThreshold("10")
-      .period(1));
-    qgClient.setDefault(qGate.id());
-
-    // No alert
-    scanSampleWithDate("2012-01-01");
-
-    // Red alert because lines number has not changed since previous analysis
-    scanSample();
-
-    Selenese selenese = Selenese.builder()
-      .setHtmlTestsInClasspath("display-period-alerts",
-        "/projectAdministration/ProjectAdministrationTest/display-alerts/should-display-period-alerts-correctly.html"
-      ).build();
-    new SeleneseTest(selenese).runOn(orchestrator);
-
-    qgClient.unsetDefault();
-    qgClient.destroy(qGate.id());
-  }
-
   /**
    * SONAR-3425
    */
index 74ca965d61b43ea3d764cfd85a37e28c51165279..94f1b365f3df5e2735dfaccc384716256072973e 100644 (file)
@@ -11,7 +11,9 @@ import com.sonar.orchestrator.selenium.Selenese;
 import it.Category1Suite;
 import java.util.Iterator;
 import javax.mail.internet.MimeMessage;
+import org.junit.AfterClass;
 import org.junit.Before;
+import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Test;
 import org.sonar.wsclient.Sonar;
@@ -24,11 +26,13 @@ import org.sonar.wsclient.services.Resource;
 import org.sonar.wsclient.services.ResourceQuery;
 import org.subethamail.wiser.Wiser;
 import org.subethamail.wiser.WiserMessage;
+import util.ItUtils;
 import util.NetworkUtils;
 import util.selenium.SeleneseTest;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static util.ItUtils.projectDir;
+import static util.ItUtils.setServerProperty;
 
 public class QualityGateNotificationTest {
 
@@ -37,6 +41,18 @@ public class QualityGateNotificationTest {
   @ClassRule
   public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR;
 
+  @BeforeClass
+  public static void initPeriods() throws Exception {
+    setServerProperty(orchestrator, "sonar.timemachine.period1", "previous_analysis");
+    setServerProperty(orchestrator, "sonar.timemachine.period2", "30");
+    setServerProperty(orchestrator, "sonar.timemachine.period3", "previous_version");
+  }
+
+  @AfterClass
+  public static void resetPeriods() throws Exception {
+    ItUtils.resetPeriods(orchestrator);
+  }
+
   @Before
   public void cleanUp() {
     orchestrator.resetData();
@@ -57,8 +73,8 @@ public class QualityGateNotificationTest {
       Selenese selenese = Selenese
         .builder()
         .setHtmlTestsInClasspath("notifications",
-          "/qualitygate/notifications/email_configuration.html",
-          "/qualitygate/notifications/activate_notification_channels.html").build();
+          "/qualityGate/notifications/email_configuration.html",
+          "/qualityGate/notifications/activate_notification_channels.html").build();
       new SeleneseTest(selenese).runOn(orchestrator);
 
       // Create quality gate with conditions on variations
diff --git a/it/it-tests/src/test/java/it/qualityGate/QualityGateUiTest.java b/it/it-tests/src/test/java/it/qualityGate/QualityGateUiTest.java
new file mode 100644 (file)
index 0000000..94fc164
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2014 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube 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.
+ *
+ * SonarQube 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.qualityGate;
+
+import com.sonar.orchestrator.Orchestrator;
+import com.sonar.orchestrator.build.SonarRunner;
+import com.sonar.orchestrator.selenium.Selenese;
+import it.Category1Suite;
+import javax.annotation.Nullable;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.sonar.wsclient.qualitygate.NewCondition;
+import org.sonar.wsclient.qualitygate.QualityGate;
+import org.sonar.wsclient.qualitygate.QualityGateClient;
+import org.sonar.wsclient.qualitygate.QualityGateCondition;
+import org.sonar.wsclient.qualitygate.UpdateCondition;
+import util.ItUtils;
+import util.selenium.SeleneseTest;
+
+import static util.ItUtils.projectDir;
+import static util.ItUtils.setServerProperty;
+
+public class QualityGateUiTest {
+
+  @ClassRule
+  public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR;
+
+  @BeforeClass
+  public static void initPeriods() throws Exception {
+    setServerProperty(orchestrator, "sonar.timemachine.period1", "previous_analysis");
+    setServerProperty(orchestrator, "sonar.timemachine.period2", "30");
+    setServerProperty(orchestrator, "sonar.timemachine.period3", "previous_version");
+  }
+
+  @AfterClass
+  public static void resetPeriods() throws Exception {
+    ItUtils.resetPeriods(orchestrator);
+  }
+
+  @Before
+  public void cleanUp() {
+    orchestrator.resetData();
+  }
+
+  /**
+   * SONAR-3326
+   */
+  @Test
+  public void display_alerts_correctly_in_history_page() {
+    QualityGateClient qgClient = orchestrator.getServer().adminWsClient().qualityGateClient();
+    QualityGate qGate = qgClient.create("AlertsForHistory");
+    qgClient.setDefault(qGate.id());
+
+    // with this configuration, project should have an Orange alert
+    QualityGateCondition lowThresholds = qgClient.createCondition(NewCondition.create(qGate.id()).metricKey("lines").operator("GT").warningThreshold("5").errorThreshold("50"));
+    scanSampleWithDate("2012-01-01");
+    // with this configuration, project should have a Green alert
+    qgClient.updateCondition(UpdateCondition.create(lowThresholds.id()).metricKey("lines").operator("GT").warningThreshold("5000").errorThreshold("5000"));
+    scanSampleWithDate("2012-01-02");
+
+    new SeleneseTest(Selenese.builder()
+      .setHtmlTestsInClasspath("display-alerts-history-page",
+        "/qualityGate/QualityGateUiTest/should-display-alerts-correctly-history-page.html"
+      ).build()).runOn(orchestrator);
+
+    qgClient.unsetDefault();
+    qgClient.destroy(qGate.id());
+  }
+
+  /**
+   * SONAR-1352
+   */
+  @Test
+  public void display_period_alert_on_project_dashboard() {
+    QualityGateClient qgClient = orchestrator.getServer().adminWsClient().qualityGateClient();
+    QualityGate qGate = qgClient.create("AlertsForDashboard");
+    qgClient.createCondition(NewCondition.create(qGate.id()).metricKey("lines").operator("LT").warningThreshold("0").errorThreshold("10")
+      .period(1));
+    qgClient.setDefault(qGate.id());
+
+    // No alert
+    scanSampleWithDate("2012-01-01");
+
+    // Red alert because lines number has not changed since previous analysis
+    scanSample();
+
+    new SeleneseTest(Selenese.builder()
+      .setHtmlTestsInClasspath("display-period-alerts",
+        "/qualityGate/QualityGateUiTest/should-display-period-alerts-correctly.html"
+      ).build()).runOn(orchestrator);
+
+    qgClient.unsetDefault();
+    qgClient.destroy(qGate.id());
+  }
+
+  private void scanSample() {
+    scanSample(null, null);
+  }
+
+  private void scanSampleWithDate(String date) {
+    scanSample(date, null);
+  }
+
+  private void scanSample(@Nullable String date, @Nullable String profile) {
+    SonarRunner scan = SonarRunner.create(projectDir("shared/xoo-sample"))
+      .setProperties("sonar.cpd.skip", "true");
+    if (date != null) {
+      scan.setProperty("sonar.projectDate", date);
+    }
+    if (profile != null) {
+      scan.setProfile(profile);
+    }
+    orchestrator.executeBuild(scan);
+  }
+
+}
diff --git a/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/display-alerts-history-page/should-display-alerts-correctly-history-page.html b/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/display-alerts-history-page/should-display-alerts-correctly-history-page.html
deleted file mode 100644 (file)
index 4d0d7ac..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<?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-alerts-correctly-history-page</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-  <thead>
-  <tr>
-    <td rowspan="1" colspan="3">should-display-alerts-correctly-history-page</td>
-  </tr>
-  </thead>
-  <tbody>
-  <tr>
-    <td>open</td>
-    <td>/sonar/sessions/login</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>open</td>
-    <td>/sonar/dashboard/index/sample</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>click</td>
-    <td>css=#context-navigation .navbar-admin-link</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>waitForElementPresent</td>
-    <td>link=History</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>clickAndWait</td>
-    <td>link=History</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>assertElementPresent</td>
-    <td>//img[@title='Quality Gate Status: Green (was Orange). ']</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>assertElementPresent</td>
-    <td>//img[@title='Quality Gate Status: Orange. Lines > 5']</td>
-    <td></td>
-  </tr>
-  </tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/display-alerts/should-display-period-alerts-correctly.html b/it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/display-alerts/should-display-period-alerts-correctly.html
deleted file mode 100644 (file)
index 9c4db5c..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?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-alerts-correctly-history-page</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <thead>
-    <tr>
-        <td rowspan="1" colspan="3">should-display-alerts-correctly-history-page</td>
-    </tr>
-    </thead>
-    <tbody>
-    <tr>
-       <td>open</td>
-       <td>/sonar/sessions/login</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>open</td>
-       <td>/sonar/widget?id=alerts&amp;resource=sample</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertText</td>
-       <td>class=alerts</td>
-       <td>glob:*Lines*0 &lt; 10*since previous analysis*</td>
-</tr>
-<tr>
-       <td>assertText</td>
-       <td>class=alert_ERROR</td>
-       <td>0</td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/qualityGate/QualityGateUiTest/should-display-alerts-correctly-history-page.html b/it/it-tests/src/test/resources/qualityGate/QualityGateUiTest/should-display-alerts-correctly-history-page.html
new file mode 100644 (file)
index 0000000..42633d4
--- /dev/null
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ SonarQube, open source software quality management tool.
+  ~ Copyright (C) 2008-2014 SonarSource
+  ~ mailto:contact AT sonarsource DOT com
+  ~
+  ~ SonarQube 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.
+  ~
+  ~ SonarQube 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.
+  -->
+
+<!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-alerts-correctly-history-page</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">should-display-alerts-correctly-history-page</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/login</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>open</td>
+        <td>/sonar/dashboard/index/sample</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>css=#context-navigation .navbar-admin-link</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForElementPresent</td>
+        <td>link=History</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>link=History</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertElementPresent</td>
+        <td>//img[@title='Quality Gate Status: Green (was Orange). ']</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertElementPresent</td>
+        <td>//img[@title='Quality Gate Status: Orange. Lines > 5']</td>
+        <td></td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/qualityGate/QualityGateUiTest/should-display-period-alerts-correctly.html b/it/it-tests/src/test/resources/qualityGate/QualityGateUiTest/should-display-period-alerts-correctly.html
new file mode 100644 (file)
index 0000000..bf5cbf1
--- /dev/null
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ SonarQube, open source software quality management tool.
+  ~ Copyright (C) 2008-2014 SonarSource
+  ~ mailto:contact AT sonarsource DOT com
+  ~
+  ~ SonarQube 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.
+  ~
+  ~ SonarQube 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.
+  -->
+
+<!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-alerts-correctly-history-page</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">should-display-alerts-correctly-history-page</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/login</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>open</td>
+        <td>/sonar/widget?id=alerts&amp;resource=sample</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>class=alerts</td>
+        <td>glob:*Lines*0 &lt; 10*since previous analysis*</td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>class=alert_ERROR</td>
+        <td>0</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/qualityGate/notifications/activate_notification_channels.html b/it/it-tests/src/test/resources/qualityGate/notifications/activate_notification_channels.html
new file mode 100644 (file)
index 0000000..ce8cfc2
--- /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>reate_user_with_email</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">create_user_with_email</td>
+    </tr>
+    </thead>
+    <tbody>
+<tr>
+       <td>open</td>
+       <td>/sonar/sessions/new</td>
+       <td></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>login</td>
+       <td>tester</td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>password</td>
+       <td>tester</td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>commit</td>
+       <td></td>
+</tr>
+<tr>
+       <td>open</td>
+       <td>/sonar/account/index</td>
+       <td></td>
+</tr>
+<tr>
+       <td>check</td>
+       <td>global_notifs_NewAlerts.EmailNotificationChannel</td>
+       <td></td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>//input[@value='Save changes']</td>
+       <td></td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/qualityGate/notifications/email_configuration.html b/it/it-tests/src/test/resources/qualityGate/notifications/email_configuration.html
new file mode 100644 (file)
index 0000000..67b10d7
--- /dev/null
@@ -0,0 +1,64 @@
+<?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>email_configuration</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <tbody>
+    <tr>
+        <td>setTimeout</td>
+        <td>300000</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/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>open</td>
+        <td>/sonar/email_configuration</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertValue</td>
+        <td>smtp_host</td>
+        <td>localhost</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>to_address</td>
+        <td>test@example.org</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>submit_test</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>info</td>
+        <td></td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/qualitygate/notifications/activate_notification_channels.html b/it/it-tests/src/test/resources/qualitygate/notifications/activate_notification_channels.html
deleted file mode 100644 (file)
index ce8cfc2..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?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>reate_user_with_email</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <thead>
-    <tr>
-        <td rowspan="1" colspan="3">create_user_with_email</td>
-    </tr>
-    </thead>
-    <tbody>
-<tr>
-       <td>open</td>
-       <td>/sonar/sessions/new</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>login</td>
-       <td>tester</td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>password</td>
-       <td>tester</td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>commit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/sonar/account/index</td>
-       <td></td>
-</tr>
-<tr>
-       <td>check</td>
-       <td>global_notifs_NewAlerts.EmailNotificationChannel</td>
-       <td></td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>//input[@value='Save changes']</td>
-       <td></td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/qualitygate/notifications/email_configuration.html b/it/it-tests/src/test/resources/qualitygate/notifications/email_configuration.html
deleted file mode 100644 (file)
index 67b10d7..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?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>email_configuration</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-        <td>setTimeout</td>
-        <td>300000</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>open</td>
-        <td>/sonar/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>open</td>
-        <td>/sonar/email_configuration</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertValue</td>
-        <td>smtp_host</td>
-        <td>localhost</td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>to_address</td>
-        <td>test@example.org</td>
-    </tr>
-    <tr>
-        <td>clickAndWait</td>
-        <td>submit_test</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>waitForVisible</td>
-        <td>info</td>
-        <td></td>
-    </tr>
-    </tbody>
-</table>
-</body>
-</html>