]> source.dussan.org Git - sonarqube.git/commitdiff
Fix Selenium ITs that were using bundle 'admin' user
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 13 Jun 2017 09:56:33 +0000 (11:56 +0200)
committerStas Vilchik <stas.vilchik@sonarsource.com>
Tue, 20 Jun 2017 11:10:53 +0000 (04:10 -0700)
The 'admin' user is replaced by a new random admin user in order to avoid the onboarding tutorial to be displayed

58 files changed:
it/it-tests/src/test/java/it/administration/ProjectsAdministrationTest.java
it/it-tests/src/test/java/it/administration/UsersPageTest.java
it/it-tests/src/test/java/it/issue/IssuesPageTest.java
it/it-tests/src/test/java/it/issue/OrganizationIssueAssignTest.java
it/it-tests/src/test/java/it/measure/ProjectDashboardTest.java
it/it-tests/src/test/java/it/measureHistory/DifferentialPeriodsTest.java
it/it-tests/src/test/java/it/organization/BillingTest.java
it/it-tests/src/test/java/it/organization/OrganizationMembershipTest.java
it/it-tests/src/test/java/it/organization/OrganizationMembershipUiTest.java
it/it-tests/src/test/java/it/projectAdministration/BackgroundTasksTest.java
it/it-tests/src/test/java/it/projectAdministration/BulkDeletionTest.java
it/it-tests/src/test/java/it/projectAdministration/ProjectAdministrationTest.java
it/it-tests/src/test/java/it/projectAdministration/ProjectLinksPageTest.java
it/it-tests/src/test/java/it/projectAdministration/ProjectPermissionsTest.java
it/it-tests/src/test/java/it/projectEvent/ProjectActivityPageTest.java
it/it-tests/src/test/java/it/projectSearch/LeakProjectsPageTest.java
it/it-tests/src/test/java/it/projectSearch/ProjectsPageTest.java
it/it-tests/src/test/java/it/qualityProfile/OrganizationQualityProfilesUiTest.java
it/it-tests/src/test/java/it/qualityProfile/QualityProfilesUiTest.java
it/it-tests/src/test/java/it/serverSystem/ServerSystemTest.java
it/it-tests/src/test/java/it/settings/LicensesPageTest.java
it/it-tests/src/test/java/it/settings/PropertySetsTest.java
it/it-tests/src/test/java/it/settings/SettingsTestRestartingOrchestrator.java
it/it-tests/src/test/java/it/uiExtension/OrganizationUiExtensionsTest.java
it/it-tests/src/test/java/it/uiExtension/UiExtensionsTest.java
it/it-tests/src/test/java/it/user/ForceAuthenticationTest.java
it/it-tests/src/test/java/it/user/LocalAuthenticationTest.java
it/it-tests/src/test/java/it/user/MyAccountPageTest.java
it/it-tests/src/test/java/it/user/RealmAuthenticationTest.java
it/it-tests/src/test/java/pageobjects/LoginPage.java
it/it-tests/src/test/java/util/user/UserRule.java
it/it-tests/src/test/resources/administration/UsersPageTest/admin_should_change_its_own_password.html
it/it-tests/src/test/resources/administration/UsersPageTest/generate_and_revoke_user_token.html
it/it-tests/src/test/resources/authorisation/PermissionTemplatesPageTest/should_create.html
it/it-tests/src/test/resources/authorisation/PermissionTemplatesPageTest/should_manage_project_creators.html
it/it-tests/src/test/resources/organization/OrganizationQualityProfilesUiTest/should_copy.html
it/it-tests/src/test/resources/organization/OrganizationQualityProfilesUiTest/should_create.html
it/it-tests/src/test/resources/organization/OrganizationQualityProfilesUiTest/should_delete.html
it/it-tests/src/test/resources/organization/OrganizationQualityProfilesUiTest/should_rename.html
it/it-tests/src/test/resources/organization/OrganizationQualityProfilesUiTest/should_restore.html
it/it-tests/src/test/resources/organization/OrganizationQualityProfilesUiTest/should_set_default.html
it/it-tests/src/test/resources/projectAdministration/BackgroundTasksTest/should_not_display_failing_and_search_and_filter_elements_on_project_level_page.html
it/it-tests/src/test/resources/projectAdministration/BulkDeletionTest/bulk-delete-filter-projects.html
it/it-tests/src/test/resources/projectAdministration/ProjectAdministrationTest/project-administration/multimodule-project-modify-version.html
it/it-tests/src/test/resources/qualityProfile/QualityProfilesUiTest/should_copy.html
it/it-tests/src/test/resources/qualityProfile/QualityProfilesUiTest/should_create.html
it/it-tests/src/test/resources/qualityProfile/QualityProfilesUiTest/should_delete.html
it/it-tests/src/test/resources/qualityProfile/QualityProfilesUiTest/should_rename.html
it/it-tests/src/test/resources/qualityProfile/QualityProfilesUiTest/should_restore.html
it/it-tests/src/test/resources/qualityProfile/QualityProfilesUiTest/should_set_default.html
it/it-tests/src/test/resources/serverSystem/ServerSystemTest/system_info.html
it/it-tests/src/test/resources/user/ExternalAuthenticationTest/create-and-delete-user.html
it/it-tests/src/test/resources/user/LocalAuthenticationTest/force-authentication.html
it/it-tests/src/test/resources/user/LocalAuthenticationTest/login_successful.html
it/it-tests/src/test/resources/user/LocalAuthenticationTest/login_wrong_password.html
it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_after_direct_login.html
it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_after_indirect_login.html
it/it-tests/src/test/resources/user/LocalAuthenticationTest/redirect_to_original_url_with_parameters_after_direct_login.html

index b0c86666fa96fc1bf24baf8a763fb844e04fbef4..6177ad28c3e96c68f48885c3b0d4b31ccdb64627 100644 (file)
@@ -34,6 +34,7 @@ import org.sonarqube.ws.client.project.UpdateVisibilityRequest;
 import pageobjects.Navigation;
 import pageobjects.ProjectsManagementPage;
 import util.ItUtils;
