]> source.dussan.org Git - sonarqube.git/commitdiff
fix issues bulk change
authorStas Vilchik <vilchiks@gmail.com>
Thu, 10 Nov 2016 08:39:43 +0000 (09:39 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 10 Nov 2016 08:39:43 +0000 (09:39 +0100)
it/it-tests/src/test/java/it/issue/IssueSearchTest.java
it/it-tests/src/test/resources/issue/IssueSearchTest/bulk_change.html [new file with mode: 0644]
server/sonar-web/src/main/js/apps/component-issues/app.js
server/sonar-web/src/main/js/apps/issues/app.js

index 12ceaa1ac3b12426e27c8944d4b84113dd77b3bc..a18d05fdf4478384710e57a004a2d4457f80d2ae 100644 (file)
@@ -310,6 +310,13 @@ public class IssueSearchTest extends AbstractIssueTest {
     assertThat(searchIssues(new SearchWsRequest().setTypes(singletonList("VULNERABILITY"))).getPaging().getTotal()).isEqualTo(8);
   }
 
+  @Test
+  public void bulk_change() {
+    ORCHESTRATOR.executeSelenese(Selenese.builder().setHtmlTestsInClasspath("bulk_change",
+      "/issue/IssueSearchTest/bulk_change.html"
+    ).build());
+  }
+
   private List<org.sonarqube.ws.Issues.Issue> searchByRuleKey(String... ruleKey) throws IOException {
     return searchIssues(new SearchWsRequest().setRules(asList(ruleKey))).getIssuesList();
   }
diff --git a/it/it-tests/src/test/resources/issue/IssueSearchTest/bulk_change.html b/it/it-tests/src/test/resources/issue/IssueSearchTest/bulk_change.html
new file mode 100644 (file)
index 0000000..95dd44f
--- /dev/null
@@ -0,0 +1,98 @@
+<?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"/>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<tbody>
+<tr>
+       <td>open</td>
+       <td>/sessions/logout</td>
+       <td></td>
+</tr>
+<tr>
+       <td>open</td>
+       <td>/sessions/new</td>
+       <td></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>id=login</td>
+       <td>admin</td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>id=password</td>
+       <td>admin</td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>commit</td>
+       <td></td>
+</tr>
+<tr>
+       <td>open</td>
+       <td>/issues</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForText</td>
+       <td>css=.js-issue-transition</td>
+       <td>*Open*</td>
+</tr>
+<tr>
+       <td>waitForElementPresent</td>
+       <td>id=issues-bulk-change</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>id=issues-bulk-change</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForElementPresent</td>
+       <td>css=#issues-bulk-change + .dropdown-menu .js-bulk-change</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>css=#issues-bulk-change + .dropdown-menu .js-bulk-change</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForElementPresent</td>
+       <td>id=bulk-change-form</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForElementPresent</td>
+       <td>id=transition-confirm</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>id=transition-confirm</td>
+       <td></td>
+</tr>
+<tr>
+       <td>click</td>
+       <td>id=bulk-change-submit</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForElementNotPresent</td>
+       <td>id=bulk-change-form</td>
+       <td></td>
+</tr>
+<tr>
+       <td>waitForText</td>
+       <td>css=.js-issue-transition</td>
+       <td>*Confirmed*</td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
index a2f24c52aaf9c957cb18b17e2150a8d8c6cceb6f..7768330dd439660bb2c37f95a5a9678212a7bc72 100644 (file)
@@ -37,6 +37,7 @@ const init = function () {
 
   this.config = options.config;
   this.state = new State({
+    canBulkChange: !!window.SS.user,
     isContext: true,
     contextQuery: { componentUuids: options.config.resource },
     contextComponentUuid: options.config.resource,
index 4c15e33a8c2b01a171990b66912a72acbde6a9b6..bc083906618319e85b9a7f346fc66b1edadb1125 100644 (file)
@@ -34,7 +34,7 @@ const App = new Marionette.Application();
 const init = function () {
   const options = window.sonarqube;
 
-  this.state = new State();
+  this.state = new State({ canBulkChange: !!window.SS.user });
   this.list = new Issues();
   this.facets = new Facets();