2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2021 Nordix Foundation
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 * SPDX-License-Identifier: Apache-2.0
17 * ============LICENSE_END=========================================================
20 package org.onap.sdc.frontend.ci.tests.pages.component.workspace;
22 import lombok.AllArgsConstructor;
24 import org.onap.sdc.frontend.ci.tests.pages.AbstractPageObject;
25 import org.openqa.selenium.WebDriver;
28 * Represents the relationship wizard dialog that is used when creating a relationship between two nodes in the composition screen.
30 public class RelationshipWizardComponent extends AbstractPageObject {
32 public RelationshipWizardComponent(final WebDriver webDriver) {
37 public void isLoaded() {
38 waitForElementVisibility(XpathSelector.WIZARD.getXpath());
39 waitForElementVisibility(XpathSelector.CANCEL_BUTTON.getXpath());
40 waitForElementVisibility(XpathSelector.NEXT_BUTTON.getXpath());
43 public void clickOnNext() {
44 waitToBeClickable(XpathSelector.NEXT_BUTTON.getXpath()).click();
47 public void clickOnBack() {
48 waitToBeClickable(XpathSelector.BACK_BUTTON.getXpath()).click();
51 public void clickOnCancel() {
52 waitToBeClickable(XpathSelector.CANCEL_BUTTON.getXpath()).click();
55 public void clickOnFinish() {
56 waitToBeClickable(XpathSelector.FINISH_BUTTON.getXpath()).click();
59 public void clickOnAddOperation() {
60 waitToBeClickable(XpathSelector.ADD_OPERATION_BUTTON.getXpath()).click();
64 * Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
67 private enum XpathSelector {
68 WIZARD("//multi-steps-wizard"),
69 WIZARD_FOOTER("//multi-steps-wizard//div[@class='ng2-modal-footer']"),
70 CANCEL_BUTTON(WIZARD_FOOTER.getXpath() + "//button[text()='Cancel']"),
71 NEXT_BUTTON(WIZARD_FOOTER.getXpath() + "//div[contains(@class, 'white-arrow-next')]/.."),
72 BACK_BUTTON(WIZARD_FOOTER.getXpath() + "//div[contains(@class, 'blue-arrow-back')]/.."),
73 FINISH_BUTTON(WIZARD_FOOTER.getXpath() + "//button[contains(text(), 'Finish')]"),
74 ADD_OPERATION_BUTTON("//a[contains(@class,'add-param-link add-btn') and contains(text(), 'Add Operation')]");
77 private final String xpath;