aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/java/vid/automation/test/sections/TestEnvironmentPage.java
blob: 5989fb6582ab281e7c93eaece519ab3633eef6b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package vid.automation.test.sections;

import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
import org.openqa.selenium.WebElement;
import vid.automation.test.Constants;
import vid.automation.test.infra.Get;
import vid.automation.test.infra.SelectOption;

import static org.junit.Assert.assertEquals;

public class TestEnvironmentPage extends VidBasePage {

    public static void clickTestEnvironmentActivate(String envId) {
        getTestEnvironmentActivationButton(envId).click();
    }

    public static void clickTestEnvironmentDeactivate(String envId) {
        getTestEnvironmentDeactivationButton(envId).click();
    }

    public static WebElement getTestEnvironmentActivationButton(String envId) {
        WebElement webElement = Get.byId(Constants.TestEnvironments.activateButtonIdPrefix + envId);
        return webElement;
    }

    public static WebElement getTestEnvironmentDeactivationButton(String envId) {
        WebElement webElement = Get.byId(Constants.TestEnvironments.deactivateButtonIdPrefix + envId);
        return webElement;
    }
    
    public static WebElement getTestEnvironmentAttachButton(String envId) {
        WebElement webElement = Get.byId(Constants.TestEnvironments.attachButtonIdPrefix + envId);
        return webElement;
    }

    public static String selectEnvRelease(String envRelease){
        GeneralUIUtils.ultimateWait();
        String selectedOption;
        selectedOption = SelectOption.getSelectedOption(Constants.TestEnvironments.ENVIRONMENT_RELEASE);
        return selectedOption;
    }
}