From 918c696cba5e96ffcd474a85d85d326bb9cb206b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Aubert?= Date: Mon, 24 Jul 2017 09:56:31 +0200 Subject: [PATCH] Fix unstable IT bulk_apply_permission_template --- .../org/sonarqube/pageobjects/ProjectsManagementPage.java | 1 + .../projectAdministration/ProjectAdministrationTest.java | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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) { -- 2.39.5