コード例 #1
0
  private void editServer(ServerMap server, String expectedServerName, String expectedClusterName) {
    storageSahiTasks.div(server.getServerHostIP()).click(); // Click on Server
    storageSahiTasks.div("MainTabHostView_table_Edit").click();
    storageSahiTasks.textbox("HostPopupView_name").setValue(expectedServerName);
    if (expectedClusterName != null) {
      storageSahiTasks.select("HostPopupView_cluster").choose(expectedClusterName);
    }

    for (int i = 0; i < 5; i++) {
      if (storageSahiTasks.div("OK").exists()) {
        storageSahiTasks._logger.log(
            Level.INFO, "Server [" + server.getServerName() + "] click OK.");
        storageSahiTasks.div("OK").click();
      } else {
        break;
      }
    }
  }
コード例 #2
0
  /*
   * Adds Server on the specified Cluster
   */
  public boolean addServer(ServerMap serverMap) {
    storageSahiTasks.selectPage(serverMap.getResourceLocation());
    storageSahiTasks.clickRefresh("Host");
    if (serverMap.isPositive()) {
      if (storageSahiTasks.div(serverMap.getServerName()).exists()) {
        failTest("Server [" + serverMap.getServerName() + "] is already on the list!");
        return false;
      }
    } else {
      if (serverMap.getServerAlreadyOnList()) {
        if (!storageSahiTasks.div(serverMap.getServerName()).exists()) {
          failTest(
              "Pre-Requirement not met: Server ["
                  + serverMap.getServerName()
                  + "] not available on the list!");
          return false;
        }
      } else {
        if (storageSahiTasks.div(serverMap.getServerName()).exists()) {
          failTest(
              "Pre-Requirement not met: Server ["
                  + serverMap.getServerName()
                  + "] already on the list!");
          return false;
        }
      }
    }

    storageSahiTasks.div("MainTabHostView_table_New").click();
    storageSahiTasks.select("HostPopupView_cluster").choose(serverMap.getClusterName());
    storageSahiTasks.textbox("HostPopupView_name").setValue(serverMap.getServerName());
    storageSahiTasks.textbox("HostPopupView_host").setValue(serverMap.getServerHostIP());
    storageSahiTasks.password("HostPopupView_userPassword").setValue(serverMap.getServerPassword());
    // storageSahiTasks.div("HostPopupView_OnSaveFalse").click();
    // storageSahiTasks.clickRefresh("Host");
    for (int i = 0; i < 10; i++) {
      if (storageSahiTasks.div("OK").exists()) {
        storageSahiTasks.div("OK").click();
      }
    }
    if (serverMap.isPositive()) {
      if (!waitForServerUpStatus(serverMap)) {
        failTest("timed out waiting for sever status to be in Up status");
        return false;
      }
    } else {
      if (storageSahiTasks.div("/" + serverMap.getErrorMsg() + "/i").exists()) {
        storageSahiTasks._logger.log(
            Level.FINE, "Volume [" + serverMap.getServerName() + "] server error pop-up appeared!");
        storageSahiTasks.closePopup("Close");
        storageSahiTasks.div("HostPopupView_Cancel").click();
        return true;
      } else {
        closeErrorDialogIfExists();
        cancelServerCreateDialogIfExists();
        failTest("Volume [" + serverMap.getServerName() + "] server error pop-up did not appear!");
        return false;
      }
    }

    return true;
  }