import it.measureHistory.SincePreviousVersionHistoryTest;
import it.measureHistory.SinceXDaysHistoryTest;
import it.measureHistory.TimeMachineTest;
+import it.projectAdministration.BackgroundTasksTest;
import it.projectAdministration.BulkDeletionTest;
import it.projectAdministration.ProjectAdministrationTest;
import it.projectOverview.ProjectOverviewTest;
// project administration
BulkDeletionTest.class,
ProjectAdministrationTest.class,
+ BackgroundTasksTest.class,
// project pages
ProjectOverviewTest.class,
// settings
--- /dev/null
+/*
+ * 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.projectAdministration;
+
+import com.sonar.orchestrator.Orchestrator;
+import com.sonar.orchestrator.build.SonarRunner;
+import com.sonar.orchestrator.selenium.Selenese;
+import it.Category1Suite;
+import org.junit.ClassRule;
+import org.junit.Test;
+import util.selenium.SeleneseTest;
+
+import static util.ItUtils.projectDir;
+
+public class BackgroundTasksTest {
+
+ @ClassRule
+ public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR;
+
+ @Test
+ public void should_not_display_failing_and_search_and_filter_elements_on_project_level_page() throws Exception {
+ executeBuild("test-project", "Test Project");
+ executeBuild("test-project-2", "Another Test Project");
+
+ Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("should_not_display_failing_and_search_and_filter_elements_on_project_level_page",
+ "/projectAdministration/BackgroundTasksTest/should_not_display_failing_and_search_and_filter_elements_on_project_level_page.html"
+ ).build();
+ new SeleneseTest(selenese).runOn(orchestrator);
+ }
+
+ private void executeBuild(String projectKey, String projectName) {
+ orchestrator.executeBuild(
+ SonarRunner.create(projectDir("shared/xoo-sample"))
+ .setProjectKey(projectKey)
+ .setProjectName(projectName)
+ );
+ }
+}
--- /dev/null
+<?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>should_not_display_failing_and_search_and_filter_elements_on_project_level_page</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <thead>
+ <tr>
+ <td rowspan="1" colspan="3">should_not_display_failing_and_search_and_filter_elements_on_project_level_page</td>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/sessions/logout</td>
+ <td></td>
+</tr>
+<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/project/background_tasks?id=test-project</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>css=.background-tasks .badge</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertNotText</td>
+ <td>css=.background-tasks</td>
+ <td>*Another Test Project*</td>
+</tr>
+<tr>
+ <td>assertElementNotPresent</td>
+ <td>css=.search-box</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertNotText</td>
+ <td>css=#content</td>
+ <td>*still failing*</td>
+</tr>
+<tr>
+ <td>assertElementNotPresent</td>
+ <td>css=.icon-filter</td>
+ <td></td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
statusFilter: STATUSES.FAILED,
currentsFilter: CURRENTS.ONLY_CURRENTS,
activityPage: 1
- },
- this.requestActivity);
+ }, this.requestActivity);
},
onTaskCanceled(task) {
<div className="page">
<Header/>
- <Stats {...this.state} cancelPending={this.cancelPending} showFailures={this.showFailures}/>
+ <Stats
+ {...this.props}
+ {...this.state}
+ cancelPending={this.cancelPending}
+ showFailures={this.showFailures}/>
- <Search {...this.props} {...this.state}
+ <Search
+ {...this.props}
+ {...this.state}
refresh={this.requestData}
onStatusChange={this.onStatusChange}
onCurrentsChange={this.onCurrentsChange}
onDateChange={this.onDateChange}
onSearch={this.onSearch}/>
- <Tasks {...this.props}
+ <Tasks
+ {...this.props}
tasks={[].concat(this.state.queue, this.state.activity)}
onTaskCanceled={this.onTaskCanceled}
onFilter={this.handleFilter}/>
- <ListFooter count={this.state.queue.length + this.state.activity.length}
- total={this.state.queue.length + this.state.activityTotal}
- loadMore={this.loadMore}/>
+ <ListFooter
+ count={this.state.queue.length + this.state.activity.length}
+ total={this.state.queue.length + this.state.activityTotal}
+ loadMore={this.loadMore}/>
</div>
);
}
if (this.props.failuresCount == null) {
return null;
}
+
+ if (this.props.options.component) {
+ return null;
+ }
+
if (this.props.failuresCount > 0) {
return (
<span>