@Test
  public void addDeviceUserCommand() throws Exception {
    String device = "test-hpux.zenoss.loc";
    String deviceClass = "/Server/SSH/HP-UX";
    String commandID = "NewUserCommand";
    String description = "New command";
    String command = "echo name = ${here/id}";

    Common.Login(sClient, ZenossConstants.adminUserName, ZenossConstants.adminPassword);
    Thread.sleep(12000);
    // Add device
    Device addDevice = new Device("" + device + "", sClient);
    addDevice.add("" + deviceClass + "");
    Thread.sleep(10000);

    sClient.click("link=Infrastructure");
    sClient.waitForPageToLoad("30000");
    Thread.sleep(3000);
    // Click on the device
    sClient.click("link=" + device + "");
    sClient.waitForPageToLoad("30000");
    // Click on Administration
    Thread.sleep(5000);
    sClient.click("//ul[@id='ext-gen243']/div/li[7]/div/a/span");
    Thread.sleep(15000);
    // Click on gear menu on Define Commands
    sClient.click("//table[@id='ext-comp-1001']/tbody/tr[2]/td[2]/em");
    // Click on Add User Command...
    Thread.sleep(1000);
    sClient.click("UserCommandlistaddUserCommand");
    // Enter Command ID
    Thread.sleep(1000);
    sClient.type("new_id", commandID);
    // Click Ok button
    Thread.sleep(1000);
    sClient.click("//input[@id='dialog_submit']");
    Thread.sleep(5000);
    selenese.verifyTrue(sClient.isTextPresent("User command " + commandID + " has been created."));
    // Enter a Description
    sClient.type("description:text", description);
    // Enter a Command
    sClient.type("command:text", command);
    // Type admin password
    sClient.type("password", ZenossConstants.adminPassword);
    sClient.selectWindow("null");
    // Click on Save button
    Thread.sleep(2000);
    sClient.click("//input[@value=' Save ']");
    Thread.sleep(6000);
    selenese.verifyTrue(sClient.isElementPresent("//a[text()='" + commandID + "']"));
    selenese.verifyTrue(sClient.isElementPresent("//td[text()='" + description + "']"));
    selenese.verifyTrue(sClient.isElementPresent("//td[text()='" + command + "']"));

    testCaseResult = "p";
  }
Пример #2
0
  @Test
  public void userToGroup() throws Exception {
    String user = "******";
    String group = "GroupZenoss3";

    Common.Login(sClient, ZenossConstants.adminUserName, ZenossConstants.adminPassword);
    Thread.sleep(12000);

    // Click on Advanced
    sClient.click("link=Advanced");
    sClient.waitForPageToLoad("30000");
    // Click Users
    sClient.click("link=Users");
    sClient.waitForPageToLoad("30000");

    // Create new User
    Users.addNewUser(sClient, user, "*****@*****.**");

    // Create new Group
    Users.newUserGroup(sClient, group);
    Thread.sleep(3000);
    selenese.verifyTrue(sClient.isElementPresent("//a[text()='" + group + "']"));

    Thread.sleep(3000);
    // Add user to a group
    Users.UserToGroup(sClient, user, group);

    testCaseResult = "p";
  }