summaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/java/vid/automation/test/sections/BrowseASDCPage.java
blob: 53a67821de49bd0b07ab401e994a403cbc82f83f (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
43
44
package vid.automation.test.sections;

import org.junit.Assert;
import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
import org.openqa.selenium.WebElement;
import vid.automation.test.Constants;
import vid.automation.test.infra.Get;

import java.util.List;

/**
 * Created by itzikliderman on 13/06/2017.
 */
public class BrowseASDCPage extends VidBasePage {

    public String generateInstanceName() {
        return generateInstanceName(Constants.BrowseASDC.SERVICE_INSTANCE_NAME_PREFIX);
    }

    public VidBasePage clickPreviousVersionButton() {
        GeneralUIUtils.clickOnElementByText(Constants.PREVIOUS_VERSION, 30);
        return this;
    }

    public void assertPreviousVersionButtonNotExists(String expectedInvariantUUID){
        boolean exists = Get.byTestId("PreviousVersion-" + expectedInvariantUUID).isDisplayed();
        Assert.assertFalse(exists);
    }

    public void assertSearchFilterValue(String value){
        String searchKey = this.getInputValue(Constants.BROWSE_SEARCH);
        org.testng.Assert.assertEquals(searchKey, value);
    }

    public void fillFilterText(String text){
        this.setInputText(Constants.BROWSE_SEARCH, text);
    }

    public int countCurrentRowsInTable(){
        List<WebElement> rowsInTable = Get.byClass("alt-row");
       return rowsInTable.size();
    }

}