summaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'vid-automation/src/main')
-rw-r--r--vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIServiceDesignAndCreationPut.java7
-rw-r--r--vid-automation/src/main/java/vid/automation/test/infra/Features.java1
-rw-r--r--vid-automation/src/main/java/vid/automation/test/sections/BrowseASDCPage.java2
-rw-r--r--vid-automation/src/main/java/vid/automation/test/sections/VidBasePage.java16
-rw-r--r--vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java38
5 files changed, 58 insertions, 6 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIServiceDesignAndCreationPut.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIServiceDesignAndCreationPut.java
index 180685282..5ffd24253 100644
--- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIServiceDesignAndCreationPut.java
+++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetAAIServiceDesignAndCreationPut.java
@@ -208,6 +208,7 @@ public class PresetAAIServiceDesignAndCreationPut extends BaseAAIPreset {
" {" +
" \"model-version-id\": \"0903e1c0-8e03-4936-b5c2-260653b96413\"," +
" \"model-name\": \"action-data\"," +
+ " \"orchestration-type\": \"a la carte\"," +
" \"model-version\": \"1.0\"," +
" \"model-description\": \"honor immunity exile prong below misshapen\"," +
" \"resource-version\": \"4076846985447\"" +
@@ -226,6 +227,7 @@ public class PresetAAIServiceDesignAndCreationPut extends BaseAAIPreset {
" {" +
" \"model-version-id\": \"666a06ee-4b57-46df-bacf-908da8f10c3f\"," +
" \"model-name\": \"multicast-configuration\"," +
+ " \"orchestration-type\": \"a la carte\"," +
" \"model-version\": \"1.0\"," +
" \"model-description\": \"python bullwhip appointment computation ambidextrous heaving\"," +
" \"resource-version\": \"1500136282691\"" +
@@ -244,6 +246,7 @@ public class PresetAAIServiceDesignAndCreationPut extends BaseAAIPreset {
" {" +
" \"model-version-id\": \"20c4431c-246d-11e7-93ae-92361f002671\"," +
" \"model-name\": \"vSAMP10aDEV::base::module-0\"," +
+ " \"orchestration-type\": \"a la carte\"," +
" \"model-version\": \"2\"," +
" \"model-description\": \"MSO aLaCarte VF vSAMP10aDEV Base\"," +
" \"resource-version\": \"1492627634300\"" +
@@ -262,6 +265,7 @@ public class PresetAAIServiceDesignAndCreationPut extends BaseAAIPreset {
" {" +
" \"model-version-id\": \"797a6c41-0f80-4d35-a288-3920c4e06baa\"," +
" \"model-name\": \"CONTRAIL30_L2NODHCP\"," +
+ " \"orchestration-type\": \"macro\"," +
" \"model-version\": \"1.0\"," +
" \"model-description\": \"contrail 3.0.x L2 network for AIC 3.x sites (and No DHCP).\"," +
" \"resource-version\": \"1492814035003\"," +
@@ -307,6 +311,7 @@ public class PresetAAIServiceDesignAndCreationPut extends BaseAAIPreset {
" {" +
" \"model-version-id\": \"f1bde010-cc5f-4765-941f-75f15b24f9fc\"," +
" \"model-name\": \"BkVmxAv061917..base_vPE_AV..module-0\"," +
+ " \"orchestration-type\": \"macro\"," +
" \"model-version\": \"2\"," +
" \"resource-version\": \"1497897268769\"," +
" \"relationship-list\": {" +
@@ -351,6 +356,7 @@ public class PresetAAIServiceDesignAndCreationPut extends BaseAAIPreset {
" {" +
" \"model-version-id\": \"ipe-resource-id-ps-02\"," +
" \"model-name\": \"abc\"," +
+ " \"orchestration-type\": \"macro\"," +
" \"model-version\": \"v1.0\"," +
" \"resource-version\": \"1493389520357\"," +
" \"relationship-list\": {" +
@@ -395,6 +401,7 @@ public class PresetAAIServiceDesignAndCreationPut extends BaseAAIPreset {
" {" +
" \"model-version-id\": \"lmoser410-connector-model-version-id\"," +
" \"model-name\": \"connector\"," +
+ " \"orchestration-type\": \"macro\"," +
" \"model-version\": \"v1.0\"," +
" \"resource-version\": \"1493389444766\"" +
" }" +
diff --git a/vid-automation/src/main/java/vid/automation/test/infra/Features.java b/vid-automation/src/main/java/vid/automation/test/infra/Features.java
index 6a15d8961..312c3fd99 100644
--- a/vid-automation/src/main/java/vid/automation/test/infra/Features.java
+++ b/vid-automation/src/main/java/vid/automation/test/infra/Features.java
@@ -50,6 +50,7 @@ public enum Features implements Feature {
FLAG_PNP_INSTANTIATION,
FLAG_HANDLE_SO_WORKFLOWS,
FLAG_CREATE_ERROR_REPORTS,
+ FLAG_SHOW_ORCHESTRATION_TYPE,
FLAG_FLASH_MORE_ACTIONS_BUTTON_IN_OLD_VIEW_EDIT,
FLAG_FLASH_REDUCED_RESPONSE_CHANGEMG,
FLAG_FLASH_CLOUD_REGION_AND_NF_ROLE_OPTIONAL_SEARCH,
diff --git a/vid-automation/src/main/java/vid/automation/test/sections/BrowseASDCPage.java b/vid-automation/src/main/java/vid/automation/test/sections/BrowseASDCPage.java
index febbe6e83..de69e0047 100644
--- a/vid-automation/src/main/java/vid/automation/test/sections/BrowseASDCPage.java
+++ b/vid-automation/src/main/java/vid/automation/test/sections/BrowseASDCPage.java
@@ -37,7 +37,7 @@ public class BrowseASDCPage extends VidBasePage {
}
public int countCurrentRowsInTable(){
- List<WebElement> rowsInTable = Get.byClass("alt-row");
+ List<WebElement> rowsInTable = Get.byClass("sdcServiceModel");
return rowsInTable.size();
}
diff --git a/vid-automation/src/main/java/vid/automation/test/sections/VidBasePage.java b/vid-automation/src/main/java/vid/automation/test/sections/VidBasePage.java
index 7290204d6..43dd68f06 100644
--- a/vid-automation/src/main/java/vid/automation/test/sections/VidBasePage.java
+++ b/vid-automation/src/main/java/vid/automation/test/sections/VidBasePage.java
@@ -4,10 +4,7 @@ import com.aventstack.extentreports.Status;
import org.junit.Assert;
import org.onap.sdc.ci.tests.execute.setup.ExtentTestActions;
import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
-import org.openqa.selenium.By;
-import org.openqa.selenium.JavascriptExecutor;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
+import org.openqa.selenium.*;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import vid.automation.test.Constants;
@@ -113,6 +110,17 @@ public class VidBasePage {
return this;
}
+ public boolean isModelWithGivenServiceUUIDVisible(String serviceUUID) {
+ String elementTestId = Constants.DEPLOY_BUTTON_TESTS_ID_PREFIX + serviceUUID;
+ try {
+ GeneralUIUtils.getWebElementByTestID(elementTestId, 10);
+ GeneralUIUtils.ultimateWait();
+ } catch (TimeoutException te) {
+ return false;
+ }
+ return true;
+ }
+
public void screenshotDeployDialog(String serviceUUID) {
try {
GeneralUIUtils.ultimateWait();
diff --git a/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java b/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java
index f082044fd..eb08c1f2a 100644
--- a/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java
+++ b/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java
@@ -31,8 +31,9 @@ import java.util.List;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
-import static vid.automation.test.infra.Features.FLAG_1908_TRANSPORT_SERVICE_NEW_INSTANTIATION_UI;
import static vid.automation.test.infra.Features.FLAG_5G_IN_NEW_INSTANTIATION_UI;
+import static vid.automation.test.infra.Features.FLAG_SHOW_ORCHESTRATION_TYPE;
+import static vid.automation.test.infra.Features.FLAG_1908_TRANSPORT_SERVICE_NEW_INSTANTIATION_UI;
import static vid.automation.test.infra.ModelInfo.*;
@@ -479,4 +480,39 @@ public class BrowseASDCTest extends CreateInstanceDialogBaseTest {
assertFalse(Exists.tagNameInAnotherElement(serviceModelsTbody, "tr"), "Table should be empty on empty results");
resetGetServicesCache();
}
+
+ private static final String[] macroModelsIds = {
+ "f1bde010-cc5f-4765-941f-75f15b24f9fc",
+ "lmoser410-connector-model-version-id",
+ "ipe-resource-id-ps-02",
+ "797a6c41-0f80-4d35-a288-3920c4e06baa",
+ };
+ private static final String[] alacarteModelsIds = {
+ "0903e1c0-8e03-4936-b5c2-260653b96413",
+ "666a06ee-4b57-46df-bacf-908da8f10c3f",
+ "20c4431c-246d-11e7-93ae-92361f002671",
+ };
+
+ @DataProvider
+ public static Object[][] filterOrchestrationType() {
+ return new Object[][]{{"a la carte", 3, alacarteModelsIds},{"macro", 4, macroModelsIds}};
+ }
+
+ @Test(dataProvider = "filterOrchestrationType")
+ @FeatureTogglingTest(FLAG_SHOW_ORCHESTRATION_TYPE)
+ public void browseSdcModel_filterModelsWithOrchestrationType_alacarte(
+ String orchestrationType,int numberOfOccurrence, String[] expectedModelsIds) {
+ resetGetServicesCache();
+ SimulatorApi.clearAll();
+ BrowseASDCPage browseAsdcPage = registerSimulatorAndGoToBrowseSDC();
+ GeneralUIUtils.ultimateWait();
+ assertThat(browseAsdcPage.countCurrentRowsInTable(),(Matchers.greaterThan(numberOfOccurrence)));
+ browseAsdcPage.fillFilterText(orchestrationType);
+ Assert.assertEquals(browseAsdcPage.countCurrentRowsInTable(),numberOfOccurrence);
+ for(String id : expectedModelsIds) {
+ Assert.assertTrue(browseAsdcPage.isModelWithGivenServiceUUIDVisible(id));
+ }
+ browseAsdcPage.fillFilterText("");
+ }
+
}