Provide user to specify the ouput name while declaring the atrributes
[sdc.git] / integration-tests / src / test / java / org / onap / sdc / frontend / ci / tests / pages / VspValidationResultsPage.java
1 /**
2  * Copyright (c) 2019 Vodafone Group
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package org.onap.sdc.frontend.ci.tests.pages;
18
19 import com.aventstack.extentreports.Status;
20 import org.onap.sdc.frontend.ci.tests.datatypes.DataTestIdEnum;
21 import org.onap.sdc.frontend.ci.tests.execute.setup.SetupCDTest;
22 import org.onap.sdc.frontend.ci.tests.utilities.GeneralUIUtils;
23 import org.openqa.selenium.WebElement;
24
25 import java.util.List;
26
27 public class VspValidationResultsPage extends GeneralPageElements {
28
29     private VspValidationResultsPage() {
30         super();
31     }
32
33     public static void navigateToVspValidationResultsPageUsingNavbar() throws Exception {
34         clickOnElementUsingTestId(DataTestIdEnum.VspValidationResultsPage.VSP_VALIDATION_RESULTS_PAGE_NAVBAR);
35     }
36
37     public static void navigateToVspValidationResultsPageUsingBreadcrumbs() throws Exception {
38         clickOnElementUsingTestId(DataTestIdEnum.VspValidationResultsPage.VSP_VALIDATION_RESULTS_PAGE_BREADCRUMBS);
39     }
40
41     public static boolean checkResultsExist() throws Exception {
42         List<WebElement> results = GeneralUIUtils.findElementsByXpath("//h4[contains(text(),'No Validation Checks Performed')]");
43         return results.size() == 0;
44     }
45
46     public static void clickOnElementUsingTestId(DataTestIdEnum.VspValidationResultsPage elementTestId) throws Exception {
47         SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s", elementTestId.name()));
48         GeneralUIUtils.getWebElementByTestID(elementTestId.getValue()).click();
49         GeneralUIUtils.ultimateWait();
50     }
51 }