Merge "Fix getManualTasks double-addition of baseUrl"
[vid.git] / vid-automation / src / main / java / vid / automation / test / utils / TestConfigurationHelper.java
1 package vid.automation.test.utils;
2
3 import vid.automation.test.infra.FeaturesTogglingConfiguration;
4
5 public class TestConfigurationHelper {
6
7     private TestConfigurationHelper(){}
8
9     public static org.onap.sdc.ci.tests.datatypes.Configuration getEnvConfiguration() {
10
11         try {
12             String envUrl = System.getProperty("ENV_URL");
13             boolean isCustomLogin = Boolean.parseBoolean(System.getProperty("CUSTOM_LOGIN"));
14
15             org.onap.sdc.ci.tests.datatypes.Configuration configuration = new org.onap.sdc.ci.tests.datatypes.Configuration(envUrl, isCustomLogin);
16
17             String geckoDriverPath = System.getProperty("GECKO_PATH");
18             if(geckoDriverPath == null){
19                 throw new RuntimeException("Missing path to gecko driver." +
20                         " Make sure to provide path to the gecko driver executable with -DGECKO_PATH=<path>");
21             }
22
23             configuration.setGeckoDriverPath(geckoDriverPath);
24             FeaturesTogglingConfiguration.initializeFeatureManager();
25             return configuration;
26
27         } catch (Exception e) {
28             e.printStackTrace();
29             return null;
30         }
31     }
32 }