allow openPreviousVersionPopup test to handle modern UI aLaCarte dialog
[vid.git] / vid-automation / src / main / java / vid / automation / test / sections / deploy / DeployModernUIBase.java
1 package vid.automation.test.sections.deploy;
2
3 import static org.hamcrest.MatcherAssert.assertThat;
4 import static org.hamcrest.Matchers.containsString;
5
6 import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
7 import org.openqa.selenium.WebElement;
8 import vid.automation.test.Constants;
9 import vid.automation.test.infra.Exists;
10 import vid.automation.test.infra.Get;
11
12 public abstract class DeployModernUIBase extends DeployDialogBase {
13
14     @Override
15     public void waitForDialogToLoad() {
16         goToIframe();
17     }
18
19     String dialogTitle = "Set a new service instance";
20
21     public void assertTitle(){
22         WebElement modalTitle = GeneralUIUtils.getWebElementByTestID(Constants.CREATE_MODAL_TITLE_ID, 30);
23         assertThat(modalTitle.getText(), containsString(dialogTitle));
24     }
25
26     @Override
27     public void closeDialog(){
28         GeneralUIUtils.ultimateWait();
29         clickCancelButtonByTestID();
30         goOutFromIframe();
31     }
32
33     @Override
34     public void assertDialog() {
35         assertTitle();
36     }
37
38     @Override
39     public String getModelVersionId() {
40         return Get.byTestId("model-item-value-uuid").getText();
41     }
42
43     protected boolean isLcpRegionExist() {
44         return Exists.byTestId(Constants.ViewEdit.LCP_REGION_SELECT_TESTS_ID);
45     }
46
47     public void clickOwningEntitySelect() {
48         GeneralUIUtils.clickOnElementByTestId(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
49     }
50
51     public void clickProjectSelect() {
52         GeneralUIUtils.clickOnElementByTestId(Constants.OwningEntity.PROJECT_SELECT_TEST_ID);
53     }
54 }