diff options
Diffstat (limited to 'vid-automation/src')
5 files changed, 146 insertions, 65 deletions
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 2cc790f02..059500cd5 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 @@ -41,7 +41,8 @@ public enum Features implements Feature { FLAG_1908_RESUME_MACRO_SERVICE, FLAG_1908_RELEASE_TENANT_ISOLATION, FLAG_1908_VNF_FC_NEW_INSTANTIATION_UI, - FLAG_HANDLE_SO_WORKFLOWS + FLAG_HANDLE_SO_WORKFLOWS, + FLAG_1908_MACRO_NOT_TRANSPORT_NEW_VIEW_EDIT, ; public boolean isActive() { diff --git a/vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java b/vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java index 7e9dac406..d7903ceef 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/NewServiceInstanceTest.java @@ -1,19 +1,75 @@ package vid.automation.test.test; //import com.automation.common.report_portal_integration.annotations.Step; + +import static junit.framework.TestCase.assertNull; +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; +import static org.hamcrest.CoreMatchers.startsWith; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsInAnyOrder; +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.PRESET_SOME_LEGACY_REGION_TO_ATT_AIC; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet.COMPLETE; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet.DEFAULT_SERVICE_INSTANCE_ID; +import static org.testng.Assert.assertEquals; +import static org.testng.AssertJUnit.assertTrue; +import static vid.automation.test.infra.Features.FLAG_1902_VNF_GROUPING; +import static vid.automation.test.infra.Features.FLAG_1908_COLLECTION_RESOURCE_NEW_INSTANTIATION_UI; +import static vid.automation.test.infra.Features.FLAG_1908_INFRASTRUCTURE_VPN; +import static vid.automation.test.infra.Features.FLAG_1908_MACRO_NOT_TRANSPORT_NEW_VIEW_EDIT; +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_ENABLE_WEBPACK_MODERN_UI; +import static vid.automation.test.infra.ModelInfo.aLaCarteNetworkProvider5G; +import static vid.automation.test.infra.ModelInfo.aLaCarteVnfGroupingService; +import static vid.automation.test.infra.ModelInfo.collectionResourceService; +import static vid.automation.test.infra.ModelInfo.infrastructureVpnService; +import static vid.automation.test.infra.ModelInfo.macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetails; +import static vid.automation.test.infra.ModelInfo.macroSriovNoDynamicFieldsEcompNamingFalseFullModelDetailsVnfEcompNamingFalse; +import static vid.automation.test.infra.ModelInfo.macroSriovWithDynamicFieldsEcompNamingFalsePartialModelDetailsVnfEcompNamingFalse; +import static vid.automation.test.infra.ModelInfo.macroSriovWithDynamicFieldsEcompNamingTruePartialModelDetails; +import static vid.automation.test.infra.ModelInfo.pasqualeVmxVpeBvService488Annotations; +import static vid.automation.test.infra.ModelInfo.transportWithPnfsService; +import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; +import static vid.automation.test.services.SimulatorApi.registerExpectationFromPreset; +import static vid.automation.test.services.SimulatorApi.registerExpectationFromPresets; +import static vid.automation.test.test.ALaCarteflowTest.AIC; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.UUID; +import java.util.stream.Collectors; import org.apache.commons.lang3.mutable.MutableInt; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.hamcrest.Matchers; -import org.onap.simulator.presetGenerator.presets.aai.*; -import org.onap.simulator.presetGenerator.presets.mso.*; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork.ResponseDetails; -import org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys; import org.onap.sdc.ci.tests.datatypes.UserCredentials; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetL3NetworksByCloudRegionSpecificState; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetTenants; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetVpnsByType; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIPostNamedQueryForViewEdit; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOBaseCreateInstancePost; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateNetworkALaCarte5G; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceAlacarte5GServiceWithNetwork; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceGen2WithNamesEcompNamingFalse; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestsGet5GServiceInstanceAndNetwork.ResponseDetails; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys; +import org.onap.simulator.presetGenerator.presets.mso.PresetMsoCreateMacroCommonPre1806; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.RemoteWebElement; @@ -24,38 +80,27 @@ import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import vid.automation.test.Constants; import vid.automation.test.Constants.BrowseASDC.NewServicePopup; -import vid.automation.test.infra.*; +import vid.automation.test.infra.Click; +import vid.automation.test.infra.FeatureTogglingTest; +import vid.automation.test.infra.Features; +import vid.automation.test.infra.Get; +import vid.automation.test.infra.Input; +import vid.automation.test.infra.ModelInfo; +import vid.automation.test.infra.SelectOption; +import vid.automation.test.infra.Wait; import vid.automation.test.model.Service; import vid.automation.test.model.User; -import vid.automation.test.sections.*; +import vid.automation.test.sections.BrowseASDCPage; +import vid.automation.test.sections.DrawingBoardPage; +import vid.automation.test.sections.InstantiationStatusPage; +import vid.automation.test.sections.SideMenu; +import vid.automation.test.sections.VidBasePage; import vid.automation.test.services.AsyncJobsService; import vid.automation.test.services.ServicesService; import vid.automation.test.services.SimulatorApi; import vid.automation.test.test.NewServiceInstanceTest.ServiceData.IS_GENERATED_NAMING; import vid.automation.test.utils.ReadFile; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.stream.Collectors; - -import static junit.framework.TestCase.assertNull; -import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; -import static org.hamcrest.CoreMatchers.startsWith; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsInAnyOrder; -import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId.PRESET_SOME_LEGACY_REGION_TO_ATT_AIC; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet.COMPLETE; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet.DEFAULT_SERVICE_INSTANCE_ID; -import static org.testng.Assert.assertEquals; -import static org.testng.AssertJUnit.assertTrue; -import static vid.automation.test.infra.Features.*; -import static vid.automation.test.infra.ModelInfo.*; -import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; -import static vid.automation.test.services.SimulatorApi.registerExpectationFromPreset; -import static vid.automation.test.services.SimulatorApi.registerExpectationFromPresets; -import static vid.automation.test.test.ALaCarteflowTest.AIC; - @FeatureTogglingTest(FLAG_ENABLE_WEBPACK_MODERN_UI) public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { @@ -663,10 +708,9 @@ public class NewServiceInstanceTest extends CreateInstanceDialogBaseTest { //@Step("verify open view edit") private void verifyOpenViewEdit(String serviceInstanceName) { boolean[] openEnabled = {true, false, false}; - String[] statuses = {COMPLETED, IN_PROGRESS, PENDING}; ImmutableList.of(0, 1, 2).forEach(i -> { String actualInstanceName = getActualInstanceName(serviceInstanceName, i); - if (Features.FLAG_1902_NEW_VIEW_EDIT.isActive()) { + if (Features.FLAG_1902_NEW_VIEW_EDIT.isActive() || FLAG_1908_MACRO_NOT_TRANSPORT_NEW_VIEW_EDIT.isActive()) { InstantiationStatusPage.verifyOpenNewViewEdit(actualInstanceName, openEnabled[i], "EDIT"); } else { diff --git a/vid-automation/src/main/java/vid/automation/test/test/ViewEditWithDrawingBoardTest.java b/vid-automation/src/main/java/vid/automation/test/test/ViewEditWithDrawingBoardTest.java index 76cc7a44b..40af6f8a1 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/ViewEditWithDrawingBoardTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/ViewEditWithDrawingBoardTest.java @@ -1,15 +1,40 @@ package vid.automation.test.test; +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIStandardQueryGet.defaultPlacement; +import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME; +import static vid.automation.test.Constants.DrawingBoard.CONTEXT_MENU_BUTTON_HEADER; +import static vid.automation.test.Constants.DrawingBoard.CONTEXT_MENU_HEADER_RESUME_ITEM; +import static vid.automation.test.infra.ModelInfo.aLaCarteVnfGroupingService; +import static vid.automation.test.infra.ModelInfo.collectionResourceForResume; +import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET; +import static vid.automation.test.services.SimulatorApi.registerExpectationFromPresets; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMultimap; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; +import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset; -import org.onap.simulator.presetGenerator.presets.aai.*; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIFilterServiceInstanceById; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetServicesGet; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubDetailsGetSpecificService; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubDetailsWithoutInstancesGetSpecificService; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIModelsByInvariantIdGet; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIModelsByInvariantIdGetForServiceWithCR; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIStandardQueryGet; import org.onap.simulator.presetGenerator.presets.ecompportal_att.PresetGetSessionSlotCheckIntervalGet; -import org.onap.simulator.presetGenerator.presets.mso.*; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOAddOrRemoveOneInstanceGroupMember; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOCreateServiceInstanceGen2WithNamesAlacarteGroupingService; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSODeleteInstanceGroup; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestGet; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOOrchestrationRequestsGetByServiceInstanceId; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOResumeRequest; +import org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames; import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceMetadataGet; import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceToscaModelGet; -import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; import org.testng.annotations.Test; import vid.automation.test.Constants; import vid.automation.test.infra.Click; @@ -19,23 +44,9 @@ import vid.automation.test.infra.ModelInfo; import vid.automation.test.sections.DrawingBoardPage; import vid.automation.test.services.SimulatorApi; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIStandardQueryGet.defaultPlacement; -import static org.onap.simulator.presetGenerator.presets.mso.PresetMSOServiceInstanceGen2WithNames.Keys.SERVICE_NAME; -import static vid.automation.test.Constants.DrawingBoard.CONTEXT_MENU_BUTTON_HEADER; -import static vid.automation.test.Constants.DrawingBoard.CONTEXT_MENU_HEADER_RESUME_ITEM; -import static vid.automation.test.infra.ModelInfo.aLaCarteVnfGroupingService; -import static vid.automation.test.infra.ModelInfo.collectionResourceForResume; -import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET; -import static vid.automation.test.services.SimulatorApi.registerExpectationFromPresets; - public class ViewEditWithDrawingBoardTest extends VidBaseTestCase { private static final String MSO_COMPLETE_STATUS = "COMPLETE"; - private static final String COMPLETED = "COMPLETED"; private String vnfGroupInstanceId; private String serviceInstanceToDeleteName; private String vnf1Name; @@ -77,7 +88,7 @@ public class ViewEditWithDrawingBoardTest extends VidBaseTestCase { GeneralUIUtils.ultimateWait(); DrawingBoardPage drawingBoardPage = new DrawingBoardPage(); - drawingBoardPage.goToIframe(); + DrawingBoardPage.goToIframe(); GeneralUIUtils.ultimateWait(); action.run(); GeneralUIUtils.ultimateWait(); @@ -173,7 +184,7 @@ public class ViewEditWithDrawingBoardTest extends VidBaseTestCase { ); } - @FeatureTogglingTest({Features.FLAG_1908_COLLECTION_RESOURCE_NEW_INSTANTIATION_UI, Features.FLAG_1908_RESUME_MACRO_SERVICE}) + @FeatureTogglingTest({Features.FLAG_1908_MACRO_NOT_TRANSPORT_NEW_VIEW_EDIT, Features.FLAG_1908_RESUME_MACRO_SERVICE}) @Test public void testResumeServiceInstanceWithCollectionResource() { diff --git a/vid-automation/src/test/java/org/onap/vid/api/SdcApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/SdcApiTest.java index 8201bcfa0..04dbbc0c5 100644 --- a/vid-automation/src/test/java/org/onap/vid/api/SdcApiTest.java +++ b/vid-automation/src/test/java/org/onap/vid/api/SdcApiTest.java @@ -1,5 +1,38 @@ +/*- + * ============LICENSE_START======================================================= + * VID + * ================================================================================ + * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + package org.onap.vid.api; +import static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals; +import static net.javacrumbs.jsonunit.JsonMatchers.jsonStringEquals; +import static net.javacrumbs.jsonunit.core.Option.IGNORING_ARRAY_ORDER; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsNot.not; +import static org.testng.Assert.assertFalse; +import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; +import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET; +import static vid.automation.test.services.SimulatorApi.registerExpectation; +import static vid.automation.test.services.SimulatorApi.registerExpectationFromPresets; +import static vid.automation.test.utils.ReadFile.loadResourceAsString; + import com.fasterxml.jackson.databind.JsonNode; import com.google.common.collect.ImmutableList; import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset; @@ -14,19 +47,6 @@ import org.testng.annotations.Test; import vid.automation.test.infra.FeatureTogglingTest; import vid.automation.test.infra.Features; -import static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals; -import static net.javacrumbs.jsonunit.JsonMatchers.jsonStringEquals; -import static net.javacrumbs.jsonunit.core.Option.IGNORING_ARRAY_ORDER; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.core.Is.is; -import static org.hamcrest.core.IsNot.not; -import static org.testng.Assert.assertFalse; -import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; -import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET; -import static vid.automation.test.services.SimulatorApi.registerExpectation; -import static vid.automation.test.services.SimulatorApi.registerExpectationFromPresets; -import static vid.automation.test.utils.ReadFile.loadResourceAsString; - public class SdcApiTest extends BaseApiTest { private static final String SDC_GET_SERVICE_MODEL = "/rest/models/services/"; @@ -93,7 +113,9 @@ public class SdcApiTest extends BaseApiTest { ResponseEntity<String> response = restTemplate.getForEntity(buildUri(SDC_GET_SERVICE_MODEL + MACRO_INSTANTIATION_TYPE_UUID), String.class); Assert.assertEquals(response.getStatusCode(), HttpStatus.OK); String macroInstantiationTypeExpectedResponse = loadResourceAsString(MACRO_INSTANTIATION_TYPE_EXPECTED_RESPONSE); - assertThat("The response is in the format of JSON", response.getBody(), is(jsonStringEquals(turnOffInstantiationUI(macroInstantiationTypeExpectedResponse)))); + assertThat(response.getBody(), jsonEquals(macroInstantiationTypeExpectedResponse) + .when(IGNORING_ARRAY_ORDER) + .whenIgnoringPaths("service.vidNotions.viewEditUI")); } @@ -112,7 +134,9 @@ public class SdcApiTest extends BaseApiTest { ResponseEntity<String> response = restTemplate.getForEntity(buildUri(SDC_GET_SERVICE_MODEL + MACRO_INSTANTIATION_TYPE_UUID), String.class); Assert.assertEquals(response.getStatusCode(), HttpStatus.OK); String macroInstantiationTypeExpectedResponse = loadResourceAsString(MACRO_INSTANTIATION_TYPE_EXPECTED_RESPONSE); - assertThat("The response is in the format of JSON", response.getBody(), is(jsonStringEquals(turnOffInstantiationUI(macroInstantiationTypeExpectedResponse)))); + assertThat(response.getBody(), jsonEquals(macroInstantiationTypeExpectedResponse) + .when(IGNORING_ARRAY_ORDER) + .whenIgnoringPaths("service.vidNotions.viewEditUI")); } @Test diff --git a/vid-automation/src/test/resources/features.properties b/vid-automation/src/test/resources/features.properties index 7ab0785b1..7c5f0e470 100644 --- a/vid-automation/src/test/resources/features.properties +++ b/vid-automation/src/test/resources/features.properties @@ -31,3 +31,4 @@ FLAG_1906_COMPONENT_INFO = false FLAG_1906_INSTANTIATION_API_USER_VALIDATION = true FLAG_1908_RESUME_MACRO_SERVICE=true FLAG_1908_RELEASE_TENANT_ISOLATION=true +FLAG_1908_MACRO_NOT_TRANSPORT_NEW_VIEW_EDIT=true |