diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-11-09 11:55:48 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-11-09 11:55:48 +0100 |
commit | 093b8c8fb43af25b04355cbfd81b4686d9f363ec (patch) | |
tree | 4074c5ffac444f9214b4d428c2ff24d924bf86f1 /it | |
parent | bacbaa6550cb7f31e52414ceebb6ac918d1b6dde (diff) | |
download | sonarqube-093b8c8fb43af25b04355cbfd81b4686d9f363ec.tar.gz sonarqube-093b8c8fb43af25b04355cbfd81b4686d9f363ec.zip |
bugfix: project permissions page shows all projects
Diffstat (limited to 'it')
2 files changed, 125 insertions, 0 deletions
diff --git a/it/it-tests/src/test/java/it/projectAdministration/ProjectPermissionsTest.java b/it/it-tests/src/test/java/it/projectAdministration/ProjectPermissionsTest.java new file mode 100644 index 00000000000..504dbe9d365 --- /dev/null +++ b/it/it-tests/src/test/java/it/projectAdministration/ProjectPermissionsTest.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 ProjectPermissionsTest { + + @ClassRule + public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR; + + @Test + public void test_project_permissions_page_shows_only_single_project() throws Exception { + executeBuild("project-permissions-project", "Test Project"); + executeBuild("project-permissions-project-2", "Another Test Project"); + + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("project_permissions_page_shows_only_single_project", + "/projectAdministration/ProjectPermissionsTest/test_project_permissions_page_shows_only_single_project.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/ProjectPermissionsTest/test_project_permissions_page_shows_only_single_project.html b/it/it-tests/src/test/resources/projectAdministration/ProjectPermissionsTest/test_project_permissions_page_shows_only_single_project.html new file mode 100644 index 00000000000..c9eb0c8cec7 --- /dev/null +++ b/it/it-tests/src/test/resources/projectAdministration/ProjectPermissionsTest/test_project_permissions_page_shows_only_single_project.html @@ -0,0 +1,70 @@ +<?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>test_project_overview_after_first_analysis</title> +</head> +<body> +<table cellpadding="1" cellspacing="1" border="1"> + <thead> + <tr> + <td rowspan="1" colspan="3">test_project_overview_after_first_analysis</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_roles?id=project-permissions-project</td> + <td></td> + </tr> + <tr> + <td>waitForElementPresent</td> + <td>css=#projects</td> + <td></td> + </tr> + <tr> + <td>assertNotText</td> + <td>css=#projects</td> + <td>*Another Test Project*</td> + </tr> + <tr> + <td>assertElementNotPresent</td> + <td>css=footer</td> + <td></td> + </tr> + <tr> + <td>assertElementNotPresent</td> + <td>css=.search-box</td> + <td></td> + </tr> + </tbody> +</table> +</body> +</html> |