+import util.user.UserRule;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static util.ItUtils.newAdminWsClient;
@@ -44,12 +45,18 @@ public class ProjectsAdministrationTest {
   @ClassRule
   public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR;
 
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
+
   @Rule
   public Navigation nav = Navigation.get(orchestrator);
 
+  private String adminUser;
+
   @Before
-  public void deleteAnalysisData() throws SQLException {
+  public void initData() throws SQLException {
     orchestrator.resetData();
+    adminUser = userRule.createAdminUser();
   }
 
   @Test
@@ -60,7 +67,7 @@ public class ProjectsAdministrationTest {
     // Remove 'Admin' permission for admin group on project 2 -> No one can access or admin this project, expect System Admin
     newAdminWsClient(orchestrator).permissions().removeGroup(new RemoveGroupWsRequest().setProjectKey("sample2").setGroupName("sonar-administrators").setPermission("admin"));
 
-    nav.logIn().asAdmin().openProjectsManagement()
+    nav.logIn().submitCredentials(adminUser).openProjectsManagement()
       .shouldHaveProject("sample1")
       .shouldHaveProject("sample2");
   }
@@ -76,7 +83,7 @@ public class ProjectsAdministrationTest {
   }
 
   private void createProjectAndVerify(String visibility) {
-    ProjectsManagementPage page = nav.logIn().asAdmin().openProjectsManagement();
+    ProjectsManagementPage page = nav.logIn().submitCredentials(adminUser, adminUser).openProjectsManagement();
     page
       .shouldHaveProjectsCount(0)
       .createProject("foo", "foo", visibility)
index b5a7c12aff497633ffc3d94e1d67a34ab08de6e5..9779a6f82f9391afb5ef3ab4aeb92a947e3e6d8a 100644 (file)
@@ -22,6 +22,8 @@ package it.administration;
 import com.sonar.orchestrator.Orchestrator;
 import it.Category1Suite;
 import java.util.List;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
@@ -37,6 +39,8 @@ import static util.ItUtils.newAdminWsClient;
 
 public class UsersPageTest {
 
+  private static final String ADMIN_USER_LOGIN = "admin-user";
+
   @ClassRule
   public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR;
 
@@ -45,6 +49,16 @@ public class UsersPageTest {
 
   private WsClient adminClient = newAdminWsClient(orchestrator);
 
+  @Before
+  public void initAdminUser() throws Exception {
+    userRule.createAdminUser(ADMIN_USER_LOGIN, ADMIN_USER_LOGIN);
+  }
+
+  @After
+  public void deleteAdminUser() {
+    userRule.resetUsers();
+  }
+
   @Test
   public void generate_and_revoke_user_token()  {
     Selenese.runSelenese(orchestrator, "/administration/UsersPageTest/generate_and_revoke_user_token.html");
index fd28ef8a91a89b206facdc73afb18edf5ff87e47..feff031efb1237552108a8079d59d4fd04c7dfd7 100644 (file)
@@ -21,6 +21,7 @@ package it.issue;
 
 import com.sonar.orchestrator.Orchestrator;
 import it.Category2Suite;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Rule;
@@ -39,12 +40,14 @@ public class IssuesPageTest {
   @ClassRule
   public static Orchestrator ORCHESTRATOR = Category2Suite.ORCHESTRATOR;
 
-  @ClassRule
-  public static UserRule userRule = UserRule.from(ORCHESTRATOR);
+  @Rule
+  public UserRule userRule = UserRule.from(ORCHESTRATOR);
 
   @Rule
   public Navigation nav = Navigation.get(ORCHESTRATOR);
 
+  private String adminUser;
+
   @BeforeClass
   public static void prepareData() {
     ORCHESTRATOR.resetData();
@@ -56,9 +59,14 @@ public class IssuesPageTest {
     runProjectAnalysis(ORCHESTRATOR, "shared/xoo-multi-modules-sample");
   }
 
+  @Before
+  public void before() {
+    adminUser = userRule.createAdminUser();
+  }
+
   @Test
   public void should_display_actions() {
-    IssuesPage page = nav.logIn().asAdmin().openIssues();
+    IssuesPage page = nav.logIn().submitCredentials(adminUser).openIssues();
     Issue issue = page.getFirstIssue();
     issue.shouldAllowAssign().shouldAllowChangeType();
   }
index 61a85920f727a3172fb8bca16e2b6b526d8d7f0b..ae0861dbbcee099a841076907c595298ee00a849 100644 (file)
@@ -66,22 +66,23 @@ public class OrganizationIssueAssignTest {
 
   @ClassRule
   public static Orchestrator orchestrator = Category6Suite.ORCHESTRATOR;
-
   @Rule
   public OrganizationRule organizations = new OrganizationRule(orchestrator);
   @Rule
-  public UserRule userRule = new UserRule(orchestrator);
-  @Rule
-  public IssueRule issueRule = IssueRule.from(orchestrator);
+  public UserRule userRule = UserRule.from(orchestrator);
+  @ClassRule
+  public static IssueRule issueRule = IssueRule.from(orchestrator);
   @Rule
   public Navigation nav = Navigation.get(orchestrator);
 
   private WsClient adminClient = newAdminWsClient(orchestrator);
+  private String adminUser;
 
   @Before
   public void setUp() throws Exception {
     createOrganization(ORGANIZATION_KEY);
     restoreProfile(orchestrator, getClass().getResource("/organization/IssueAssignTest/one-issue-per-file-profile.xml"), ORGANIZATION_KEY);
+    adminUser = userRule.createRootUser();
   }
 
   @Test
@@ -160,7 +161,7 @@ public class OrganizationIssueAssignTest {
     adminClient.organizations().addMember(ORGANIZATION_KEY, ASSIGNEE_LOGIN);
     userRule.createUser(OTHER_LOGIN, "pwd");
     provisionAndAnalyseProject(SAMPLE_PROJECT_KEY, ORGANIZATION_KEY);
-    IssuesPage page = nav.logIn().asAdmin().openIssues();
+    IssuesPage page = nav.logIn().submitCredentials(adminUser).openIssues();
     page.getFirstIssue()
       .shouldAllowAssign()
       .assigneeSearchResultCount(OTHER_LOGIN, 0)
@@ -174,7 +175,7 @@ public class OrganizationIssueAssignTest {
     adminClient.organizations().addMember(ORGANIZATION_KEY, ASSIGNEE_LOGIN);
     userRule.createUser(OTHER_LOGIN, "pwd");
     provisionAndAnalyseProject(SAMPLE_PROJECT_KEY, ORGANIZATION_KEY);
-    IssuesPage page = nav.logIn().asAdmin().openComponentIssues(SAMPLE_PROJECT_KEY);
+    IssuesPage page = nav.logIn().submitCredentials(adminUser).openComponentIssues(SAMPLE_PROJECT_KEY);
     page
       .bulkChangeOpen()
       .bulkChangeAssigneeSearchCount(ASSIGNEE_LOGIN, 1)
@@ -188,7 +189,7 @@ public class OrganizationIssueAssignTest {
     adminClient.organizations().addMember(ORGANIZATION_KEY, ASSIGNEE_LOGIN);
     userRule.createUser(OTHER_LOGIN, "pwd");
     provisionAndAnalyseProject(SAMPLE_PROJECT_KEY, ORGANIZATION_KEY);
-    IssuesPage page = nav.logIn().asAdmin().openIssues();
+    IssuesPage page = nav.logIn().submitCredentials(adminUser).openIssues();
     page
       .bulkChangeOpen()
       .bulkChangeAssigneeSearchCount(ASSIGNEE_LOGIN, 1)
index 269acc7d9d333a4699930f6d63b87e977992d073..cc3b24792ba99b244d8b4f717ea49c6970e7086f 100644 (file)
@@ -32,6 +32,7 @@ import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.WsClient;
 import pageobjects.Navigation;
 import pageobjects.ProjectDashboardPage;
+import util.user.UserRule;
 
 import static com.codeborne.selenide.Condition.hasText;
 import static com.codeborne.selenide.Condition.text;
@@ -40,18 +41,24 @@ import static util.ItUtils.projectDir;
 import static util.selenium.Selenese.runSelenese;
 
 public class ProjectDashboardTest {
+
   @ClassRule
   public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR;
 
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
+
   @Rule
   public Navigation nav = Navigation.get(orchestrator);
 
   private static WsClient wsClient;
+  private String adminUser;
 
   @Before
   public void setUp() throws Exception {
     wsClient = newAdminWsClient(orchestrator);
     orchestrator.resetData();
+    adminUser = userRule.createAdminUser();
   }
 
   @Test
@@ -79,8 +86,7 @@ public class ProjectDashboardTest {
     wsClient.wsConnector().call(
       new PostRequest("api/project_tags/set")
         .setParam("project", "sample")
-        .setParam("tags", "foo,bar,baz")
-    );
+        .setParam("tags", "foo,bar,baz"));
 
     ProjectDashboardPage page = nav.openProjectDashboard("sample");
     page
@@ -93,13 +99,12 @@ public class ProjectDashboardTest {
     executeBuild("shared/xoo-sample", "sample-with-tags", "Sample with tags");
     // Add some tags to another project to have them in the list
     wsClient.wsConnector().call(
-            new PostRequest("api/project_tags/set")
-                    .setParam("project", "sample-with-tags")
-                    .setParam("tags", "foo,bar,baz")
-    );
+      new PostRequest("api/project_tags/set")
+        .setParam("project", "sample-with-tags")
+        .setParam("tags", "foo,bar,baz"));
 
     executeBuild("shared/xoo-sample", "sample", "Sample");
-    ProjectDashboardPage page = nav.logIn().asAdmin().openProjectDashboard("sample");
+    ProjectDashboardPage page = nav.logIn().submitCredentials(adminUser).openProjectDashboard("sample");
     page
       .shouldHaveTags("No tags")
       .shouldBeEditable()
@@ -129,8 +134,7 @@ public class ProjectDashboardTest {
     orchestrator.executeBuild(
       SonarScanner.create(projectDir(projectLocation))
         .setProjectKey(projectKey)
-        .setProjectName(projectName)
-    );
+        .setProjectName(projectName));
   }
 
 }
index 4ab4976304ae0c07e9bd8daacf30cce7f35a250c..47bfede4f9a0c073ee68a0d89b5efbd810ec42a9 100644 (file)
@@ -26,10 +26,12 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
+import org.junit.Rule;
 import org.junit.Test;
 import org.sonarqube.ws.client.WsClient;
 import pageobjects.Navigation;
 import util.ItUtils;
+import util.user.UserRule;
 
 import static org.apache.commons.lang.time.DateUtils.addDays;
 import static org.assertj.core.api.Assertions.assertThat;
@@ -51,6 +53,11 @@ public class DifferentialPeriodsTest {
   @ClassRule
   public static final Orchestrator orchestrator = Category1Suite.ORCHESTRATOR;
 
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
+
+  private String adminUser;
+
   @BeforeClass
   public static void createWsClient() throws Exception {
     CLIENT = newAdminWsClient(orchestrator);
@@ -59,6 +66,7 @@ public class DifferentialPeriodsTest {
   @Before
   public void cleanUpAnalysisData() {
     orchestrator.resetData();
+    adminUser = userRule.createAdminUser();
   }
 
   @After
@@ -93,7 +101,7 @@ public class DifferentialPeriodsTest {
     assertThat(getLeakPeriodValue(orchestrator, PROJECT_KEY, "violations")).isEqualTo(17);
 
     // Check on ui that it's possible to define leak period on project
-    Navigation.get(orchestrator).openHomepage().logIn().asAdmin().openSettings("sample")
+    Navigation.get(orchestrator).openHomepage().logIn().submitCredentials(adminUser).openSettings("sample")
       .assertSettingDisplayed("sonar.leak.period");
   }
 
index 5396a836c39a8b6f67975b1d92dbd46a31c10e69..d43510e5e80261b6ae8c86518052247b267c2ccc 100644 (file)
@@ -73,6 +73,7 @@ public class BillingTest {
   public Navigation nav = Navigation.get(orchestrator);
 
   private static WsClient adminClient;
+  private String adminUser;
 
   @BeforeClass
   public static void prepare() {
@@ -85,6 +86,11 @@ public class BillingTest {
     resetSettings(orchestrator, null, PROPERTY_PREVENT_ANALYSIS, "sonar.billing.preventUpdatingProjectsVisibilityToPrivate");
   }
 
+  @Before
+  public void createAdminUser() throws Exception {
+    adminUser = userRule.createRootUser();
+  }
+
   @Test
   public void execute_successfully_ce_analysis_on_organization() {
     String organizationKey = createOrganization();
@@ -217,7 +223,7 @@ public class BillingTest {
     String projectKey = createPublicProject(createOrganization());
     setServerProperty(orchestrator, "sonar.billing.preventUpdatingProjectsVisibilityToPrivate", "true");
 
-    nav.logIn().asAdmin().openProjectPermissions(projectKey)
+    nav.logIn().submitCredentials(adminUser).openProjectPermissions(projectKey)
       .shouldBePublic()
       .shouldNotAllowPrivate();
   }
@@ -227,12 +233,12 @@ public class BillingTest {
     String projectKey = createPublicProject(createOrganization());
     setServerProperty(orchestrator, "sonar.billing.preventUpdatingProjectsVisibilityToPrivate", "false");
 
-    nav.logIn().asAdmin().openProjectPermissions(projectKey)
+    nav.logIn().submitCredentials(adminUser).openProjectPermissions(projectKey)
       .shouldBePublic()
       .turnToPrivate();
   }
 
-  private static String createOrganization() {
+  private String createOrganization() {
     String key = newOrganizationKey();
     adminClient.organizations().create(new CreateWsRequest.Builder().setKey(key).setName(key).build()).getOrganization();
     return key;
@@ -244,16 +250,16 @@ public class BillingTest {
     return projectKey;
   }
 
-  private static String executeAnalysis(String organizationKey) {
+  private String executeAnalysis(String organizationKey) {
     return executeAnalysis(newProjectKey(), organizationKey);
   }
 
-  private static String executeAnalysis(String projectKey, String organizationKey) {
+  private String executeAnalysis(String projectKey, String organizationKey) {
     BuildResult buildResult = orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample"),
       "sonar.organization", organizationKey,
       "sonar.projectKey", projectKey,
-      "sonar.login", "admin",
-      "sonar.password", "admin"));
+      "sonar.login", adminUser,
+      "sonar.password", adminUser));
     return ItUtils.extractCeTaskId(buildResult);
   }
 
index a8f151e48b4fdccd7185b8962612b8a496bdd023..19dd64ec7fd48e1971dc87afc57d0f10d89613e9 100644 (file)
@@ -35,6 +35,7 @@ import org.sonarqube.ws.WsUsers.CreateWsResponse.User;
 import org.sonarqube.ws.client.HttpException;
 import org.sonarqube.ws.client.WsClient;
 import org.sonarqube.ws.client.permission.AddUserWsRequest;
+import pageobjects.Navigation;
 import util.OrganizationRule;
 import util.user.UserRule;
 
@@ -46,20 +47,22 @@ public class OrganizationMembershipTest {
   private static Orchestrator orchestrator = Category6Suite.ORCHESTRATOR;
   private static OrganizationRule organizations = new OrganizationRule(orchestrator);
   private static UserRule users = new UserRule(orchestrator);
+  private static Navigation nav = Navigation.get(orchestrator);
 
   @ClassRule
   public static TestRule chain = RuleChain.outerRule(orchestrator)
     .around(users)
-    .around(organizations);
+    .around(organizations)
+    .around(nav);
 
   @Rule
   public ExpectedException expectedException = ExpectedException.none();
 
-  private static WsClient rootWsClient;
+  private static WsClient adminClient;
 
   @BeforeClass
   public static void setUp() {
-    rootWsClient = newAdminWsClient(orchestrator);
+    adminClient = newAdminWsClient(orchestrator);
     setServerProperty(orchestrator, "sonar.organizations.anyoneCanCreate", "true");
   }
 
@@ -92,7 +95,7 @@ public class OrganizationMembershipTest {
     User user = users.createUser();
     addMembership(organization, user);
 
-    rootWsClient.permissions().addUser(new AddUserWsRequest().setLogin(user.getLogin()).setPermission("admin").setOrganization(organization.getKey()));
+    adminClient.permissions().addUser(new AddUserWsRequest().setLogin(user.getLogin()).setPermission("admin").setOrganization(organization.getKey()));
     organizations.assertThatMemberOf(organization, user);
 
     removeMembership(organization, user);
@@ -105,10 +108,10 @@ public class OrganizationMembershipTest {
     User user = users.createUser();
     addMembership(organization, user);
 
-    rootWsClient.permissions().addUser(new AddUserWsRequest().setLogin(user.getLogin()).setPermission("admin").setOrganization(organization.getKey()));
+    adminClient.permissions().addUser(new AddUserWsRequest().setLogin(user.getLogin()).setPermission("admin").setOrganization(organization.getKey()));
     organizations.assertThatMemberOf(organization, user);
     // Admin is the creator of the organization so he was granted with admin permission
-    rootWsClient.organizations().removeMember(organization.getKey(), "admin");
+    adminClient.organizations().removeMember(organization.getKey(), "admin");
 
     expectedException.expect(HttpException.class);
     expectedException.expectMessage("The last administrator member cannot be removed");
@@ -136,10 +139,10 @@ public class OrganizationMembershipTest {
   }
 
   private void addMembership(Organization organization, User user) {
-    rootWsClient.organizations().addMember(organization.getKey(), user.getLogin());
+    adminClient.organizations().addMember(organization.getKey(), user.getLogin());
   }
 
   private void removeMembership(Organization organization, User user) {
-    rootWsClient.organizations().removeMember(organization.getKey(), user.getLogin());
+    adminClient.organizations().removeMember(organization.getKey(), user.getLogin());
   }
 }
index a03327d743bab291f2b1e3c8384d66c33d3803de..702475a3b23ec1716d5003b637693a32821521b2 100644 (file)
@@ -22,7 +22,9 @@ package it.organization;
 
 import com.sonar.orchestrator.Orchestrator;
 import it.Category6Suite;
+import org.junit.After;
 import org.junit.AfterClass;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Rule;
@@ -55,6 +57,7 @@ public class OrganizationMembershipUiTest {
   public Navigation nav = Navigation.get(orchestrator);
 
   private static WsClient rootWsClient;
+  private String adminUser;
 
   @BeforeClass
   public static void setUp() {
@@ -67,6 +70,17 @@ public class OrganizationMembershipUiTest {
     setServerProperty(orchestrator, "sonar.organizations.anyoneCanCreate", null);
   }
 
+  @Before
+  public void createRootUser() {
+    adminUser = users.createRootUser();
+  }
+
+  @After
+  public void purgeData() throws Exception {
+    organizations.deleteOrganizations();
+    users.deactivateAllUsers();
+  }
+
   @Test
   public void should_display_members_page() {
     Organization organization = organizations.create();
@@ -74,7 +88,7 @@ public class OrganizationMembershipUiTest {
     addMembership(organization, member1);
     User member2 = users.createUser(p -> p.setName("bar"));
     addMembership(organization, member2);
-    User nonMember = users.createUser();
+    users.createUser();
 
     MembersPage page = nav.openOrganizationMembers(organization.getKey());
     page
@@ -91,53 +105,55 @@ public class OrganizationMembershipUiTest {
   @Test
   public void search_for_members() {
     Organization organization = organizations.create();
-    User member1 = users.createUser(p -> p.setName("foo"));
-    addMembership(organization, member1);
-    User member2 = users.createUser(p -> p.setName("barGuy"));
-    addMembership(organization, member2);
+
+    User user1 = users.createUser();
+    rootWsClient.organizations().addMember(organization.getKey(), user1.getLogin());
+
+    User user2 = users.createUser(p -> p.setLogin("sameprefixuser1"));
+    rootWsClient.organizations().addMember(organization.getKey(), user2.getLogin());
+
     // Created to verify that only the user part of the org is returned
-    User userWithSameNamePrefix = users.createUser(p -> p.setName(member2.getName() + "barOtherGuy"));
+    users.createUser(p -> p.setLogin("sameprefixuser2"));
 
     MembersPage page = nav.openOrganizationMembers(organization.getKey());
     page
-      .searchForMember("bar")
+      .searchForMember("sameprefixuser")
       .shouldHaveTotal(1);
-    page.getMembersByIdx(0)
-      .shouldBeNamed(member2.getLogin(), member2.getName());
+    page.getMembersByIdx(0).shouldBeNamed(user2.getLogin(), user2.getName());
     page
-      .searchForMember(member1.getName())
+      .searchForMember(user1.getLogin())
       .shouldHaveTotal(1);
-    page.getMembersByIdx(0)
-      .shouldBeNamed(member1.getLogin(), member1.getName());
+    page.getMembersByIdx(0).shouldBeNamed(user1.getLogin(), user1.getName());
   }
 
   @Test
   public void admin_can_add_members() {
     Organization organization = organizations.create();
-    User user = users.createUser();
+    String orgKey = organization.getKey();
+    User user = users.createUser(p -> p.setLogin("foo"));
+    users.createUser();
 
-    MembersPage page = nav.logIn().asAdmin().openOrganizationMembers(organization.getKey());
+    MembersPage page = nav.logIn().submitCredentials(adminUser).openOrganizationMembers(orgKey);
     page
       .shouldHaveTotal(1)
       .addMember(user.getLogin())
       .shouldHaveTotal(2);
-    page.getMembersByIdx(0)
-      .shouldBeNamed("admin", "Administrator")
-      .shouldHaveGroups(2);
-    page.getMembersByIdx(1)
-      .shouldBeNamed(user.getLogin(), user.getName())
-      .shouldHaveGroups(1);
+    page.getMembersByIdx(0).shouldBeNamed("admin", "Administrator").shouldHaveGroups(2);
+    page.getMembersByIdx(1).shouldBeNamed(user.getLogin(), user.getName()).shouldHaveGroups(1);
   }
 
   @Test
   public void admin_can_remove_members() {
     Organization organization = organizations.create();
+    String orgKey = organization.getKey();
+
     User user1 = users.createUser();
-    addMembership(organization, user1);
+    rootWsClient.organizations().addMember(orgKey, user1.getLogin());
+
     User user2 = users.createUser();
-    addMembership(organization, user2);
+    rootWsClient.organizations().addMember(orgKey, user2.getLogin());
 
-    MembersPage page = nav.logIn().asAdmin().openOrganizationMembers(organization.getKey());
+    MembersPage page = nav.logIn().submitCredentials(adminUser).openOrganizationMembers(orgKey);
     page.shouldHaveTotal(3)
       .getMembersByIdx(1).removeMembership();
     page.shouldHaveTotal(2);
@@ -146,10 +162,12 @@ public class OrganizationMembershipUiTest {
   @Test
   public void admin_can_manage_groups() {
     Organization organization = organizations.create();
-    User user = users.createUser();
-    addMembership(organization, user);
+    String orgKey = organization.getKey();
+
+    User user = users.createUser(p -> p.setLogin("foo"));
+    rootWsClient.organizations().addMember(orgKey, user.getLogin());
 
-    MembersPage page = nav.logIn().asAdmin().openOrganizationMembers(organization.getKey());
+    MembersPage page = nav.logIn().submitCredentials(adminUser).openOrganizationMembers(orgKey);
     // foo user
     page.getMembersByIdx(1)
       .manageGroupsOpen()
@@ -167,9 +185,10 @@ public class OrganizationMembershipUiTest {
   @Test
   public void groups_count_should_be_updated_when_a_member_was_just_added() {
     Organization organization = organizations.create();
-    User user = users.createUser();
+    String orgKey = organization.getKey();
+    User user = users.createUser(p -> p.setLogin("foo"));
 
-    MembersPage page = nav.logIn().asAdmin().openOrganizationMembers(organization.getKey());
+    MembersPage page = nav.logIn().submitCredentials(adminUser).openOrganizationMembers(orgKey);
     page
       .addMember(user.getLogin())
       .getMembersByIdx(1)
index 0bc5a799134918c130a2ae1ee26c24b93f445f2e..4d5d8d0f41c84cae1102353a8d89fdc4d4883fa6 100644 (file)
@@ -22,6 +22,8 @@ package it.projectAdministration;
 import com.sonar.orchestrator.Orchestrator;
 import com.sonar.orchestrator.build.SonarScanner;
 import it.Category1Suite;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Rule;
@@ -29,6 +31,7 @@ import org.junit.Test;
 import pageobjects.BackgroundTaskItem;
 import pageobjects.BackgroundTasksPage;
 import pageobjects.Navigation;
+import util.user.UserRule;
 
 import static com.codeborne.selenide.CollectionCondition.sizeGreaterThan;
 import static util.ItUtils.projectDir;
@@ -36,9 +39,14 @@ import static util.selenium.Selenese.runSelenese;
 
 public class BackgroundTasksTest {
 
+  private static final String ADMIN_USER_LOGIN = "admin-user";
+
   @ClassRule
   public static Orchestrator ORCHESTRATOR = Category1Suite.ORCHESTRATOR;
 
+  @Rule
+  public UserRule userRule = UserRule.from(ORCHESTRATOR);
+
   @Rule
   public Navigation nav = Navigation.get(ORCHESTRATOR);
 
@@ -48,15 +56,24 @@ public class BackgroundTasksTest {
     executeBuild("test-project-2", "Another Test Project");
   }
 
+  @Before
+  public void before() {
+    userRule.createAdminUser(ADMIN_USER_LOGIN, ADMIN_USER_LOGIN);
+  }
+
+  @After
+  public void deleteAdminUser() {
+    userRule.resetUsers();
+  }
+
   @Test
   public void should_not_display_failing_and_search_and_filter_elements_on_project_level_page() throws Exception {
-    runSelenese(ORCHESTRATOR,
-      "/projectAdministration/BackgroundTasksTest/should_not_display_failing_and_search_and_filter_elements_on_project_level_page.html");
+    runSelenese(ORCHESTRATOR, "/projectAdministration/BackgroundTasksTest/should_not_display_failing_and_search_and_filter_elements_on_project_level_page.html");
   }
 
   @Test
   public void display_scanner_context() {
-    nav.logIn().submitCredentials("admin", "admin");
+    nav.logIn().submitCredentials(ADMIN_USER_LOGIN);
     BackgroundTasksPage page = nav.openBackgroundTasksPage();
 
     page.getTasks().shouldHave(sizeGreaterThan(0));
@@ -71,7 +88,7 @@ public class BackgroundTasksTest {
   public void display_error_stacktrace() {
     executeBuild("test-project", "Test Project", "2010-01-01");
 
-    nav.logIn().submitCredentials("admin", "admin");
+    nav.logIn().submitCredentials(ADMIN_USER_LOGIN);
     BackgroundTasksPage page = nav.openBackgroundTasksPage();
 
     page.getTasks().shouldHave(sizeGreaterThan(0));
index cbcdc2e809520d2fd00236e53f8512bf59c0234e..602eeaab829d4745c32b0555931d478f2d37f694 100644 (file)
@@ -22,21 +22,35 @@ package it.projectAdministration;
 import com.sonar.orchestrator.Orchestrator;
 import com.sonar.orchestrator.build.SonarScanner;
 import it.Category1Suite;
+import org.junit.After;
 import org.junit.Before;
 import org.junit.ClassRule;
+import org.junit.Rule;
 import org.junit.Test;
+import util.user.UserRule;
 
 import static util.ItUtils.projectDir;
 import static util.selenium.Selenese.runSelenese;
 
 public class BulkDeletionTest {
 
+  private static final String ADMIN_USER_LOGIN = "admin-user";
+
   @ClassRule
   public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR;
 
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
+
   @Before
   public void deleteData() {
     orchestrator.resetData();
+    userRule.createAdminUser(ADMIN_USER_LOGIN, ADMIN_USER_LOGIN);
+  }
+
+  @After
+  public void deleteAdminUser() {
+    userRule.resetUsers();
   }
 
   /**
index e8a26419dbb38732e86d80b5844fef298b4b45b0..16050604201e787a4304949bece52bcbb2645eef 100644 (file)
@@ -40,6 +40,7 @@ import org.sonar.wsclient.base.HttpException;
 import org.sonar.wsclient.user.UserParameters;
 import pageobjects.Navigation;
 import pageobjects.settings.SettingsPage;
+import util.user.UserRule;
 
 import static org.apache.commons.lang.time.DateUtils.addDays;
 import static org.assertj.core.api.Assertions.assertThat;
@@ -59,15 +60,20 @@ public class ProjectAdministrationTest {
   @Rule
   public ExpectedException expectedException = ExpectedException.none();
 
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
+
   @Rule
   public Navigation nav = Navigation.get(orchestrator);
 
   private static final String PROJECT_KEY = "sample";
   private static final String FILE_KEY = "sample:src/main/xoo/sample/Sample.xoo";
+  private String adminUser;
 
   @Before
   public void deleteAnalysisData() throws SQLException {
     orchestrator.resetData();
+    adminUser = userRule.createAdminUser();
   }
 
   @Test
@@ -163,7 +169,7 @@ public class ProjectAdministrationTest {
   public void display_project_settings() throws UnsupportedEncodingException {
     scanSample(null, null);
 
-    SettingsPage page = nav.logIn().asAdmin().openSettings("sample")
+    SettingsPage page = nav.logIn().submitCredentials(adminUser).openSettings("sample")
       .assertMenuContains("Analysis Scope")
       .assertMenuContains("Category 1")
       .assertMenuContains("DEV")
@@ -186,7 +192,7 @@ public class ProjectAdministrationTest {
   public void display_module_settings() throws UnsupportedEncodingException {
     orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-multi-modules-sample")));
 
-    nav.logIn().asAdmin()
+    nav.logIn().submitCredentials(adminUser)
       .openSettings("com.sonarsource.it.samples:multi-modules-sample:module_a")
       .assertMenuContains("Analysis Scope")
       .assertSettingDisplayed("sonar.coverage.exclusions");
index 1929df4edea8918b1f0cc89fac7620d354570932..f12ede6e94e2166d4e9d21c9deeec9746abfecf2 100644 (file)
@@ -37,6 +37,7 @@ import org.sonarqube.ws.client.projectlinks.DeleteWsRequest;
 import pageobjects.Navigation;
 import pageobjects.ProjectLinkItem;
 import pageobjects.ProjectLinksPage;
+import util.user.UserRule;
 
 import static com.codeborne.selenide.Condition.hasText;
 import static com.codeborne.selenide.Selenide.$;
@@ -51,8 +52,12 @@ public class ProjectLinksPageTest {
   @Rule
   public Navigation nav = Navigation.get(ORCHESTRATOR);
 
+  @Rule
+  public UserRule userRule = UserRule.from(ORCHESTRATOR);
+
   private static WsClient wsClient;
   private long customLinkId;
+  private String adminUser;
 
   @BeforeClass
   public static void setUp() {
@@ -67,6 +72,7 @@ public class ProjectLinksPageTest {
   @Before
   public void prepare() {
     customLinkId = Long.parseLong(createCustomLink().getLink().getId());
+    adminUser = userRule.createAdminUser();
   }
 
   @After
@@ -147,7 +153,7 @@ public class ProjectLinksPageTest {
   }
 
   private ProjectLinksPage openPage() {
-    nav.logIn().submitCredentials("admin", "admin");
+    nav.logIn().submitCredentials(adminUser, adminUser);
     return nav.openProjectLinks("sample");
   }
 }
index 8df89782810a513b36fcbcdcee5fc62b4ab7208c..157d1f6ce5db4e1bf0344a826819335b3ba635a4 100644 (file)
@@ -22,12 +22,14 @@ package it.projectAdministration;
 import com.sonar.orchestrator.Orchestrator;
 import com.sonar.orchestrator.build.SonarScanner;
 import it.Category1Suite;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
 import pageobjects.Navigation;
 import pageobjects.ProjectPermissionsPage;
+import util.user.UserRule;
 
 import static util.ItUtils.projectDir;
 import static util.selenium.Selenese.runSelenese;
@@ -37,8 +39,12 @@ public class ProjectPermissionsTest {
   @ClassRule
   public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR;
 
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
+
   @Rule
   public Navigation nav = Navigation.get(orchestrator);
+  private String adminUser;
 
   @BeforeClass
   public static void beforeClass() {
@@ -46,6 +52,11 @@ public class ProjectPermissionsTest {
     executeBuild("project-permissions-project-2", "Another Test Project");
   }
 
+  @Before
+  public void before() {
+    adminUser = userRule.createAdminUser();
+  }
+
   @Test
   public void test_project_permissions_page_shows_only_single_project() throws Exception {
     runSelenese(orchestrator, "/projectAdministration/ProjectPermissionsTest/test_project_permissions_page_shows_only_single_project.html");
@@ -53,7 +64,7 @@ public class ProjectPermissionsTest {
 
   @Test
   public void change_project_visibility() {
-    ProjectPermissionsPage page = nav.logIn().asAdmin().openProjectPermissions("project-permissions-project");
+    ProjectPermissionsPage page = nav.logIn().submitCredentials(adminUser).openProjectPermissions("project-permissions-project");
     page
       .shouldBePublic()
       .turnToPrivate()
index c664fa9725eee7025d282f3b54e1c44de4a77a20..59944ac9fe02f3bae2c066cec922ca5a008ce8d8 100644 (file)
@@ -30,6 +30,7 @@ import org.junit.Test;
 import pageobjects.Navigation;
 import pageobjects.ProjectActivityPage;
 import pageobjects.ProjectAnalysisItem;
+import util.user.UserRule;
 
 import static util.ItUtils.projectDir;
 
@@ -38,6 +39,9 @@ public class ProjectActivityPageTest {
   @ClassRule
   public static Orchestrator ORCHESTRATOR = Category4Suite.ORCHESTRATOR;
 
+  @Rule
+  public UserRule userRule = UserRule.from(ORCHESTRATOR);
+
   @Rule
   public Navigation nav = Navigation.get(ORCHESTRATOR);
 
@@ -81,7 +85,8 @@ public class ProjectActivityPageTest {
   }
 
   private ProjectActivityPage openPage() {
-    nav.logIn().submitCredentials("admin", "admin");
+    String userAdmin = userRule.createAdminUser();
+    nav.logIn().submitCredentials(userAdmin, userAdmin);
     return nav.openProjectActivity("sample");
   }
 
index cfa30558bcb81fbb54fc80d94075b2f9acc9dcb0..779ccb4da2c58e9fac496f2eac71a14b3659d44f 100644 (file)
@@ -86,7 +86,7 @@ public class LeakProjectsPageTest {
     analyzeProject(projectKey1, "shared/xoo-sample", null);
 
     // Check the facets and project cards
-    ProjectsPage page = nav.logIn().asAdmin().openProjects(organization.getKey());
+    ProjectsPage page = nav.openProjects(organization.getKey());
     page.changePerspective("Leak");
     assertThat(url()).endsWith("/projects?view=leak");
     page.shouldHaveTotal(2);
index 610d9ba0eb007a02756f47d1e1ceefc3b5edfa3e..a3c9b0f97938a930aceb79746f029d31922cfa4f 100644 (file)
@@ -22,6 +22,7 @@ package it.projectSearch;
 import com.sonar.orchestrator.Orchestrator;
 import com.sonar.orchestrator.build.SonarScanner;
 import it.Category1Suite;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Rule;
@@ -30,10 +31,11 @@ import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.WsClient;
 import pageobjects.Navigation;
 import pageobjects.projects.ProjectsPage;
+import util.user.UserRule;
 
 import static com.codeborne.selenide.WebDriverRunner.url;
 import static org.assertj.core.api.Assertions.assertThat;
-import static util.ItUtils.newAdminWsClient;
+import static util.ItUtils.newUserWsClient;
 import static util.ItUtils.projectDir;
 
 public class ProjectsPageTest {
@@ -41,20 +43,29 @@ public class ProjectsPageTest {
   @ClassRule
   public static Orchestrator ORCHESTRATOR = Category1Suite.ORCHESTRATOR;
 
+  @Rule
+  public UserRule userRule = UserRule.from(ORCHESTRATOR);
+
   @Rule
   public Navigation nav = Navigation.get(ORCHESTRATOR);
 
-  private static WsClient wsClient;
   private static final String PROJECT_KEY = "key-foo";
+  private WsClient userAdminWsClient;
+  private String adminUser;
 
   @BeforeClass
   public static void setUp() {
-    wsClient = newAdminWsClient(ORCHESTRATOR);
     ORCHESTRATOR.resetData();
     ORCHESTRATOR.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample")).setProjectKey(PROJECT_KEY));
     ORCHESTRATOR.executeBuild(SonarScanner.create(projectDir("duplications/file-duplications")).setProjectKey("key-bar"));
   }
 
+  @Before
+  public void before() {
+    adminUser = userRule.createAdminUser();
+    userAdminWsClient = newUserWsClient(ORCHESTRATOR, adminUser, adminUser);
+  }
+
   @Test
   public void should_display_projects() {
     ProjectsPage page = nav.openProjects();
@@ -97,16 +108,16 @@ public class ProjectsPageTest {
     page.shouldHaveTotal(2).shouldDisplayAllProjectsWidthSort("-analysis_date");
 
     // all projects by default for logged in user
-    page = nav.logIn().asAdmin().openProjects();
+    page = nav.logIn().submitCredentials(adminUser).openProjects();
     page.shouldHaveTotal(2).shouldDisplayAllProjects();
 
     // favorite one project
-    wsClient.favorites().add(PROJECT_KEY);
+    userAdminWsClient.favorites().add(PROJECT_KEY);
     page = nav.openProjects();
     page.shouldHaveTotal(1).shouldDisplayFavoriteProjects();
 
     // un-favorite this project
-    wsClient.favorites().remove(PROJECT_KEY);
+    userAdminWsClient.favorites().remove(PROJECT_KEY);
     page = nav.openProjects();
     page.shouldHaveTotal(2).shouldDisplayAllProjects();
 
@@ -132,11 +143,10 @@ public class ProjectsPageTest {
   @Test
   public void should_add_tag_to_facet() {
     // Add some tags to this project
-    wsClient.wsConnector().call(
+    userAdminWsClient.wsConnector().call(
       new PostRequest("api/project_tags/set")
         .setParam("project", PROJECT_KEY)
-        .setParam("tags", "aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,zz")
-    );
+        .setParam("tags", "aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,zz"));
 
     ProjectsPage page = nav.openProjects();
     page.getFacetByProperty("tags")
@@ -148,7 +158,7 @@ public class ProjectsPageTest {
 
   @Test
   public void should_switch_between_perspectives() {
-    ProjectsPage page = nav.logIn().asAdmin().openProjects();
+    ProjectsPage page = nav.logIn().submitCredentials(adminUser).openProjects();
     page.changePerspective("Risk");
     assertThat(url()).endsWith("/projects?view=visualizations&visualization=risk");
     page.changePerspective("Leak");
index f3eb040aebe2674d5bb27e66c4bd3f0a5ee1a09a..6b0d23c1c54807af893b90e7ae54a3146b5bbce1 100644 (file)
@@ -32,9 +32,9 @@ import org.junit.Test;
 import org.sonarqube.ws.Organizations;
 import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.WsClient;
-import org.sonarqube.ws.client.organization.CreateWsRequest;
 import pageobjects.Navigation;
 import util.OrganizationRule;
+import util.user.UserRule;
 
 import static com.codeborne.selenide.Selenide.$;
 import static util.ItUtils.newAdminWsClient;
@@ -43,20 +43,24 @@ import static util.selenium.Selenese.runSelenese;
 
 public class OrganizationQualityProfilesUiTest {
 
+  private final static String ROOT_USER = "root-user";
+
   private static WsClient adminWsClient;
 
   @ClassRule
   public static Orchestrator orchestrator = Category6Suite.ORCHESTRATOR;
-
   @Rule
   public OrganizationRule organizationRule = new OrganizationRule(orchestrator);
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
 
   private static Organizations.Organization organization;
 
   @Before
   public void setUp() {
     adminWsClient = newAdminWsClient(orchestrator);
-    organization = adminWsClient.organizations().create(new CreateWsRequest.Builder().setKey("test-org").setName("test-org").build()).getOrganization();
+    organization = organizationRule.create(o -> o.setKey("test-org").setName("test-org"));
+    userRule.createRootUser(ROOT_USER, ROOT_USER);
   }
 
   @Before
index b0406584fa304f9814448093f7c51c6d188958a4..a4b1486618636450c685a7f308a74b19f431ac55 100644 (file)
@@ -28,10 +28,12 @@ import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Ignore;
+import org.junit.Rule;
 import org.junit.Test;
 import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.WsClient;
 import pageobjects.Navigation;
+import util.user.UserRule;
 
 import static com.codeborne.selenide.Selenide.$;
 import static util.ItUtils.newAdminWsClient;
@@ -40,8 +42,14 @@ import static util.selenium.Selenese.runSelenese;
 
 public class QualityProfilesUiTest {
 
+  private static final String ADMIN_USER_LOGIN = "admin-user";
+
   @ClassRule
   public static Orchestrator orchestrator = Category4Suite.ORCHESTRATOR;
+
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
+
   private static WsClient adminWsClient;
 
   @BeforeClass
@@ -50,6 +58,16 @@ public class QualityProfilesUiTest {
     orchestrator.resetData();
   }
 
+  @Before
+  public void initAdminUser() throws Exception {
+    userRule.createAdminUser(ADMIN_USER_LOGIN, ADMIN_USER_LOGIN);
+  }
+
+  @After
+  public void deleteAdminUser() {
+    userRule.resetUsers();
+  }
+
   @Before
   public void createSampleProfile() {
     createProfile("xoo", "sample");
index 6e4ae6eadaedb9c858a68368be85b64faec28ae0..4433a9a390878bfc1b619c4cdeade8781c5bd210 100644 (file)
@@ -29,7 +29,10 @@ import okhttp3.Response;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.json.simple.JSONValue;
+import org.junit.After;
+import org.junit.Before;
 import org.junit.ClassRule;
+import org.junit.Rule;
 import org.junit.Test;
 import org.sonarqube.ws.MediaTypes;
 import org.sonarqube.ws.ServerId.ShowWsResponse;
@@ -39,6 +42,7 @@ import org.sonarqube.ws.client.WsResponse;
 import pageobjects.Navigation;
 import pageobjects.ServerIdPage;
 import util.ItUtils;
+import util.user.UserRule;
 
 import static org.apache.commons.lang.StringUtils.startsWithAny;
 import static org.assertj.core.api.Assertions.assertThat;
@@ -50,9 +54,24 @@ import static util.selenium.Selenese.runSelenese;
 
 public class ServerSystemTest {
 
+  private static final String ADMIN_USER_LOGIN = "admin-user";
+
   @ClassRule
   public static final Orchestrator orchestrator = Category4Suite.ORCHESTRATOR;
 
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
+
+  @Before
+  public void initAdminUser() {
+    userRule.createAdminUser(ADMIN_USER_LOGIN, ADMIN_USER_LOGIN);
+  }
+
+  @After
+  public void deleteAdminUser() {
+    userRule.resetUsers();
+  }
+
   @Test
   public void get_sonarqube_version() {
     Map<String, Object> json = callStatus();
@@ -71,7 +90,7 @@ public class ServerSystemTest {
 
   @Test
   public void generate_server_id() throws IOException {
-    Navigation nav = Navigation.get(orchestrator).openHomepage().logIn().asAdmin();
+    Navigation nav = Navigation.get(orchestrator).openHomepage().logIn().submitCredentials(ADMIN_USER_LOGIN);
     String validIpAddress = getValidIpAddress();
 
     nav.openServerId()
index aed51ee04d13b8bf43f6ea7d1f99c0dfdbff9ba1..f9779f3465eef8edb04661192acae81ac82c32a3 100644 (file)
@@ -21,6 +21,7 @@ package it.settings;
 
 import com.sonar.orchestrator.Orchestrator;
 import org.junit.AfterClass;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.Test;
@@ -30,6 +31,7 @@ import org.sonarqube.ws.client.setting.ValuesRequest;
 import pageobjects.Navigation;
 import pageobjects.licenses.LicenseItem;
 import pageobjects.licenses.LicensesPage;
+import util.user.UserRule;
 
 import static com.codeborne.selenide.Condition.text;
 import static org.assertj.core.api.Assertions.assertThat;
@@ -40,8 +42,12 @@ public class LicensesPageTest {
   private static Orchestrator orchestrator;
   private static WsClient wsClient;
 
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
+
   @Rule
   public Navigation nav = Navigation.get(orchestrator);
+  private String adminUser;
 
   @BeforeClass
   public static void start() {
@@ -60,9 +66,14 @@ public class LicensesPageTest {
     }
   }
 
+  @Before
+  public void before() {
+    adminUser = userRule.createAdminUser();
+  }
+
   @Test
   public void display_licenses() {
-    LicensesPage page = nav.logIn().asAdmin().openLicenses();
+    LicensesPage page = nav.logIn().submitCredentials(adminUser).openLicenses();
 
     page.getLicenses().shouldHaveSize(2);
     page.getLicensesAsItems().get(0).getName().shouldHave(text("Typed property"));
@@ -73,7 +84,7 @@ public class LicensesPageTest {
   public void change_licenses() {
     String EXAMPLE_LICENSE = "TmFtZTogRGV2ZWxvcHBlcnMKUGx1Z2luOiBhdXRvY29udHJvbApFeHBpcmVzOiAyMDEyLTA0LTAxCktleTogNjI5N2MxMzEwYzg2NDZiZTE5MDU1MWE4ZmZmYzk1OTBmYzEyYTIyMgo=";
 
-    LicensesPage page = nav.logIn().asAdmin().openLicenses();
+    LicensesPage page = nav.logIn().submitCredentials(adminUser).openLicenses();
     LicenseItem licenseItem = page.getLicenseByKey("typed.license.secured");
     licenseItem.setLicense(EXAMPLE_LICENSE);
 
index a7dbfa2729edb9fc09cb097f13dc79b0d110ed28..2372f42073abadc0c8f253b43fedb2334eef6a97 100644 (file)
@@ -25,6 +25,7 @@ import java.io.UnsupportedEncodingException;
 import java.util.List;
 import java.util.Map;
 import org.junit.After;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Rule;
@@ -35,6 +36,7 @@ import org.sonarqube.ws.client.setting.SettingsService;
 import org.sonarqube.ws.client.setting.ValuesRequest;
 import pageobjects.Navigation;
 import pageobjects.settings.SettingsPage;
+import util.user.UserRule;
 
 import static com.google.common.collect.Lists.newArrayList;
 import static java.util.Arrays.asList;
@@ -48,16 +50,25 @@ public class PropertySetsTest {
   @ClassRule
   public static Orchestrator orchestrator = Category1Suite.ORCHESTRATOR;
 
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
+
   @Rule
   public Navigation nav = Navigation.get(orchestrator);
 
   static SettingsService SETTINGS;
+  private String adminUser;
 
   @BeforeClass
   public static void initSettingsService() throws Exception {
     SETTINGS = newAdminWsClient(orchestrator).settingsService();
   }
 
+  @Before
+  public void before() {
+    adminUser = userRule.createAdminUser();
+  }
+
   @After
   public void reset_settings() throws Exception {
     resetSettings(orchestrator, null, "sonar.demo", "sonar.autogenerated", "sonar.test.jira.servers");
@@ -65,7 +76,7 @@ public class PropertySetsTest {
 
   @Test
   public void support_property_sets() throws UnsupportedEncodingException {
-    SettingsPage page = nav.logIn().asAdmin().openSettings(null).openCategory("DEV")
+    SettingsPage page = nav.logIn().submitCredentials(adminUser).openSettings(null).openCategory("DEV")
       .assertSettingDisplayed("sonar.test.jira.servers");
 
     page.getPropertySetInput("sonar.test.jira.servers")
@@ -82,7 +93,7 @@ public class PropertySetsTest {
 
   @Test
   public void support_property_sets_with_auto_generated_keys() throws UnsupportedEncodingException {
-    SettingsPage page = nav.logIn().asAdmin().openSettings(null).openCategory("DEV")
+    SettingsPage page = nav.logIn().submitCredentials(adminUser).openSettings(null).openCategory("DEV")
       .assertSettingDisplayed("sonar.autogenerated");
 
     page.getPropertySetInput("sonar.autogenerated")
index 62a98f154d5cf31debd5b9abaefeaa74d59a28ad..a38ba2f3eac4c3e0bb1be4b37ad4549ab91c2715 100644 (file)
@@ -29,6 +29,7 @@ import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import pageobjects.EncryptionPage;
 import pageobjects.Navigation;
+import util.user.UserRule;
 
 import static com.codeborne.selenide.Condition.visible;
 import static org.assertj.core.api.Assertions.assertThat;
@@ -41,14 +42,17 @@ import static util.ItUtils.xooPlugin;
  */
 public class SettingsTestRestartingOrchestrator {
 
-  Orchestrator orchestrator;
-
   @Rule
   public ExpectedException thrown = ExpectedException.none();
 
+  private Orchestrator orchestrator;
+
+  private UserRule userRule;
+
   @After
   public void stop() {
     if (orchestrator != null) {
+      userRule.resetUsers();
       orchestrator.stop();
     }
   }
@@ -61,9 +65,10 @@ public class SettingsTestRestartingOrchestrator {
       .addPlugin(pluginArtifact("license-plugin"))
       .setServerProperty("sonar.secretKeyPath", secretKeyUrl.getFile())
       .build();
-    orchestrator.start();
+    startOrchestrator();
 
-    Navigation nav = Navigation.get(orchestrator).openHomepage().logIn().asAdmin();
+    String adminUser = userRule.createAdminUser();
+    Navigation nav = Navigation.get(orchestrator).openHomepage().logIn().submitCredentials(adminUser);
 
     nav.openSettings(null)
       .assertMenuContains("General")
@@ -86,7 +91,7 @@ public class SettingsTestRestartingOrchestrator {
       .addPlugin(xooPlugin())
       .setServerProperty("sonar.deprecatedKey", "true")
       .build();
-    orchestrator.start();
+    startOrchestrator();
 
     SonarScanner withDeprecatedKey = SonarScanner.create(projectDir("shared/xoo-sample"))
       .setProperty("sonar.deprecatedKey", "true");
@@ -95,10 +100,16 @@ public class SettingsTestRestartingOrchestrator {
     // should not fail
     orchestrator.executeBuilds(withDeprecatedKey, withNewKey);
 
-    Navigation.get(orchestrator).openHomepage().logIn().asAdmin().openSettings(null)
+    String adminUser = userRule.createAdminUser();
+    Navigation.get(orchestrator).openHomepage().logIn().submitCredentials(adminUser).openSettings(null)
       .assertMenuContains("General")
       .assertSettingDisplayed("sonar.newKey")
       .assertSettingNotDisplayed("sonar.deprecatedKey");
   }
 
+  private void startOrchestrator() {
+    orchestrator.start();
+    userRule = UserRule.from(orchestrator);
+  }
+
 }
index 7e1e861013007e337adbc71052c09cab3fe4afb5..c7a93d195754040f7f155e5843039790dad31b9d 100644 (file)
@@ -22,6 +22,7 @@ package it.uiExtension;
 import com.codeborne.selenide.Condition;
 import com.sonar.orchestrator.Orchestrator;
 import it.Category6Suite;
+import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
@@ -31,6 +32,7 @@ import org.openqa.selenium.By;
 import org.sonarqube.ws.Organizations.Organization;
 import pageobjects.Navigation;
 import util.OrganizationRule;
+import util.user.UserRule;
 
 import static com.codeborne.selenide.Condition.text;
 import static com.codeborne.selenide.Selenide.$;
@@ -41,14 +43,23 @@ public class OrganizationUiExtensionsTest {
 
   private static Orchestrator orchestrator = Category6Suite.ORCHESTRATOR;
   private static OrganizationRule organizations = new OrganizationRule(orchestrator);
+  private static UserRule userRule = UserRule.from(orchestrator);
 
   @ClassRule
   public static TestRule chain = RuleChain.outerRule(orchestrator)
-    .around(organizations);
+    .around(organizations)
+    .around(userRule);
 
   @Rule
   public Navigation nav = Navigation.get(orchestrator);
 
+  private String adminUser;
+
+  @Before
+  public void before() {
+    adminUser = userRule.createRootUser();
+  }
+
   @Test
   public void organization_page() {
     Organization organization = organizations.create();
@@ -64,7 +75,7 @@ public class OrganizationUiExtensionsTest {
   @Test
   public void organization_admin_page() {
     Organization organization = organizations.create();
-    nav.logIn().asAdmin().open("/organizations/" + organization.getKey() + "/projects");
+    nav.logIn().submitCredentials(adminUser).open("/organizations/" + organization.getKey() + "/projects");
 
     $("#context-navigation a.navbar-admin-link").click();
     $(By.linkText("Organization Admin Page")).shouldBe(Condition.visible).click();
index 867f8d75afe7db1985b04e2efd2076500b05462c..16905e08ef6a78e3bd40eb5e44e4ad20e9c217a6 100644 (file)
@@ -22,12 +22,14 @@ package it.uiExtension;
 import com.sonar.orchestrator.Orchestrator;
 import com.sonar.orchestrator.build.SonarScanner;
 import it.Category4Suite;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
 import org.openqa.selenium.By;
 import pageobjects.Navigation;
+import util.user.UserRule;
 
 import static com.codeborne.selenide.Condition.text;
 import static com.codeborne.selenide.Selenide.$;
@@ -41,8 +43,12 @@ public class UiExtensionsTest {
   @ClassRule
   public static Orchestrator orchestrator = Category4Suite.ORCHESTRATOR;
 
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
+
   @Rule
   public Navigation nav = Navigation.get(orchestrator);
+  private String adminUser;
 
   @BeforeClass
   public static void setUp() throws Exception {
@@ -50,6 +56,11 @@ public class UiExtensionsTest {
     orchestrator.executeBuild(SonarScanner.create(projectDir("shared/xoo-sample")));
   }
 
+  @Before
+  public void before() {
+    adminUser = userRule.createAdminUser();
+  }
+
   @Test
   public void test_static_files() {
     runSelenese(orchestrator, "/uiExtension/UiExtensionsTest/static-files.html");
@@ -69,7 +80,7 @@ public class UiExtensionsTest {
 
   @Test
   public void global_admin_page() {
-    nav.logIn().asAdmin().open("/about");
+    nav.logIn().submitCredentials(adminUser).open("/about");
 
     $(".navbar-admin-link").click();
     $("#settings-navigation-configuration").click();
@@ -92,7 +103,7 @@ public class UiExtensionsTest {
 
   @Test
   public void project_admin_page() {
-    nav.logIn().asAdmin().open("/dashboard?id=sample");
+    nav.logIn().submitCredentials(adminUser).open("/dashboard?id=sample");
 
     $("#component-navigation-admin").click();
     $(By.linkText("Project Admin Page")).click();
index 8c86213b52780e56adf14c4a0c26374370c7b1b7..a69dd90d679d05eecc54f3e05118bc6fc157b106 100644 (file)
@@ -22,7 +22,7 @@ package it.user;
 import com.sonar.orchestrator.Orchestrator;
 import it.Category4Suite;
 import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Rule;
 import org.junit.Test;
@@ -39,6 +39,7 @@ import static org.sonarqube.ws.client.WsRequest.Method.GET;
 import static org.sonarqube.ws.client.WsRequest.Method.POST;
 import static util.ItUtils.newAdminWsClient;
 import static util.ItUtils.newWsClient;
+import static util.ItUtils.resetSettings;
 import static util.ItUtils.setServerProperty;
 
 public class ForceAuthenticationTest {
@@ -48,17 +49,17 @@ public class ForceAuthenticationTest {
   @ClassRule
   public static final Orchestrator orchestrator = Category4Suite.ORCHESTRATOR;
 
-  @ClassRule
-  public static UserRule userRule = UserRule.from(orchestrator);
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
 
   @Rule
   public Navigation nav = Navigation.get(orchestrator);
 
-  static WsClient anonymousClient;
-  static WsClient adminWsClient;
+  private static WsClient anonymousClient;
+  private static WsClient adminWsClient;
 
-  @BeforeClass
-  public static void setUp() throws Exception {
+  @Before
+  public void setUp() throws Exception {
     userRule.resetUsers();
     userRule.createUser(LOGIN, LOGIN);
     setServerProperty(orchestrator, "sonar.forceAuthentication", "true");
@@ -68,7 +69,7 @@ public class ForceAuthenticationTest {
 
   @AfterClass
   public static void tearDown() throws Exception {
-    setServerProperty(orchestrator, "sonar.forceAuthentication", null);
+    resetSettings(orchestrator, null, "sonar.forceAuthentication");
   }
 
   @Test
@@ -111,9 +112,10 @@ public class ForceAuthenticationTest {
 
   @Test
   public void redirect_to_login_page() {
+    String userAdmin = userRule.createAdminUser();
     Navigation page = nav.openHomepage();
     page.shouldBeRedirectToLogin();
-    page.openLogin().submitCredentials("admin", "admin").shouldBeLoggedIn();
+    page.openLogin().submitCredentials(userAdmin, userAdmin).shouldBeLoggedIn();
     page.logOut().shouldBeRedirectToLogin();
   }
 
index b0825c67179b52b6dfe97e393fb1845f91304b9a..b3f31f9d0cb1ba0ddc221a1d11bebe91e7e76487 100644 (file)
@@ -24,8 +24,7 @@ import com.sonar.orchestrator.Orchestrator;
 import it.Category4Suite;
 import java.util.UUID;
 import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
+import org.junit.Before;
 import org.junit.ClassRule;
 import org.junit.Ignore;
 import org.junit.Rule;
@@ -36,9 +35,7 @@ import org.sonarqube.ws.client.HttpConnector;
 import org.sonarqube.ws.client.WsClient;
 import org.sonarqube.ws.client.WsClientFactories;
 import org.sonarqube.ws.client.WsResponse;
-import org.sonarqube.ws.client.permission.AddGroupWsRequest;
 import org.sonarqube.ws.client.permission.AddUserWsRequest;
-import org.sonarqube.ws.client.permission.RemoveGroupWsRequest;
 import org.sonarqube.ws.client.usertoken.GenerateWsRequest;
 import org.sonarqube.ws.client.usertoken.RevokeWsRequest;
 import org.sonarqube.ws.client.usertoken.SearchWsRequest;
@@ -56,11 +53,15 @@ import static util.selenium.Selenese.runSelenese;
 
 public class LocalAuthenticationTest {
 
+  private static final String ADMIN_USER_LOGIN = "admin-user";
+
+  private static final String LOGIN = "george.orwell";
+
   @ClassRule
   public static Orchestrator ORCHESTRATOR = Category4Suite.ORCHESTRATOR;
 
-  @ClassRule
-  public static UserRule userRule = UserRule.from(ORCHESTRATOR);
+  @Rule
+  public UserRule userRule = UserRule.from(ORCHESTRATOR);
 
   @Rule
   public Navigation nav = Navigation.get(ORCHESTRATOR);
@@ -69,12 +70,8 @@ public class LocalAuthenticationTest {
 
   private static UserTokensService userTokensWsClient;
 
-  private static final String LOGIN = "george.orwell";
-
-  @BeforeClass
-  public static void setUp() {
-    ORCHESTRATOR.resetData();
-
+  @Before
+  public void setUp() {
     adminWsClient = newAdminWsClient(ORCHESTRATOR);
     userTokensWsClient = adminWsClient.userTokens();
 
@@ -83,10 +80,11 @@ public class LocalAuthenticationTest {
     addUserPermission(LOGIN, "admin");
 
     userRule.createUser("simple-user", "password");
+    userRule.createAdminUser(ADMIN_USER_LOGIN, ADMIN_USER_LOGIN);
   }
 
-  @AfterClass
-  public static void deleteAndRestoreData() {
+  @After
+  public void deleteAndRestoreData() {
     userRule.resetUsers();
   }
 
@@ -246,15 +244,4 @@ public class LocalAuthenticationTest {
       .setPermission(permission));
   }
 
-  private static void removeGroupPermission(String groupName, String permission) {
-    adminWsClient.permissions().removeGroup(new RemoveGroupWsRequest()
-      .setGroupName(groupName)
-      .setPermission(permission));
-  }
-
-  private static void addGroupPermission(String groupName, String permission) {
-    adminWsClient.permissions().addGroup(new AddGroupWsRequest()
-      .setGroupName(groupName)
-      .setPermission(permission));
-  }
 }
index d6736902c77d885257dfc1edbf5200ae9f270ea8..5b3ac57ffccca76ad5b05f904770e6cff763d414 100644 (file)
@@ -31,6 +31,7 @@ import org.junit.Test;
 import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.WsClient;
 import pageobjects.Navigation;
+import util.user.UserRule;
 
 import static com.codeborne.selenide.Condition.text;
 import static com.codeborne.selenide.Condition.visible;
@@ -45,8 +46,12 @@ public class MyAccountPageTest {
   public static Orchestrator orchestrator = Category4Suite.ORCHESTRATOR;
   private static WsClient adminWsClient;
 
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
+
   @Rule
   public Navigation nav = Navigation.get(orchestrator);
+  private String adminUser;
 
   @BeforeClass
   public static void setUp() {
@@ -55,6 +60,7 @@ public class MyAccountPageTest {
 
   @Before
   public void initUser() {
+    adminUser = userRule.createAdminUser();
     createUser("account-user", "User With Account", "user@example.com");
   }
 
@@ -101,7 +107,7 @@ public class MyAccountPageTest {
 
   @Test
   public void notifications() {
-    nav.logIn().asAdmin().openNotifications()
+    nav.logIn().submitCredentials(adminUser).openNotifications()
       .addGlobalNotification("ChangesOnMyIssue")
       .addGlobalNotification("NewIssues")
       .removeGlobalNotification("ChangesOnMyIssue");
index 656fb1a6f420cf8130839078ccc0fc5e450f6bcf..bb8fb26b857945034129b0ce777e31f2ddb43c00 100644 (file)
@@ -49,6 +49,7 @@ import static org.junit.Assert.fail;
 import static util.ItUtils.newAdminWsClient;
 import static util.ItUtils.newUserWsClient;
 import static util.ItUtils.pluginArtifact;
+import static util.ItUtils.resetSettings;
 import static util.ItUtils.setServerProperty;
 import static util.selenium.Selenese.runSelenese;
 
@@ -59,12 +60,13 @@ import static util.selenium.Selenese.runSelenese;
  */
 public class RealmAuthenticationTest {
 
+  private static final String TECH_USER = "techUser";
+  private static final String USER_LOGIN = "tester";
+  private static final String ADMIN_USER_LOGIN = "admin-user";
+
   @Rule
   public ExpectedException thrown = ExpectedException.none();
 
-  static final String TECH_USER = "techUser";
-  static final String USER_LOGIN = "tester";
-
   /**
    * Property from security-plugin for user management.
    */
@@ -76,15 +78,23 @@ public class RealmAuthenticationTest {
     .setServerProperty("sonar.security.realm", "FakeRealm")
     .build();
 
-  @ClassRule
-  public static UserRule USER_RULE = UserRule.from(orchestrator);
+  @Rule
+  public UserRule userRule = UserRule.from(orchestrator);
 
   @Before
   @After
   public void resetData() throws Exception {
-    setServerProperty(orchestrator, USERS_PROPERTY, null);
-    setServerProperty(orchestrator, "sonar.security.updateUserAttributes", null);
-    USER_RULE.resetUsers();
+    resetSettings(orchestrator, null, USERS_PROPERTY, "sonar.security.updateUserAttributes");
+  }
+
+  @Before
+  public void initAdminUser() throws Exception {
+    userRule.createAdminUser(ADMIN_USER_LOGIN, ADMIN_USER_LOGIN);
+  }
+
+  @After
+  public void deleteAdminUser() {
+    userRule.resetUsers();
   }
 
   /**
@@ -312,7 +322,7 @@ public class RealmAuthenticationTest {
       USER_LOGIN + ".email", "tester@example.org"));
 
     verifyAuthenticationIsOk(USER_LOGIN, "123");
-    assertThat(USER_RULE.getUserByLogin(USER_LOGIN).get())
+    assertThat(userRule.getUserByLogin(USER_LOGIN).get())
       .extracting(Users.User::isLocal, Users.User::getExternalIdentity, Users.User::getExternalProvider)
       .containsOnly(false, USER_LOGIN, "sonarqube");
   }
index f9afa6a289b3041461d4d54494386b30cd0d71db..88585279333756f4cf189a9a23207000f005ea8f 100644 (file)
@@ -32,12 +32,12 @@ public class LoginPage {
     $("#login_form").should(Condition.exist);
   }
 
-  public Navigation submitCredentials(String login, String password) {
-    return submitCredentials(login, password, Navigation.class);
+  public Navigation submitCredentials(String login) {
+    return submitCredentials(login, login, Navigation.class);
   }
 
-  public Navigation asAdmin() {
-    return submitCredentials("admin", "admin");
+  public Navigation submitCredentials(String login, String password) {
+    return submitCredentials(login, password, Navigation.class);
   }
 
   public Navigation useOAuth2() {
index 370bb7892dabf121d1dec1e4694c6ede3b78b70b..de0bce71faafb860a037cafe3dae1e6b271411b0 100644 (file)
@@ -36,6 +36,7 @@ import org.sonarqube.ws.client.GetRequest;
 import org.sonarqube.ws.client.PostRequest;
 import org.sonarqube.ws.client.WsClient;
 import org.sonarqube.ws.client.WsResponse;
+import org.sonarqube.ws.client.permission.AddUserWsRequest;
 import org.sonarqube.ws.client.user.CreateRequest;
 import org.sonarqube.ws.client.user.SearchRequest;
 import org.sonarqube.ws.client.user.UsersService;
@@ -44,6 +45,7 @@ import util.selenium.Consumer;
 import static java.util.Arrays.asList;
 import static java.util.Arrays.stream;
 import static java.util.Objects.requireNonNull;
+import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.guava.api.Assertions.assertThat;
 import static util.ItUtils.newAdminWsClient;
@@ -137,6 +139,35 @@ public class UserRule extends ExternalResource implements GroupManagement {
     return user;
   }
 
+  /**
+   * Create a new admin user with random login, having password same as login
+   */
+  public String createAdminUser() {
+    String login = randomAlphabetic(10).toLowerCase();
+    return createAdminUser(login, login);
+  }
+
+  public String createAdminUser(String login, String password) {
+    createUser(login, password);
+    adminWsClient.permissions().addUser(new AddUserWsRequest().setLogin(login).setPermission("admin"));
+    adminWsClient.userGroups().addUser(org.sonarqube.ws.client.usergroup.AddUserWsRequest.builder().setLogin(login).setName("sonar-administrators").build());
+    return login;
+  }
+
+  /**
+   * Create a new root user with random login, having password same as login
+   */
+  public String createRootUser() {
+    String login = randomAlphabetic(10).toLowerCase();
+    return createRootUser(login, login);
+  }
+
+  public String createRootUser(String login, String password) {
+    createUser(login, password);
+    setRoot(login);
+    return login;
+  }
+
   public void setRoot(String login) {
     adminWsClient().rootService().setRoot(login);
   }
index f7b84ad9f739f61d48933d3a47d16063207d2158..06e806cf2597dd9026ec052585444d4231cc2cb2 100644 (file)
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
 </tr>
 <tr>
        <td>waitForElementPresent</td>
-       <td>css=[data-login=admin]</td>
+       <td>css=[data-login=admin-user]</td>
        <td></td>
 </tr>
 <tr>
        <td>click</td>
-       <td>css=[data-login=admin] .js-user-change-password</td>
+       <td>css=[data-login=admin-user] .js-user-change-password</td>
        <td></td>
 </tr>
 <tr>
 <tr>
        <td>type</td>
        <td>id=change-user-password-old-password</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>id=change-user-password-password</td>
-       <td>admin</td>
+       <td>new-admin-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>id=change-user-password-password-confirmation</td>
-       <td>admin</td>
+       <td>new-admin-user</td>
 </tr>
 <tr>
        <td>click</td>
index f0d1c67e06ac57124e7f2a6ced3789ba842e1027..c81949c4d10634b4bc89c1b16395ab00674c6866 100644 (file)
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index a94ad28f14dc54df33808e092eb1bb07976e5aef..0e67e0f4fab2ffa6e972105ce514e6af17f0f972 100644 (file)
@@ -9,91 +9,91 @@
 <table cellpadding="1" cellspacing="1" border="1">
   <tbody>
   <tr>
-       <td>open</td>
-       <td>/sessions/logout</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/sessions/new</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>/permission_templates</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForElementPresent</td>
-       <td>css=.page-actions button</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>css=.page-actions button</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForElementPresent</td>
-       <td>css=#permission-template-name</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>css=#permission-template-name</td>
-       <td>Custom</td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>css=#permission-template-description</td>
-       <td>Description</td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>css=#permission-template-project-key-pattern</td>
-       <td>.*</td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>css=#permission-template-submit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForElementPresent</td>
-       <td>css=tr[data-name=&quot;Custom&quot;]</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertText</td>
-       <td>css=tr[data-name=&quot;Custom&quot;] .js-name</td>
-       <td>*Custom*</td>
-</tr>
-<tr>
-       <td>assertText</td>
-       <td>css=tr[data-name=&quot;Custom&quot;] .js-description</td>
-       <td>*Description*</td>
-</tr>
-<tr>
-       <td>assertText</td>
-       <td>css=tr[data-name=&quot;Custom&quot;] .js-project-key-pattern</td>
-       <td>*.*</td>
-</tr>
-</tbody>
+    <td>open</td>
+    <td>/sessions/logout</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>open</td>
+    <td>/sessions/new</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>type</td>
+    <td>password</td>
+    <td>root-user</td>
+  </tr>
+  <tr>
+    <td>type</td>
+    <td>login</td>
+    <td>root-user</td>
+  </tr>
+  <tr>
+    <td>clickAndWait</td>
+    <td>name=commit</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>open</td>
+    <td>/permission_templates</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>waitForElementPresent</td>
+    <td>css=.page-actions button</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>click</td>
+    <td>css=.page-actions button</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>waitForElementPresent</td>
+    <td>css=#permission-template-name</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>type</td>
+    <td>css=#permission-template-name</td>
+    <td>Custom</td>
+  </tr>
+  <tr>
+    <td>type</td>
+    <td>css=#permission-template-description</td>
+    <td>Description</td>
+  </tr>
+  <tr>
+    <td>type</td>
+    <td>css=#permission-template-project-key-pattern</td>
+    <td>.*</td>
+  </tr>
+  <tr>
+    <td>click</td>
+    <td>css=#permission-template-submit</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>waitForElementPresent</td>
+    <td>css=tr[data-name=&quot;Custom&quot;]</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>assertText</td>
+    <td>css=tr[data-name=&quot;Custom&quot;] .js-name</td>
+    <td>*Custom*</td>
+  </tr>
+  <tr>
+    <td>assertText</td>
+    <td>css=tr[data-name=&quot;Custom&quot;] .js-description</td>
+    <td>*Description*</td>
+  </tr>
+  <tr>
+    <td>assertText</td>
+    <td>css=tr[data-name=&quot;Custom&quot;] .js-project-key-pattern</td>
+    <td>*.*</td>
+  </tr>
+  </tbody>
 </table>
 </body>
 </html>
index c10e672f476645d3a17112e8a76e8b0d06cefef1..3d1c172a783112ff24de35050424732fa6c19eb8 100644 (file)
 <table cellpadding="1" cellspacing="1" border="1">
   <tbody>
   <tr>
-       <td>open</td>
-       <td>/sessions/logout</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/sessions/new</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>/permission_templates</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForElementPresent</td>
-       <td>css=td[data-permission=&quot;user&quot;]</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>css=td[data-permission=&quot;user&quot;] .js-update-users</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForElementPresent</td>
-       <td>css=#grant-to-project-creators</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertElementPresent</td>
-       <td>css=#grant-to-project-creators:not(:checked)</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>css=#grant-to-project-creators</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>css=.js-modal-close</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForElementPresent</td>
-       <td>css=td[data-permission=&quot;user&quot;] .js-project-creators</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>css=td[data-permission=&quot;user&quot;] .js-update-users</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForElementPresent</td>
-       <td>css=#grant-to-project-creators</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertElementPresent</td>
-       <td>css=#grant-to-project-creators:checked</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>css=#grant-to-project-creators</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>css=.js-modal-close</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForElementNotPresent</td>
-       <td>css=td[data-permission=&quot;user&quot;] .js-project-creators</td>
-       <td></td>
-</tr>
-</tbody>
+    <td>open</td>
+    <td>/sessions/logout</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>open</td>
+    <td>/sessions/new</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>type</td>
+    <td>password</td>
+    <td>admin-user</td>
+  </tr>
+  <tr>
+    <td>type</td>
+    <td>login</td>
+    <td>admin-user</td>
+  </tr>
+  <tr>
+    <td>clickAndWait</td>
+    <td>name=commit</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>open</td>
+    <td>/permission_templates</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>waitForElementPresent</td>
+    <td>css=td[data-permission=&quot;user&quot;]</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>click</td>
+    <td>css=td[data-permission=&quot;user&quot;] .js-update-users</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>waitForElementPresent</td>
+    <td>css=#grant-to-project-creators</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>assertElementPresent</td>
+    <td>css=#grant-to-project-creators:not(:checked)</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>click</td>
+    <td>css=#grant-to-project-creators</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>click</td>
+    <td>css=.js-modal-close</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>waitForElementPresent</td>
+    <td>css=td[data-permission=&quot;user&quot;] .js-project-creators</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>click</td>
+    <td>css=td[data-permission=&quot;user&quot;] .js-update-users</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>waitForElementPresent</td>
+    <td>css=#grant-to-project-creators</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>assertElementPresent</td>
+    <td>css=#grant-to-project-creators:checked</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>click</td>
+    <td>css=#grant-to-project-creators</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>click</td>
+    <td>css=.js-modal-close</td>
+    <td></td>
+  </tr>
+  <tr>
+    <td>waitForElementNotPresent</td>
+    <td>css=td[data-permission=&quot;user&quot;] .js-project-creators</td>
+    <td></td>
+  </tr>
+  </tbody>
 </table>
 </body>
 </html>
index 05481cc64174f957fc910e5f7ee6e4b62ba23421..88d01cd0da4d82081f23dbfd247eefa7db6580e2 100644 (file)
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>root-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>root-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index 0e81c2ae5831e63cd5321dd2773e5f26438389d7..41fae4ae338b56acee6f6f338741226f4a7edb31 100644 (file)
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>root-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>root-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index 0b6f9725b82cbde3514d73c9546e0a2b4ee2d5e6..4f3a2793d2997168234d62c16ba98503a8cc4a7e 100644 (file)
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>root-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>root-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index 84c26bcc1836e0f93e22261179dae5613bf8bc2e..3ae2ebd71d291e84f2fe2a4eac382e53be1a4de7 100644 (file)
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>root-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>root-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index e122c3f03185a72d1bcfe403ad07d4e16ca65e0e..807f14a50c66e2e416f988b18384b25bb404c697 100644 (file)
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>root-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>root-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index 6560ffa196d5e1418c29c34ba3d578389c123f69..d770d855393504b17803b4739f8ecf6706eac20f 100644 (file)
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>root-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>root-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index 375340060e7c9bd565e462fea53d3ef5dc1e74b3..e28cdbba827bcdd8add2d83a02aa22277ffbf8b6 100644 (file)
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>click</td>
index 3752d35ee362d279c0c1baa5c969084020f9f243..b6256e49b35bfbc369a4235c9f2477d3f62393ae 100644 (file)
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index f27fd03f598b3e862b6fb79d2670f8ba0d447fce..f336f7e93b96bf99514213b3875057f557fc0d7d 100644 (file)
   <tr>
     <td>type</td>
     <td>login</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>type</td>
     <td>password</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>click</td>
index c177580ffe19ece5d9a80ff1fc77e6d53374241e..ada80dbf6b367cca8bf89e8c137be6764cf30bc3 100644 (file)
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index 0506fd2d2a599523878c4c1a1cc1451391c5b916..61c550aec535ef22f25dfe41326eecb7381407ae 100644 (file)
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index 15bc4d429d3b93e5268a85334f7875bfb3dd586a..6574ed04017c0139a9e365db34513cc99c3542cc 100644 (file)
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index ddeb8dabdc724d9af7c041587e9c43b11a5fbea7..609e4871865445da23795d5ec08589df87049c34 100644 (file)
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index ff6510a9c86c8b5a5bde3d8593cae663bf4b1b33..a1d952d31dccf7d3e02bcaf167311d7a5bb78ce4 100644 (file)
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index b2051f7c7273e92ca241e9a147f4534f1059cabf..1a6425b6462797fffa44e0037c73287f8110bb40 100644 (file)
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index eb9f7ea5cf19397099bc4ce8dd6b41fbd0c0b09a..e304586c59c20f2d313dfe7b1b288342105c8554 100644 (file)
   <tr>
     <td>type</td>
     <td>login</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>type</td>
     <td>password</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>clickAndWait</td>
index efdcbe2969ebdca1ab8d674b48423da35a3b3ab8..f7d0dd6ffb6ded62e9633cb3f548616452e1c571 100644 (file)
 <tr>
        <td>type</td>
        <td>login</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>type</td>
        <td>password</td>
-       <td>admin</td>
+       <td>admin-user</td>
 </tr>
 <tr>
        <td>clickAndWait</td>
index 96cd2485e47471480756d92e1ef0814e8a11da96..4c5a751665dbfedf92c81ef419c0f8dfa152d0d7 100644 (file)
   <tr>
     <td>type</td>
     <td>login</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>type</td>
     <td>password</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>clickAndWait</td>
index af55b2bfe64622f6f19a57cdd885bd0fcf49b6a4..18da805f66b9caa160602de5ecd6e01fd2e937e3 100644 (file)
   <tr>
     <td>type</td>
     <td>login</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>type</td>
     <td>password</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>clickAndWait</td>
index 5b031cde7e409ba60b05db1eef6c904d11713adf..dc66db8ee9b1a0fa299bbb29f9a1cbe5a6caa9ea 100644 (file)
@@ -21,7 +21,7 @@
   <tr>
     <td>type</td>
     <td>login</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>type</td>
index 5dc242adcc463a77cb36b1e55a879f258e5604dc..c6519726f27fd5e52011b3e0faaeab619e6469a6 100644 (file)
   <tr>
     <td>type</td>
     <td>login</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>type</td>
     <td>password</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>clickAndWait</td>
index 41624fdd297ff016d4c495de34326e69dc753824..aecfd8af765983b5165b04e9d2d947c52bede9ce 100644 (file)
   <tr>
     <td>type</td>
     <td>login</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>type</td>
     <td>password</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>clickAndWait</td>
index 0d9fbff40bbe44bbb516e5119a4b0f60ed0957cd..5359e3308e04e7396d9afb3ee5c769d002eb8e76 100644 (file)
   <tr>
     <td>type</td>
     <td>login</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>type</td>
     <td>password</td>
-    <td>admin</td>
+    <td>admin-user</td>
   </tr>
   <tr>
     <td>clickAndWait</td>