aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-07-15 17:19:26 +0200
committerStas Vilchik <vilchiks@gmail.com>2016-07-15 17:19:32 +0200
commitc525e88aede29f28fdafc9918baaede40c5dc8d4 (patch)
tree64a8f3869f064ffb4c4feba0b1655ac04eb547dd
parentc844886cf44799e77093a2df5e0da8196bacb395 (diff)
downloadsonarqube-c525e88aede29f28fdafc9918baaede40c5dc8d4.tar.gz
sonarqube-c525e88aede29f28fdafc9918baaede40c5dc8d4.zip
fix saving of new issue filter
-rw-r--r--it/it-tests/src/test/java/it/Category2Suite.java2
-rw-r--r--it/it-tests/src/test/java/it/issue/IssuesPageTest.java44
-rw-r--r--it/it-tests/src/test/resources/issue/IssuesPageTest/save_new_issue_filter.html105
-rw-r--r--server/sonar-web/src/main/js/apps/issues/models/filter.js2
4 files changed, 152 insertions, 1 deletions
diff --git a/it/it-tests/src/test/java/it/Category2Suite.java b/it/it-tests/src/test/java/it/Category2Suite.java
index ad57842de3f..e30b9d043f6 100644
--- a/it/it-tests/src/test/java/it/Category2Suite.java
+++ b/it/it-tests/src/test/java/it/Category2Suite.java
@@ -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
index 00000000000..b44df9ce131
--- /dev/null
+++ b/it/it-tests/src/test/java/it/issue/IssuesPageTest.java
@@ -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
index 00000000000..a7686cb8c58
--- /dev/null
+++ b/it/it-tests/src/test/resources/issue/IssuesPageTest/save_new_issue_filter.html
@@ -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>
diff --git a/server/sonar-web/src/main/js/apps/issues/models/filter.js b/server/sonar-web/src/main/js/apps/issues/models/filter.js
index d976adf5349..b09fdbf61b0 100644
--- a/server/sonar-web/src/main/js/apps/issues/models/filter.js
+++ b/server/sonar-web/src/main/js/apps/issues/models/filter.js
@@ -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) {