diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-12-09 17:25:52 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-12-09 17:25:59 +0100 |
commit | a749013e0af281ac0eb19f35fe9f282f3bc80121 (patch) | |
tree | dc0befba441da2d4e4a1becb3a9f35be015c6c85 /it | |
parent | 02dbaef58e3ef830faec084461bb8295a11a6769 (diff) | |
download | sonarqube-a749013e0af281ac0eb19f35fe9f282f3bc80121.tar.gz sonarqube-a749013e0af281ac0eb19f35fe9f282f3bc80121.zip |
hide number of failing tasks on then project level page
Diffstat (limited to 'it')
3 files changed, 132 insertions, 0 deletions
diff --git a/it/it-tests/src/test/java/it/Category1Suite.java b/it/it-tests/src/test/java/it/Category1Suite.java index 97489650fcc..2bcf718ffa9 100644 --- a/it/it-tests/src/test/java/it/Category1Suite.java +++ b/it/it-tests/src/test/java/it/Category1Suite.java @@ -52,6 +52,7 @@ import it.measureHistory.HistoryUiTest; 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; @@ -76,6 +77,7 @@ import static util.ItUtils.xooPlugin; // project administration BulkDeletionTest.class, ProjectAdministrationTest.class, + BackgroundTasksTest.class, // project pages ProjectOverviewTest.class, // settings diff --git a/it/it-tests/src/test/java/it/projectAdministration/BackgroundTasksTest.java b/it/it-tests/src/test/java/it/projectAdministration/BackgroundTasksTest.java new file mode 100644 index 00000000000..93b92400d90 --- /dev/null +++ b/it/it-tests/src/test/java/it/projectAdministration/BackgroundTasksTest.java @@ -0,0 +1,55 @@ +/* + * 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) + ); + } +} diff --git a/it/it-tests/src/test/resources/projectAdministration/BackgroundTasksTest/should_not_display_failing_and_search_and_filter_elements_on_project_level_page.html b/it/it-tests/src/test/resources/projectAdministration/BackgroundTasksTest/should_not_display_failing_and_search_and_filter_elements_on_project_level_page.html new file mode 100644 index 00000000000..06f59df2058 --- /dev/null +++ b/it/it-tests/src/test/resources/projectAdministration/BackgroundTasksTest/should_not_display_failing_and_search_and_filter_elements_on_project_level_page.html @@ -0,0 +1,75 @@ +<?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> |