adding orchestration type to service models view
[vid.git] / vid-automation / src / main / java / vid / automation / test / sections / BrowseASDCPage.java
1 package vid.automation.test.sections;
2
3 import org.junit.Assert;
4 import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
5 import org.openqa.selenium.WebElement;
6 import vid.automation.test.Constants;
7 import vid.automation.test.infra.Get;
8
9 import java.util.List;
10
11 /**
12  * Created by itzikliderman on 13/06/2017.
13  */
14 public class BrowseASDCPage extends VidBasePage {
15
16     public String generateInstanceName() {
17         return generateInstanceName(Constants.BrowseASDC.SERVICE_INSTANCE_NAME_PREFIX);
18     }
19
20     public VidBasePage clickPreviousVersionButton() {
21         GeneralUIUtils.clickOnElementByText(Constants.PREVIOUS_VERSION, 30);
22         return this;
23     }
24
25     public void assertPreviousVersionButtonNotExists(String expectedInvariantUUID){
26         boolean exists = Get.byTestId("PreviousVersion-" + expectedInvariantUUID).isDisplayed();
27         Assert.assertFalse(exists);
28     }
29
30     public void assertSearchFilterValue(String value){
31         String searchKey = this.getInputValue(Constants.BROWSE_SEARCH);
32         org.testng.Assert.assertEquals(searchKey, value);
33     }
34
35     public void fillFilterText(String text){
36         this.setInputText(Constants.BROWSE_SEARCH, text);
37     }
38
39     public int countCurrentRowsInTable(){
40         List<WebElement> rowsInTable = Get.byClass("sdcServiceModel");
41        return rowsInTable.size();
42     }
43
44 }