diff options
Diffstat (limited to 'vid-automation/src/main')
5 files changed, 104 insertions, 17 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/scheduler/PresetDeleteSchedulerChangeManagement.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/scheduler/PresetDeleteSchedulerChangeManagement.java new file mode 100644 index 000000000..0005cbd75 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/scheduler/PresetDeleteSchedulerChangeManagement.java @@ -0,0 +1,26 @@ +package org.onap.simulator.presetGenerator.presets.scheduler; + +import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset; +import org.springframework.http.HttpMethod; + +public class PresetDeleteSchedulerChangeManagement extends BasePreset { + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.DELETE; + } + + @Override + public String getReqPath() { + return getRootPath() + "/83aec7bf-602f-49eb-9788-bbc33ac550d9"; + } + + @Override + protected String getRootPath() { + return "/scheduler/v1/ChangeManagement/schedules"; + } + + @Override + public int getResponseCode() { return 204; } + +} diff --git a/vid-automation/src/main/java/vid/automation/test/Constants.java b/vid-automation/src/main/java/vid/automation/test/Constants.java index 6605fe2e6..0e614dece 100644 --- a/vid-automation/src/main/java/vid/automation/test/Constants.java +++ b/vid-automation/src/main/java/vid/automation/test/Constants.java @@ -97,7 +97,7 @@ public class Constants { public static final String newModalFromVNFVersionInputId = "fromVNFVersion"; public static final String newModalVNFNameInputId = "vnfName"; public static final String newModalWorkFlowInputId = "workflow"; - public static final String newModalConfigUpdateInputId = "config-update-input"; + public static final String newModalConfigUpdateInputId = "internal-workflow-parameter-file-5-attach-configuration-file"; public static final String newModalTargetVersionInputsClass = "vnf-versions-select-as-text"; public static final String newModalSubscriberText = "CRAIG/ROBERTS"; public static final String newModalServiceTypeText = "vRichardson"; 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 005c06551..40f3013dd 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 @@ -40,6 +40,7 @@ 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 ; public boolean isActive() { diff --git a/vid-automation/src/main/java/vid/automation/test/test/ChangeManagementTest.java b/vid-automation/src/main/java/vid/automation/test/test/ChangeManagementTest.java index 2f5489f31..dbc603c26 100644 --- a/vid-automation/src/main/java/vid/automation/test/test/ChangeManagementTest.java +++ b/vid-automation/src/main/java/vid/automation/test/test/ChangeManagementTest.java @@ -8,6 +8,7 @@ import org.junit.Assert; import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; import org.onap.sdc.ci.tests.datatypes.UserCredentials; import org.onap.sdc.ci.tests.utilities.GeneralUIUtils; +import org.onap.simulator.presetGenerator.presets.scheduler.PresetDeleteSchedulerChangeManagement; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebElement; import org.openqa.selenium.remote.RemoteWebElement; @@ -69,11 +70,13 @@ public class ChangeManagementTest extends VidBaseTestCase { private void openAndFill1stScreen(String vnfName, String vnfTargetVersion, String workflow) { String subscriberId = VNF_DATA_WITH_IN_PLACE.subscriberId; + String subscriberName = VNF_DATA_WITH_IN_PLACE.subscriberName; String serviceType = VNF_DATA_WITH_IN_PLACE.serviceType; String vnfType = VNF_DATA_WITH_IN_PLACE.vnfType; String vnfSourceVersion = VNF_DATA_WITH_IN_PLACE.vnfSourceVersion; ChangeManagementPage.openNewChangeManagementModal(); Wait.angularHttpRequestsLoaded(); + SelectOption.waitForOptionInSelect(subscriberName, "subscriberName"); ChangeManagementPage.selectSubscriberById(subscriberId); Wait.angularHttpRequestsLoaded(); SelectOption.byIdAndVisibleText(Constants.ChangeManagement.newModalServiceTypeInputId, serviceType); @@ -119,6 +122,7 @@ public class ChangeManagementTest extends VidBaseTestCase { static final int vnfZrdm3amdns02test2Id = 11822; static final int vnfHarrisonKrisId = 12822; static String subscriberId = "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"; + static String subscriberName = "Emanuel"; static String serviceType = "vRichardson"; static String vnfType = "vMobileDNS"; static String vnfSourceVersion = "1.0"; @@ -164,6 +168,7 @@ public class ChangeManagementTest extends VidBaseTestCase { , "changeManagement/service-design-and-creation.json" , "changeManagement/mso_get_manual_task.json" , "changeManagement/mso_post_manual_task.json" + , "changeManagement/mso_get_change_managements_scaleout.json" ); SimulatorApi.registerExpectationFromPreset(new PresetAAIGetSubscribersGet(),SimulatorApi.RegistrationStrategy.APPEND); @@ -253,8 +258,10 @@ public class ChangeManagementTest extends VidBaseTestCase { @Test public void clickOnScheduledJob_SuccessfulMessageAppear() { + + SimulatorApi.registerExpectationFromPreset(new PresetDeleteSchedulerChangeManagement(),SimulatorApi.RegistrationStrategy.APPEND); + ChangeManagementPage.openChangeManagementPage(); -// Wait.angularHttpRequestsLoaded(); GeneralUIUtils.ultimateWait(); clickAndAssertOnCancelButton(SCHEDULED_ID); updateSimulatorWithParametersOfScheduledJod("get_scheduler_details_short_with_after_cancel" + @@ -305,6 +312,7 @@ public class ChangeManagementTest extends VidBaseTestCase { boolean isNotDisplayed = GeneralUIUtils.waitForElementInVisibilityByTestId("icon-status-" + scheduledId, 5); Assert.assertTrue(isNotDisplayed); } + public void updateSimulatorWithParametersOfScheduledJod(String jasonFile){ SimulatorApi.registerExpectation( new String[] {"changeManagement/"+jasonFile}, @@ -312,12 +320,15 @@ public class ChangeManagementTest extends VidBaseTestCase { ); } + @FeatureTogglingTest(value = Features.FLAG_HANDLE_SO_WORKFLOWS, flagActive = false) @Test public void testWorkflowVNFInPlaceSoftwareUpdateNotInWorkflowsListWhenNotExpected() { + List<String> workflows = getListOfWorkflowsFor("Harrison Kris"); assertThat(workflows, not(hasItem(VNF_DATA_WITH_IN_PLACE.workflowName))); } + @FeatureTogglingTest(value = Features.FLAG_HANDLE_SO_WORKFLOWS, flagActive = false) @Test public void testWorkflowVNFInPlaceSoftwareUpdateInWorkflowsListWhenExpected() { List<String> workflows = getListOfWorkflowsFor(VNF_DATA_WITH_IN_PLACE.vnfName); @@ -344,13 +355,14 @@ public class ChangeManagementTest extends VidBaseTestCase { @Test public void testWorkflowVNFInPlaceSoftwareUpdateShows3Fields() { + openAndFill1stScreenWithWorkflowVNFInPlaceSoftwareUpdate(); List<String> idsWithoutMatchingElement = Stream.of( - "operations-timeout", - "existing-software-version", - "new-software-version") + "internal-workflow-parameter-text-2-operations-timeout", + "internal-workflow-parameter-text-3-existing-software-version", + "internal-workflow-parameter-text-4-new-software-version") .filter(id -> Get.byId(id) == null) .collect(Collectors.toList()); assertThat("all three special VNFInPlace fields should appear", idsWithoutMatchingElement, is(empty())); @@ -403,13 +415,13 @@ public class ChangeManagementTest extends VidBaseTestCase { } private void fillVNFInPlace3Fields(String operationsTimeout, String existingSwVersion, String newSwVersion) { - Get.byId("operations-timeout").clear(); - Get.byId("existing-software-version").clear(); - Get.byId("new-software-version").clear(); + Get.byId("internal-workflow-parameter-text-2-operations-timeout").clear(); + Get.byId("internal-workflow-parameter-text-3-existing-software-version").clear(); + Get.byId("internal-workflow-parameter-text-4-new-software-version").clear(); - Get.byId("operations-timeout").sendKeys(operationsTimeout); - Get.byId("existing-software-version").sendKeys(existingSwVersion); - Get.byId("new-software-version").sendKeys(newSwVersion); + Get.byId("internal-workflow-parameter-text-2-operations-timeout").sendKeys(operationsTimeout); + Get.byId("internal-workflow-parameter-text-3-existing-software-version").sendKeys(existingSwVersion); + Get.byId("internal-workflow-parameter-text-4-new-software-version").sendKeys(newSwVersion); } private List<String> getListOfWorkflowsFor(String vnfName) { @@ -533,13 +545,8 @@ public class ChangeManagementTest extends VidBaseTestCase { ChangeManagementPage.openChangeManagementPage(); Click.byId(Constants.ChangeManagement.dashboardFinishedTabId); Assert.assertThat(Get.byClassAndText("vnf-name","Unlocked instance"),is(notNullValue())); - } - - - - @Test public void testMainDashboardTableContent () { ChangeManagementPage.openChangeManagementPage(); @@ -549,7 +556,6 @@ public class ChangeManagementTest extends VidBaseTestCase { //TODO: After scheduler will be ready than we will examine if the content is valid. } - @Test public void testOnlyOneModalIsOpen() throws Exception { diff --git a/vid-automation/src/main/resources/registration_to_simulator/changeManagement/mso_get_change_managements_scaleout.json b/vid-automation/src/main/resources/registration_to_simulator/changeManagement/mso_get_change_managements_scaleout.json new file mode 100644 index 000000000..01d28a41c --- /dev/null +++ b/vid-automation/src/main/resources/registration_to_simulator/changeManagement/mso_get_change_managements_scaleout.json @@ -0,0 +1,54 @@ +{ + "simulatorRequest": { + "method": "GET", + "path": "/mso/orchestrationRequests/v.", + "queryParams": { + "filter": "action:EQUALS:scaleOut" + } + }, + "simulatorResponse": { + "responseCode": 200, + "body": { + "requestList": [ + { + "request": { + "requestId":"2a22aff4-620f-44b6-92a1-8a41be396d96\n\n", + "requestScope":"vfModule", + "requestStatus":{ + "percentProgress":100.0, + "requestState":"IN_PROGRESS", + "statusMessage":"Scale-Out Is In Progress", + "finishTime":"Fri, 08 Sep 2017 19:34:33 GMT" + }, + "requestType":"scaleOut", + "startTime":"Fri, 08 Sep 2017 19:34:32 GMT", + "instanceReferences":{ + "serviceInstanceId":"6dd0f8de-93c7-48a2-914b-1a8d58e0eb48", + "vnfInstanceId":"7c00cc1e-6425-4fc3-afc3-0289db288d4c", + "requestorId":"ds828e" + } + } + }, + { + "request": { + "requestId": "2d6502bf-c488-4903-817e-2ed2c644dcf4", + "requestScope": "vfModule", + "requestStatus": { + "percentProgress": 100.0, + "requestState": "COMPLETE", + "statusMessage": "Completed successfully", + "finishTime": "Thu, 09 Nov 2017 10:58:14 GMT" + }, + "requestType": "scaleOut", + "startTime": "Thu, 09 Nov 2017 10:58:14 GMT", + "instanceReferences": { + "serviceInstanceId": "54ba3628-9ee5-4b32-8a2a-3abf001bed4e", + "vnfInstanceId": "b8d99523-1e83-4fd1-b42f-849361ef7024", + "requestorId": "az2016" + } + } + } + ] + } + } +}
\ No newline at end of file |