From 7d034a6d0d9991c251757eb9ab72bd37ac97b6ab Mon Sep 17 00:00:00 2001 From: Grégoire Aubert Date: Thu, 24 Aug 2017 09:23:21 +0200 Subject: SONAR-9747 Make components and global settings independant from each others in the ui --- .../ProjectAdministrationTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/src') diff --git a/tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectAdministrationTest.java b/tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectAdministrationTest.java index 0cd466e725b..8e1a210c12c 100644 --- a/tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectAdministrationTest.java +++ b/tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectAdministrationTest.java @@ -21,6 +21,7 @@ package org.sonarqube.tests.projectAdministration; import com.sonar.orchestrator.Orchestrator; import com.sonar.orchestrator.build.SonarScanner; +import org.openqa.selenium.By; import org.sonarqube.pageobjects.ProjectsManagementPage; import org.sonarqube.tests.Category1Suite; import java.io.UnsupportedEncodingException; @@ -47,6 +48,7 @@ import org.sonarqube.ws.client.permission.AddUserToTemplateWsRequest; import org.sonarqube.ws.client.permission.CreateTemplateWsRequest; import org.sonarqube.ws.client.permission.UsersWsRequest; +import static com.codeborne.selenide.Selenide.$; import static org.apache.commons.lang.time.DateUtils.addDays; import static org.assertj.core.api.Assertions.assertThat; import static util.ItUtils.getComponent; @@ -192,6 +194,22 @@ public class ProjectAdministrationTest { .assertStringSettingValue("sonar.dbcleaner.daysBeforeDeletingClosedIssues", "1"); } + @Test + public void display_correct_global_setting () throws UnsupportedEncodingException { + scanSample(null, null); + SettingsPage page = nav.logIn().submitCredentials(adminUser).openSettings("sample") + .openCategory("Analysis Scope") + .assertSettingDisplayed("sonar.coverage.exclusions") + .setStringValue("sonar.coverage.exclusions", "foo") + .assertStringSettingValue("sonar.coverage.exclusions", "foo"); + + $(".global-navbar-menu ").$(By.linkText("Administration")).click(); + page + .openCategory("Analysis Scope") + .assertSettingDisplayed("sonar.coverage.exclusions") + .assertStringSettingValue("sonar.coverage.exclusions", ""); + } + @Test public void display_module_settings() throws UnsupportedEncodingException { orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-multi-modules-sample"))); -- cgit v1.2.3