diff options
Diffstat (limited to 'vid-automation/src')
7 files changed, 70 insertions, 7 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(""); + } + } diff --git a/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java index 69267fd4d..6709771a5 100644 --- a/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java +++ b/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java @@ -99,6 +99,7 @@ public class AaiApiTest extends BaseApiAaiTest { " \"lastUpdaterUserId\": null,\n" + " \"lastUpdaterFullName\": null,\n" + " \"distributionStatus\": \"DISTRIBUTION_COMPLETE_OK\",\n" + + " \"orchestrationType\": null,\n" + " \"artifacts\": null,\n" + " \"resources\": null\n" + " }, {\n" + @@ -112,6 +113,7 @@ public class AaiApiTest extends BaseApiAaiTest { " \"lastUpdaterUserId\": null,\n" + " \"lastUpdaterFullName\": null,\n" + " \"distributionStatus\": \"DISTRIBUTION_COMPLETE_ERROR\",\n" + + " \"orchestrationType\": null,\n" + " \"artifacts\": null,\n" + " \"resources\": null\n" + " }, {\n" + @@ -124,6 +126,7 @@ public class AaiApiTest extends BaseApiAaiTest { " \"lifecycleState\": null,\n" + " \"lastUpdaterUserId\": null,\n" + " \"lastUpdaterFullName\": null,\n" + + " \"orchestrationType\": null,\n" + " \"distributionStatus\": \"DISTRIBUTION_COMPLETE_OK\",\n" + " \"artifacts\": null,\n" + " \"resources\": null\n" + @@ -138,6 +141,7 @@ public class AaiApiTest extends BaseApiAaiTest { " \"lastUpdaterUserId\": null,\n" + " \"lastUpdaterFullName\": null,\n" + " \"distributionStatus\": \"DISTRIBUTION_COMPLETE_OK\",\n" + + " \"orchestrationType\": null,\n" + " \"artifacts\": null,\n" + " \"resources\": null\n" + " }, {\n" + @@ -151,6 +155,7 @@ public class AaiApiTest extends BaseApiAaiTest { " \"lastUpdaterUserId\": null,\n" + " \"lastUpdaterFullName\": null,\n" + " \"distributionStatus\": \"DISTRIBUTION_COMPLETE_OK\",\n" + + " \"orchestrationType\": null,\n" + " \"artifacts\": null,\n" + " \"resources\": null\n" + " }, {\n" + @@ -163,6 +168,7 @@ public class AaiApiTest extends BaseApiAaiTest { " \"lifecycleState\": null,\n" + " \"lastUpdaterUserId\": null,\n" + " \"lastUpdaterFullName\": null,\n" + + " \"orchestrationType\": null,\n" + " \"distributionStatus\": \"DISTRIBUTION_COMPLETE_OK\",\n" + " \"artifacts\": null,\n" + " \"resources\": null\n" + @@ -176,6 +182,7 @@ public class AaiApiTest extends BaseApiAaiTest { " \"lifecycleState\": null,\n" + " \"lastUpdaterUserId\": null,\n" + " \"lastUpdaterFullName\": null,\n" + + " \"orchestrationType\": null,\n" + " \"distributionStatus\": \"DISTRIBUTION_COMPLETE_OK\",\n" + " \"artifacts\": null,\n" + " \"resources\": null\n" + @@ -189,6 +196,7 @@ public class AaiApiTest extends BaseApiAaiTest { " \"lifecycleState\": null,\n" + " \"lastUpdaterUserId\": null,\n" + " \"lastUpdaterFullName\": null,\n" + + " \"orchestrationType\": null,\n" + " \"distributionStatus\": \"DISTRIBUTION_COMPLETE_OK\",\n" + " \"artifacts\": null,\n" + " \"resources\": null\n" + @@ -202,6 +210,7 @@ public class AaiApiTest extends BaseApiAaiTest { " \"lifecycleState\": null,\n" + " \"lastUpdaterUserId\": null,\n" + " \"lastUpdaterFullName\": null,\n" + + " \"orchestrationType\": null,\n" + " \"distributionStatus\": \"DISTRIBUTION_COMPLETE_OK\",\n" + " \"artifacts\": null,\n" + " \"resources\": null\n" + @@ -215,6 +224,7 @@ public class AaiApiTest extends BaseApiAaiTest { " \"lifecycleState\": null,\n" + " \"lastUpdaterUserId\": null,\n" + " \"lastUpdaterFullName\": null,\n" + + " \"orchestrationType\": null,\n" + " \"distributionStatus\": \"DISTRIBUTION_COMPLETE_OK\",\n" + " \"artifacts\": null,\n" + " \"resources\": null\n" + @@ -228,6 +238,7 @@ public class AaiApiTest extends BaseApiAaiTest { " \"lifecycleState\": null,\n" + " \"lastUpdaterUserId\": null,\n" + " \"lastUpdaterFullName\": null,\n" + + " \"orchestrationType\": null,\n" + " \"distributionStatus\": \"DISTRIBUTION_COMPLETE_OK\",\n" + " \"artifacts\": null,\n" + " \"resources\": null\n" + diff --git a/vid-automation/src/test/resources/features.properties b/vid-automation/src/test/resources/features.properties index 796c8be8d..63b9fc61b 100644 --- a/vid-automation/src/test/resources/features.properties +++ b/vid-automation/src/test/resources/features.properties @@ -35,4 +35,4 @@ FLAG_1908_MACRO_NOT_TRANSPORT_NEW_VIEW_EDIT = true FLAG_FLASH_CLOUD_REGION_AND_NF_ROLE_OPTIONAL_SEARCH = false FLAG_FLASH_REDUCED_RESPONSE_CHANGEMG = true FLAG_1911_INSTANTIATION_ORDER_IN_ASYNC_ALACARTE = false - +FLAG_SHOW_ORCHESTRATION_TYPE = false |