From: Grégoire Aubert Date: Mon, 24 Jul 2017 07:56:31 +0000 (+0200) Subject: Fix unstable IT bulk_apply_permission_template X-Git-Tag: 6.5-RC2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=918c696cba5e96ffcd474a85d85d326bb9cb206b;p=sonarqube.git Fix unstable IT bulk_apply_permission_template --- diff --git a/tests/src/test/java/org/sonarqube/pageobjects/ProjectsManagementPage.java b/tests/src/test/java/org/sonarqube/pageobjects/ProjectsManagementPage.java index eded1c27bfc..f359ed761d5 100644 --- a/tests/src/test/java/org/sonarqube/pageobjects/ProjectsManagementPage.java +++ b/tests/src/test/java/org/sonarqube/pageobjects/ProjectsManagementPage.java @@ -58,6 +58,7 @@ public class ProjectsManagementPage { .shouldHave(CollectionCondition.sizeGreaterThan(0)) .findBy(text("foo-template")).should(exist).click(); $(".modal .js-apply").should(exist).click(); + $(".modal-body .alert-success").should(exist); return this; } } 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 89598145a91..0cd466e725b 100644 --- a/tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectAdministrationTest.java +++ b/tests/src/test/java/org/sonarqube/tests/projectAdministration/ProjectAdministrationTest.java @@ -42,6 +42,7 @@ import org.sonar.wsclient.user.UserParameters; import org.sonarqube.pageobjects.Navigation; import org.sonarqube.pageobjects.settings.SettingsPage; import org.sonarqube.tests.Tester; +import org.sonarqube.ws.WsPermissions; import org.sonarqube.ws.client.permission.AddUserToTemplateWsRequest; import org.sonarqube.ws.client.permission.CreateTemplateWsRequest; import org.sonarqube.ws.client.permission.UsersWsRequest; @@ -214,10 +215,12 @@ public class ProjectAdministrationTest { ProjectsManagementPage page = nav.logIn().submitCredentials(adminUser).openProjectsManagement(); page.shouldHaveProject(project); page.bulkApplyPermissionTemplate("foo-template"); - assertThat(tester.wsClient().permissions().users(new UsersWsRequest() + WsPermissions.UsersWsResponse usersResponse = tester.wsClient().permissions().users(new UsersWsRequest() .setProjectKey(project) .setPermission("admin") - ).getUsers(0).getLogin()).isEqualTo(user); + ); + assertThat(usersResponse.getUsersCount()).isEqualTo(1); + assertThat(usersResponse.getUsers(0).getLogin()).isEqualTo(user); } private void scanSampleWithDate(String date) {