84225f6ec222dbd57eefe78511ca65461d77517d
[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
11 public abstract class DeployOldDialogBase extends DeployDialogBase {
12
13     @Override
14     public void waitForDialogToLoad() {
15         GeneralUIUtils.ultimateWait();
16     }
17
18     @Override
19     public void closeDialog(){
20         clickCancelButtonByTestID();
21     }
22
23     @Override
24     public  void assertDialog(){
25         assertTitle();
26         boolean byText = GeneralUIUtils.findAndWaitByText(Constants.BrowseASDC.CREATE_SERVICE_INSTANCE, 15);
27         Assert.assertTrue(byText);
28     }
29
30     public void assertTitle(){
31         WebElement modalTitle = GeneralUIUtils.getWebElementByTestID(Constants.CREATE_MODAL_TITLE_ID, 30);
32         assertThat(modalTitle.getText().toLowerCase(), containsString(getTitle()));
33     }
34
35     public abstract String getTitle();
36 }