Пример #1
0
  public void addConfigurationExoScale(
      String configName, int cpuValue, double ramValue, boolean windows) throws Exception {
    Configuration config = new Configuration();
    config.setProvider(this);
    config.setConfigName(configName);
    config.setCpu(cpuValue);
    config.setRam(ramValue);

    WebElement disk =
        driver
            .findElement(By.className("summary"))
            .findElement(By.className("hdd"))
            .findElement(By.className("spec-value"));
    double diskValue = this.extractNumber(disk.getText());
    // System.out.println("disk : "+diskValue);

    config.setSsd(diskValue);
    if (windows) {
      config.setOsUri(URI.windows);
    } else {
      config.setOsUri(URI.linux);
    }

    Thread.sleep(500);
    WebElement price =
        driver
            .findElement(By.className("summary"))
            .findElement(By.className("price-month"))
            .findElement(By.className("price-value"));
    double priceValue = Double.parseDouble(price.getText());
    // System.out.println("price : "+priceValue);
    config.setPrice(priceValue);

    config.setDate(this.getDate());
    config.println();
    this.configurations.add(config);
  }