]> source.dussan.org Git - sonarqube.git/commitdiff
fix saving of new issue filter
authorStas Vilchik <vilchiks@gmail.com>
Fri, 15 Jul 2016 15:19:26 +0000 (17:19 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 15 Jul 2016 15:19:32 +0000 (17:19 +0200)
it/it-tests/src/test/java/it/Category2Suite.java
it/it-tests/src/test/java/it/issue/IssuesPageTest.java [new file with mode: 0644]
it/it-tests/src/test/resources/issue/IssuesPageTest/save_new_issue_filter.html [new file with mode: 0644]
server/sonar-web/src/main/js/apps/issues/models/filter.js

index ad57842de3f5d48e5be8b9a3917a887fcefe0435..e30b9d043f6af3aff20810be22e113b1ce614faf 100644 (file)
@@ -36,6 +36,7 @@ import it.issue.IssuePurgeTest;
 import it.issue.IssueSearchTest;
 import it.issue.IssueTrackingTest;
 import it.issue.IssueWorkflowTest;
+import it.issue.IssuesPageTest;
 import it.issue.NewIssuesMeasureTest;
 import it.qualityModel.MaintainabilityMeasureTest;
 import it.qualityModel.MaintainabilityRatingMeasureTest;
@@ -84,6 +85,7 @@ import static util.ItUtils.xooPlugin;
   IssueSearchTest.class,
   IssueTrackingTest.class,
   IssueWorkflowTest.class,
+  IssuesPageTest.class,
   NewIssuesMeasureTest.class,
   // debt
   MaintainabilityMeasureTest.class,
diff --git a/it/it-tests/src/test/java/it/issue/IssuesPageTest.java b/it/it-tests/src/test/java/it/issue/IssuesPageTest.java
new file mode 100644 (file)
index 0000000..b44df9c
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * 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.issue;
+
+import com.sonar.orchestrator.Orchestrator;
+import com.sonar.orchestrator.selenium.Selenese;
+import it.Category2Suite;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import util.QaOnly;
+import util.selenium.SeleneseTest;
+
+@Category(QaOnly.class)
+public class IssuesPageTest {
+
+  @ClassRule
+  public static Orchestrator orchestrator = Category2Suite.ORCHESTRATOR;
+
+  @Test
+  public void save_new_issue_filter() throws Exception {
+    Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("save_new_issue_filter",
+      "/issue/IssuesPageTest/save_new_issue_filter.html"
+    ).build();
+    new SeleneseTest(selenese).runOn(orchestrator);
+  }
+}
diff --git a/it/it-tests/src/test/resources/issue/IssuesPageTest/save_new_issue_filter.html b/it/it-tests/src/test/resources/issue/IssuesPageTest/save_new_issue_filter.html
new file mode 100644 (file)
index 0000000..a7686cb
--- /dev/null
@@ -0,0 +1,105 @@
+<?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"/>
+    <link rel="selenium.base" href="http://localhost:49506"/>
+    <title>save_new_issue_filter</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">save_new_issue_filter</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+       <td>open</td>
+       <td>/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>waitForElementPresent</td>
+       <td>css=.js-user-authenticated</td>
+       <td></td>
+</tr>
+<tr>
+       <td>open</td>
+       <td>/issues/search</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForElementPresent</td>
+       <td>css=.js-facet[data-value=&quot;BUG&quot;]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>css=.js-facet[data-value=&quot;BUG&quot;]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForElementPresent</td>
+       <td>css=.js-facet.active[data-value=&quot;BUG&quot;]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>css=.js-filter-save-as</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForElementPresent</td>
+       <td>css=input[name=&quot;name&quot;]</td>
+       <td></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>name</td>
+       <td>test</td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>description</td>
+       <td>super filter</td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>css=#save-as-submit</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForText</td>
+       <td>css=.issues-filters-name</td>
+       <td>*test*</td>
+</tr>
+<tr>
+       <td>waitForText</td>
+       <td>css=.search-navigator-filters-description</td>
+       <td>*super filter*</td>
+</tr>
+<tr>
+       <td>waitForElementPresent</td>
+       <td>css=.js-facet.active[data-value=&quot;BUG&quot;]</td>
+       <td></td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
index d976adf534907a90068211c9066658b60fd55e85..b09fdbf61b06473a46f09781ea4055ca7ee99992 100644 (file)
@@ -21,7 +21,7 @@ import Backbone from 'backbone';
 
 export default Backbone.Model.extend({
   url () {
-    return window.baseUrl + '/api/issue_filters/show/' + this.id;
+    return window.baseUrl + '/api/issue_filters/show?id=' + this.id;
   },
 
   parse (r) {