org.sitoolkit.tester.infra.PropertyManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sit-wt Show documentation
Show all versions of sit-wt Show documentation
SIToolkit for Web Testing
The newest version!
package org.sitoolkit.tester.infra;
import java.util.Properties;
import org.apache.commons.lang3.math.NumberUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class PropertyManager {
private static final Logger LOG = LoggerFactory.getLogger(PropertyManager.class);
private Properties properties = new Properties();
public int getWindowWidth() {
return NumberUtils.toInt(getProperty("window.width"), 900);
}
public int getWindowHeight() {
return NumberUtils.toInt(getProperty("window.height"), 900);
}
public int getImplicitlyWait() {
return NumberUtils.toInt(getProperty("implicitly.wait"), 5000);
}
public boolean isResizeWindow() {
return Boolean.parseBoolean(getProperty("window.resize"));
}
public String getPageObjectDir() {
return getProperty("pageobj.dir", "pageobj");
}
private String getProperty(String key) {
return getProperty(key, "");
}
private String getProperty(String key, String defaultValue) {
return properties.getProperty(key, System.getProperty("sitwt." + key, defaultValue));
}
public Properties getProperties() {
return properties;
}
public void setProperties(Properties properties) {
this.properties = properties;
LOG.info("プロパティが設定されました。{}", properties);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy