allow openPreviousVersionPopup test to handle modern UI aLaCarte dialog
[vid.git] / vid-automation / src / main / java / vid / automation / test / sections / deploy / DeployOldDialogBase.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.junit.Assert;
7 import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
8 import org.openqa.selenium.WebElement;
9 import vid.automation.test.Constants;
10 import vid.automation.test.infra.Get;
11
12 public abstract class DeployOldDialogBase extends DeployDialogBase {
13
14     @Override
15     public void waitForDialogToLoad() {
16         GeneralUIUtils.ultimateWait();
17     }
18
19     @Override
20     public void closeDialog(){
21         clickCancelButtonByTestID();
22     }
23
24     @Override
25     public  void assertDialog(){
26         assertTitle();
27         boolean byText = GeneralUIUtils.findAndWaitByText(Constants.BrowseASDC.CREATE_SERVICE_INSTANCE, 15);
28         Assert.assertTrue(byText);
29     }
30
31     public void assertTitle(){
32         WebElement modalTitle = GeneralUIUtils.getWebElementByTestID(Constants.CREATE_MODAL_TITLE_ID, 30);
33         assertThat(modalTitle.getText().toLowerCase(), containsString(getTitle()));
34     }
35
36     @Override
37     public String getModelVersionId() {
38         return Get.byTestId("Service UUID").getText();
39     }
40
41     public abstract String getTitle();
42 }