diff options
Diffstat (limited to 'tests/src/test')
4 files changed, 15 insertions, 23 deletions
diff --git a/tests/src/test/java/org/sonarqube/pageobjects/ProjectsManagementPage.java b/tests/src/test/java/org/sonarqube/pageobjects/ProjectsManagementPage.java index f359ed761d5..c6dd13c2cbd 100644 --- a/tests/src/test/java/org/sonarqube/pageobjects/ProjectsManagementPage.java +++ b/tests/src/test/java/org/sonarqube/pageobjects/ProjectsManagementPage.java @@ -19,10 +19,9 @@ */ package org.sonarqube.pageobjects; -import com.codeborne.selenide.CollectionCondition; - import static com.codeborne.selenide.Condition.exist; import static com.codeborne.selenide.Condition.text; +import static com.codeborne.selenide.Condition.visible; import static com.codeborne.selenide.Selenide.$; import static com.codeborne.selenide.Selenide.$$; @@ -52,13 +51,11 @@ public class ProjectsManagementPage { } public ProjectsManagementPage bulkApplyPermissionTemplate(String template) { - $(".js-bulk-apply-permission-template").should(exist).click(); - $(".modal .select2-choice").should(exist).click(); - $$(".select2-results li") - .shouldHave(CollectionCondition.sizeGreaterThan(0)) - .findBy(text("foo-template")).should(exist).click(); - $(".modal .js-apply").should(exist).click(); - $(".modal-body .alert-success").should(exist); + $(".js-bulk-apply-permission-template").click(); + $(".modal .Select-value").click(); + $$(".modal .Select-option").findBy(text(template)).click(); + $(".modal-foot button").click(); + $(".modal-body .alert-success").shouldBe(visible); return this; } } diff --git a/tests/src/test/java/org/sonarqube/tests/authorisation/ProvisioningPermissionTest.java b/tests/src/test/java/org/sonarqube/tests/authorisation/ProvisioningPermissionTest.java index 8d3b7ac007a..a71af6eecc5 100644 --- a/tests/src/test/java/org/sonarqube/tests/authorisation/ProvisioningPermissionTest.java +++ b/tests/src/test/java/org/sonarqube/tests/authorisation/ProvisioningPermissionTest.java @@ -95,7 +95,7 @@ public class ProvisioningPermissionTest { * SONAR-4709 */ @Test - public void organization_administrator_cannot_provision_project_if_he_doesnt_have_provisioning_permission() { + public void organization_administrator_cannot_provision_project_if_he_does_not_have_provisioning_permission() { runSelenese(orchestrator, "/authorisation/ProvisioningPermissionTest/should-not-be-able-to-provision-project.html"); } @@ -131,7 +131,7 @@ public class ProvisioningPermissionTest { * SONAR-4709 */ @Test - public void user_cannot_provision_project_through_ws_if_he_doesnt_have_provisioning_permission() { + public void user_cannot_provision_project_through_ws_if_he_does_not_have_provisioning_permission() { thrown.expect(HttpException.class); thrown.expectMessage("403"); diff --git a/tests/src/test/resources/authorisation/ProvisioningPermissionTest/should-be-able-to-provision-project.html b/tests/src/test/resources/authorisation/ProvisioningPermissionTest/should-be-able-to-provision-project.html index 506a921dd4b..c43f94871a0 100644 --- a/tests/src/test/resources/authorisation/ProvisioningPermissionTest/should-be-able-to-provision-project.html +++ b/tests/src/test/resources/authorisation/ProvisioningPermissionTest/should-be-able-to-provision-project.html @@ -36,19 +36,14 @@ </tr> <tr> <td>open</td> - <td>/projects_admin</td> + <td>/admin/projects_management</td> <td></td> </tr> <tr> <td>waitForElementPresent</td> - <td>css=#projects-type__ALL</td> + <td>css=#create-project</td> <td></td> </tr> - <tr> - <td>assertText</td> - <td>css=.page-actions button</td> - <td>*Create Project*</td> - </tr> </tbody> </table> </body> diff --git a/tests/src/test/resources/authorisation/ProvisioningPermissionTest/should-not-be-able-to-provision-project.html b/tests/src/test/resources/authorisation/ProvisioningPermissionTest/should-not-be-able-to-provision-project.html index 634e71e1926..8b907e20c2c 100644 --- a/tests/src/test/resources/authorisation/ProvisioningPermissionTest/should-not-be-able-to-provision-project.html +++ b/tests/src/test/resources/authorisation/ProvisioningPermissionTest/should-not-be-able-to-provision-project.html @@ -35,18 +35,18 @@ </tr> <tr> <td>open</td> - <td>/projects_admin</td> + <td>/admin/projects_management</td> <td></td> </tr> <tr> <td>waitForElementPresent</td> - <td>css=#projects-type__ALL</td> + <td>css=#projects-management-page</td> <td></td> </tr> <tr> - <td>assertNotText</td> - <td>css=.page-actions button</td> - <td>*Create Project*</td> + <td>assertElementNotPresent</td> + <td>css=#create-project</td> + <td></td> </tr> </tbody> </table> |