-<div class="onboarding-modal">
+<div data-tests-id="importVspTable" class="onboarding-modal">
<div class="search-wrapper">
<span class="sub-title-wrapper">
<svg-icon class="info-button"
newMetadata.description = csar.description;
newMetadata.selectedCategory = selectedCategory && selectedSubCategory ? selectedCategory.name + "_#_" + selectedSubCategory.name : '';
newMetadata.filterTerm = newMetadata.name + ' ' + newMetadata.description + ' ' + newMetadata.vendorName + ' ' + newMetadata.csarVersion;
- newMetadata.resourceType = "VF";
+ newMetadata.resourceType = csar.resourceType;
newMetadata.componentType = ComponentType.RESOURCE;
newMetadata.tags = [];
newMetadata.icon = DEFAULT_ICON;
return newResource;
};
- public createEmptyComponent = (componentType:string):Component => {
+ public createEmptyComponent = (componentType:string, resourceType?:string):Component => {
let newComponent:Component;
switch (componentType) {
case ResourceType.CVFC:
case ResourceType.CONFIGURATION:
newComponent = new Resource(this.ResourceService, this.$q);
+ if (resourceType){
+ (<Resource> newComponent).resourceType = resourceType;
+ }
break;
}
newComponent.componentType = componentType;
*/
public enum XpathSelector {
MAIN_DIV("w-sdc-left-sidebar", "//div[@class='%s']"),
- PROPERTIES_ASSIGNMENT_MENU("Properties AssignmentLeftSideMenu", "//div[@data-tests-id='%s']/button");
+ PROPERTIES_ASSIGNMENT_MENU("Properties AssignmentLeftSideMenu", "//*[@data-tests-id='%s']");
private final String id;
private final String xpathFormat;
*/
public VspRepositoryModalComponent clickOnRepositoryIcon() {
wrappingElement.findElement(By.xpath(REPOSITORY_ICON.getXpath())).click();
+
return new VspRepositoryModalComponent(webDriver);
}
SUB_MENU_BUTTON_HOME("sub-menu-button-home", "//*[@data-tests-id='%s']"),
ARROW_DROPDOWN("triangle-dropdown", "//li[contains(@class, '%s')]"),
MAIN_MENU_ONBOARD_BTN("main-menu-button-onboard", "//a[@data-tests-id='%s']"),
- REPOSITORY_ICON("repository-icon", "//div[@data-tests-id='%s']");
+ REPOSITORY_ICON("repository-icon", "//*[@data-tests-id='%s']");
private final String id;
private final String xpathFormat;
package org.openecomp.sdc.ci.tests.pages;
+import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public void submit() {
final WebElement commitAndSubmitBtn = wrappingElement.findElement(By.xpath(COMMIT_AND_SUBMIT_BTN.getXpath()));
commitAndSubmitBtn.click();
+ GeneralUIUtils.ultimateWait();
confirmSuccess();
}
final List<WebElement> vspResultList =
findSubElements(wrappingElement, By.className(RESULTS_CONTAINER_DIV.getId()));
vspResultList.get(listPosition).click();
- findSubElement(wrappingElement, By.xpath(IMPORT_VSP_BTN.getXpath())).click();
+ GeneralUIUtils.clickOnElementByTestId(IMPORT_VSP_BTN.getId());
return new ResourceCreatePage(webDriver, new LoaderHelper(), new NotificationHelper());
}
* Enum that contains identifiers and xpath expressions to elements related to the enclosing page object.
*/
public enum XpathSelector {
- MODAL_DIV("modalOnboarding", "//div[@modal='%s']"),
- SEARCH_TXT("onboarding-search", "//input[@data-tests-id='%s']"),
- IMPORT_VSP_BTN("import-csar", "//span[@data-tests-id='%s']"),
- RESULTS_CONTAINER_DIV("flex-container", "//div[contains(@class,'%s']");
+ MODAL_DIV("importVspTable", "//*[@data-tests-id='%s']"),
+ SEARCH_TXT("onboarding-search-input", "//input[@data-tests-id='%s']"),
+ IMPORT_VSP_BTN("import-csar", "//*[@data-tests-id='%s']"),
+ RESULTS_CONTAINER_DIV("datatable-body-cell-label", "//datatable-body[contains(@class,'%s']");
private final String id;
private final String xpathFormat;
private static final Logger LOGGER = LoggerFactory.getLogger(GeneralUIUtils.class);
- private static final String TEST_ID_XPATH = "//*[@data-tests-id='%s']";
+ private static final String TEST_ID_XPATH = "//*[@data-test-id='%1$s' or @data-tests-id='%1$s']";
private static final String TEST_ID_CHILD_XPATH = "//*[@data-tests-id='%s']//*";
private static final String TEST_ID_ATTRIBUTE_NAME = "data-tests-id";
private static final String COLOR_YELLOW_BORDER_4PX_SOLID_YELLOW = "color: yellow; border: 4px solid yellow;";
DownloadManager.downloadCsarByNameFromVSPRepository(vspName, createVendorSoftwareProduct.getVspId());
File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir();
- ExtentTestActions.log(Status.INFO, String.format("Searching for onboarded %s", vnfFile));
- HomePage.showVspRepository();
ExtentTestActions.log(Status.INFO, String.format("Going to import %s", vnfFile.substring(0, vnfFile.indexOf("."))));
importVSP(createVendorSoftwareProduct);
artifactName = deploymentArtifact.getFileName().trim();
}
- if (heatEnvFilesFromCSAR.contains(artifactName + ".env")) {
- artifactVersion = "2";
- }
ArtifactUIUtils.validateArtifactNameVersionType(artifactName, artifactVersion, deploymentArtifact.getType());
}
}