2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.ci.tests.execute.AmdocsComplexService;
23 import com.aventstack.extentreports.Status;
24 import com.clearspring.analytics.util.Pair;
25 import org.openecomp.sdc.be.model.User;
26 import org.openecomp.sdc.ci.tests.datatypes.*;
27 import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
28 import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
29 import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
30 import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
31 import org.openecomp.sdc.ci.tests.pages.*;
32 import org.openecomp.sdc.ci.tests.utilities.FileHandling;
33 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
34 import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
35 import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
36 import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
37 import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
38 import org.testng.annotations.BeforeMethod;
39 import org.testng.annotations.Optional;
40 import org.testng.annotations.Parameters;
41 import org.testng.annotations.Test;
43 import java.util.ArrayList;
44 import java.util.List;
46 import static org.testng.AssertJUnit.assertEquals;
47 import static org.testng.AssertJUnit.assertNotSame;
51 ElementsChanges extends SetupCDTest {
53 protected static String filePath = FileHandling.getFilePath("ComplexService");
54 private static String fullCompositionFile = "fullComposition.zip";
55 private static String test = "test.zip";
56 private static String fullCompositionFile2 = "test.zip";
57 private static String HSSFile = "HSS.zip";
58 private static String VMMEFile = "VMME.zip";
59 private static String WithPort = "withPort.zip";
60 private static String withoutPort = "withoutPort.zip";
61 private static String makeDistributionValue;
63 @Parameters({"makeDistribution"})
65 public void beforeTestReadParams(@Optional("true") String makeDistributionReadValue) {
66 makeDistributionValue = makeDistributionReadValue;
69 //------------------------------------------Tests-----------------------------------------------------
71 // Test#1 Jira issue 6324
73 public void DeleteComponent() throws Exception {
74 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
75 String vspName = onboardAndCertify(resourceReqDetails, filePath, fullCompositionFile);
76 reloginWithNewRole(UserRoleEnum.DESIGNER);
77 ServiceReqDetails serviceMetadata = PathUtilities.createService(getUser());
78 List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 3);
79 String pathName = PathUtilities.createPathWithoutLink("DeleteComponent", vspName);
80 PathUtilities.deleteComponents(VFs);
81 PathValidations.validatePathListIsEmpty();
82 certifyServiceAsTester(serviceMetadata);
86 // Test#2 Jira issue 6325
88 public void DeleteServiceComponent() throws Exception {
89 ServiceReqDetails serviceMetadata = getToComplexService(filePath, fullCompositionFile);
90 reloginWithNewRole(UserRoleEnum.DESIGNER);
91 ServiceReqDetails complexService = PathUtilities.createService(getUser());
92 List<CanvasElement> services = createComplexPath(serviceMetadata.getName());
93 PathUtilities.deleteComponents(services);
94 PathValidations.validatePathListIsEmpty();
95 certifyServiceAsTester(complexService);
98 // Test#3 Jira issue 6364
100 public void ManualUpdateVF() throws Exception {
101 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
102 String vspName = onboardAndCertify(resourceReqDetails, filePath, fullCompositionFile);
103 reloginWithNewRole(UserRoleEnum.DESIGNER);
104 ServiceReqDetails serviceMetadata = PathUtilities.createService(getUser());
105 PathUtilities.createPath("ManualUpdateVF", vspName);
106 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.HOME_FROM_COMPOSITION.getValue());
107 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.MainMenuButtons.ONBOARD_BUTTON.getValue());
108 /// GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.ONBOARD_CATALOG.getValue());
109 ResourceUIUtils.clickOnElementByText(vspName,null);
110 ResourceUIUtils.clickOnElementByText("Create New Version", null);
111 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ComplexServiceAmdocs.NEW_VSP_VERSION_DESCRIPTION.getValue()).sendKeys("new vsap version for service path");
112 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.SUBMIT_NEW_VSP_VERSION_DESCRIPTION.getValue());
114 // VendorSoftwareProductObject v = new VendorSoftwareProductObject();
115 //VendorSoftwareProductRestUtils.uploadHeatPackage(filePath,fullCompositionFile,v,getUser());
116 //upload new heat +commit submit
118 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.MainMenuButtons.ONBOARD_BUTTON.getValue());
120 GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
121 ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
122 // CanvasManager.getCanvasManager().clickOnCanvaElement(vf);
124 //validate path still exist
125 certifyServiceAsTester(serviceMetadata);
129 public void UpdateComponent() throws Exception {
130 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
131 String vspName = onboardAndCertify(resourceReqDetails, filePath, VMMEFile);
136 public void UpdateComponentWithouForwarder() throws Exception {
137 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
138 String vsp_v2_description = "change description for version 2";
139 VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, WithPort, vsp_v2_description, withoutPort, getUser());
142 ServiceReqDetails service = PathUtilities.createService(getUser());
145 String vspName = vendorSoftwareProductObject.getName();
146 String pathName = "path1";
147 List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
148 CanvasManager canvasManager = CanvasManager.getCanvasManager();
149 for (CanvasElement element: VFs) {
150 CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
152 PathUtilities.openCreatePath();
153 PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
154 PathUtilities.selectFirstLineParam();
155 PathValidations.extendPath(3);
156 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
162 // validate version change has no effect
163 for (CanvasElement element: VFs) {
164 RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
165 // change to version with different capabiliteis
166 CompositionPage.changeComponentVersion(canvasManager, element, "3.0",false);
167 // click on warning message
168 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
169 GeneralUIUtils.ultimateWait();
170 // validate paths changed
171 RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
173 "response message failed expectation, expectation is to change",
174 ServiceForwardingPathsResponse.getResponse(),
175 ServiceForwardingPathsResponse2.getResponse());
176 // validate there are no error messages
177 PathValidations.ValidateThereIsNoErrorMessage();
179 CompositionPage.changeComponentVersion(canvasManager, element, "1.0",false);
180 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
181 GeneralUIUtils.ultimateWait();
182 // validate paths hasn't changed
183 RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
185 "response message failed expectation, expectation is not to change",
186 ServiceForwardingPathsResponse2.getResponse(),
187 ServiceForwardingPathsResponse3.getResponse());
188 // validate there are no error messages
189 PathValidations.ValidateThereIsNoErrorMessage();
192 ///////////////////////
193 // post requisites //
194 ///////////////////////
197 certifyServiceAsTester(service);
201 // Test#3 Jira issue - 6230
203 public void ValidatePathServiceVersions() throws Exception {
205 //////////////////////
207 //////////////////////
210 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
211 String vsp_v2_description = "change description for version 2";
212 VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, HSSFile, vsp_v2_description, fullCompositionFile, getUser());
215 ServiceReqDetails service = PathUtilities.createService(getUser());
218 String vspName = vendorSoftwareProductObject.getName();
219 String pathName = "path1";
220 List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
221 CanvasManager canvasManager = CanvasManager.getCanvasManager();
222 for (CanvasElement element: VFs) {
223 CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
225 PathUtilities.openCreatePath();
226 PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
227 PathUtilities.selectFirstLineParam();
228 PathValidations.extendPath(3);
229 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
235 // validate version change has no effect
236 for (CanvasElement element: VFs) {
237 RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
239 CompositionPage.changeComponentVersion(canvasManager, element, "2.0",false);
240 // validate paths hasn't changed
241 RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
243 "response message failed expectation, expectation is not to change",
244 ServiceForwardingPathsResponse.getResponse(),
245 ServiceForwardingPathsResponse2.getResponse());
246 // validate there are no error messages
247 PathValidations.ValidateThereIsNoErrorMessage();
249 CompositionPage.changeComponentVersion(canvasManager, element, "1.0",false);
250 // validate paths hasn't changed
251 RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
253 "response message failed expectation, expectation is not to change",
254 ServiceForwardingPathsResponse.getResponse(),
255 ServiceForwardingPathsResponse3.getResponse());
256 // validate there are no error messages
257 PathValidations.ValidateThereIsNoErrorMessage();
260 ///////////////////////
261 // post requisites //
262 ///////////////////////
265 certifyServiceAsTester(service);
269 // Test#3 Jira issue - 6189
271 public void ValidatePathServiceVersionsDifferentCapabilities() throws Exception {
273 //////////////////////
275 //////////////////////
278 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
279 String vsp_v2_description = "change description for version 2";
280 VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, HSSFile, vsp_v2_description, fullCompositionFile, getUser());
283 ServiceReqDetails service = PathUtilities.createService(getUser());
286 String vspName = vendorSoftwareProductObject.getName();
287 String pathName = "path1";
288 List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
289 CanvasManager canvasManager = CanvasManager.getCanvasManager();
290 for (CanvasElement element: VFs) {
291 CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
293 PathUtilities.openCreatePath();
294 PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
295 PathUtilities.selectFirstLineParam();
296 PathValidations.extendPath(3);
297 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
303 // validate version change has no effect
304 for (CanvasElement element: VFs) {
305 RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
306 // change to version with different capabiliteis
307 CompositionPage.changeComponentVersion(canvasManager, element, "3.0",false);
308 // click on warning message
309 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
310 GeneralUIUtils.ultimateWait();
311 // validate paths changed
312 RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
314 "response message failed expectation, expectation is to change",
315 ServiceForwardingPathsResponse.getResponse(),
316 ServiceForwardingPathsResponse2.getResponse());
317 // validate there are no error messages
318 PathValidations.ValidateThereIsNoErrorMessage();
320 CompositionPage.changeComponentVersion(canvasManager, element, "1.0",false);
321 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
322 GeneralUIUtils.ultimateWait();
323 // validate paths hasn't changed
324 RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
326 "response message failed expectation, expectation is not to change",
327 ServiceForwardingPathsResponse2.getResponse(),
328 ServiceForwardingPathsResponse3.getResponse());
329 // validate there are no error messages
330 PathValidations.ValidateThereIsNoErrorMessage();
333 ///////////////////////
334 // post requisites //
335 ///////////////////////
338 certifyServiceAsTester(service);
342 // Test#3 Jira issue - 6231
344 public void ValidatePathServiceVersionsnegative() throws Exception {
346 //////////////////////
348 //////////////////////
351 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
352 String vsp_v2_description = "change description for version 2";
353 VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, HSSFile, vsp_v2_description, fullCompositionFile, getUser());
356 ServiceReqDetails service = PathUtilities.createService(getUser());
359 String vspName = vendorSoftwareProductObject.getName();
360 String pathName = "path1";
361 List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
362 CanvasManager canvasManager = CanvasManager.getCanvasManager();
363 for (CanvasElement element: VFs) {
364 CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
366 PathUtilities.openCreatePath();
367 PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
368 PathUtilities.selectFirstLineParam();
369 PathValidations.extendPath(3);
370 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
376 // validate version change has no effect
377 for (CanvasElement element: VFs) {
378 RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
379 // change to version with different capabiliteis
380 CompositionPage.changeComponentVersion(canvasManager, element, "3.0",false);
381 // click on warning message to cancel
382 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ModalItems.CANCEL.getValue() + "']").get(0).click();
383 GeneralUIUtils.ultimateWait();
384 // validate paths changed
385 RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
387 "response message failed expectation, expectation is not to change",
388 ServiceForwardingPathsResponse.getResponse(),
389 ServiceForwardingPathsResponse2.getResponse());
390 // validate there are no error messages
391 PathValidations.ValidateThereIsNoErrorMessage();
393 CompositionPage.changeComponentVersion(canvasManager, element, "3.0",true);
394 // click on warning message
395 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
396 GeneralUIUtils.ultimateWait();
397 // validate paths hasn't changed
398 RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
400 "response message failed expectation, expectation is to change",
401 ServiceForwardingPathsResponse2.getResponse(),
402 ServiceForwardingPathsResponse3.getResponse());
403 // validate there are no error messages
404 PathValidations.ValidateThereIsNoErrorMessage();
407 ///////////////////////
408 // post requisites //
409 ///////////////////////
412 certifyServiceAsTester(service);
416 // Test#3 Jira issue - 6189
418 public void ValidatePathServiceVersionsDifferentCapabilitiesInComplexService() throws Exception {
420 //////////////////////
422 //////////////////////
425 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
426 String vsp_v2_description = "change description for version 2";
427 VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, HSSFile, vsp_v2_description, fullCompositionFile, getUser());
430 ServiceReqDetails service = PathUtilities.createService(getUser());
433 String vspName = vendorSoftwareProductObject.getName();
434 String pathName = "path1";
435 List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
436 CanvasManager canvasManager = CanvasManager.getCanvasManager();
437 for (CanvasElement element: VFs) {
438 CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
440 PathUtilities.openCreatePath();
441 PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
442 PathUtilities.selectFirstLineParam();
443 PathValidations.extendPath(3);
444 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
447 certifyServiceAsTester(service);
449 reloginWithNewRole(UserRoleEnum.DESIGNER);
451 // create new version
452 GeneralUIUtils.findComponentAndClick(service.getName());
453 ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
454 canvasManager = CanvasManager.getCanvasManager();
455 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.LifeCyleChangeButtons.CHECKOUT.getValue());
461 // validate version change has no effect
462 for (CanvasElement element: VFs) {
463 RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
464 // change to version with different capabilities
465 CompositionPage.changeComponentVersion(canvasManager, element, "3.0",false);
466 // click on warning message
467 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
468 GeneralUIUtils.ultimateWait();
469 // validate paths changed
470 RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
472 "response message failed expectation, expectation is to change",
473 ServiceForwardingPathsResponse.getResponse(),
474 ServiceForwardingPathsResponse2.getResponse());
475 // validate there are no error messages
476 PathValidations.ValidateThereIsNoErrorMessage();
478 CompositionPage.changeComponentVersion(canvasManager, element, "1.0",false);
479 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
480 GeneralUIUtils.ultimateWait();
481 // validate paths hasn't changed
482 RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
484 "response message failed expectation, expectation is not to change",
485 ServiceForwardingPathsResponse2.getResponse(),
486 ServiceForwardingPathsResponse3.getResponse());
487 // validate there are no error messages
488 PathValidations.ValidateThereIsNoErrorMessage();
491 ///////////////////////
492 // post requisites //
493 ///////////////////////
496 certifyServiceAsTester(service);
500 public void ComplexServiceSanity() throws Exception {
501 // create & certify 2 VFs
502 List<String> vnfFiles = new ArrayList<>();
503 vnfFiles.add(HSSFile);
504 vnfFiles.add(fullCompositionFile);
505 List<String> VFNames = onboardAndCertifyMultipleVFs(filePath, vnfFiles);
506 reloginWithNewRole(UserRoleEnum.DESIGNER);
509 ServiceReqDetails serviceMetadata1 = PathUtilities.createService(getUser());
512 String path1 = "newPath";
513 PathUtilities.createPath(path1, VFNames.get(0));
514 PathUtilities.submitForTesting();
515 GeneralUIUtils.ultimateWait();
518 ServiceReqDetails serviceMetadata2 = PathUtilities.createService(getUser());
521 String path2 = "newPath2";
522 PathUtilities.createPath(path2, VFNames.get(1));
523 PathUtilities.submitForTesting();
526 reloginWithNewRole(UserRoleEnum.TESTER);
527 GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
528 TesterOperationPage.certifyComponent(serviceMetadata1.getName());
529 GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
530 TesterOperationPage.certifyComponent(serviceMetadata2.getName());
533 reloginWithNewRole(UserRoleEnum.GOVERNOR);
534 GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
535 GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
536 GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
537 GovernorOperationPage.approveSerivce(serviceMetadata2.getName());
539 // create service for complex service
540 reloginWithNewRole(UserRoleEnum.DESIGNER);
541 ServiceReqDetails serviceMetadata3 = PathUtilities.createService(getUser());
543 // validate complex's path
544 String[] services = {serviceMetadata1.getName(), serviceMetadata2.getName(), serviceMetadata3.getName()};
545 PathValidations.validateComplexExtendedPath(services);
547 // validate certification
548 certifyServiceAsTester(serviceMetadata3);
551 ////////////////////////////////////////////////////////////////////////////////////////
553 ////////////////////////////////////////////////////////////////////////////////////////
555 // workflow leading to path
556 public String onboardAndCertify(ResourceReqDetails resourceReqDetails, String filePath, String vnfFile) throws Exception {
557 VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFile, getUser());
558 String vspName = vendorSoftwareProductObject.getName();
560 DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
561 ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFile, "The topology template for " + vnfFile + " is as follows : ");
563 DeploymentArtifactPage.clickSubmitForTestingButton(vspName);
564 SetupCDTest.getExtendTest().log(Status.INFO, "relogin as TESTER");
565 reloginWithNewRole(UserRoleEnum.TESTER);
566 GeneralUIUtils.findComponentAndClick(vspName);
567 TesterOperationPage.certifyComponent(vspName);
571 public List<String> onboardAndCertifyMultipleVFs(String filePath, List<String> vnfFiles) throws Exception {
572 List<String> VFNames = new ArrayList<>();
573 for (int i = 0; i < vnfFiles.size(); i++) {
574 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
575 VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFiles.get(i), getUser());
576 VFNames.add(i, vendorSoftwareProductObject.getName());
577 DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
578 ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFiles.get(i), "The topology template for " + vnfFiles.get(i) + " is as follows : ");
579 DeploymentArtifactPage.clickSubmitForTestingButton(VFNames.get(i));
581 SetupCDTest.getExtendTest().log(Status.INFO, "relogin as TESTER");
582 reloginWithNewRole(UserRoleEnum.TESTER);
583 for (String VFName : VFNames) {
584 GeneralUIUtils.findComponentAndClick(VFName);
585 TesterOperationPage.certifyComponent(VFName);
590 public static List<CanvasElement> createComplexPath(String service) throws Exception {
591 List<CanvasElement> services = PathUtilities.linkServices(service, service, 3);
592 PathUtilities.createPathWithoutLink("name1", service);
593 PathUtilities.createPathWithoutLink("name2", service);
597 public ServiceReqDetails getToComplexService(String filepath, String vnfFile) throws Exception {
598 // create & certify VF
599 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
600 String vspName = onboardAndCertify(resourceReqDetails, filepath, vnfFile);
601 reloginWithNewRole(UserRoleEnum.DESIGNER);
602 ServiceReqDetails serviceMetadata1 = PathUtilities.createService(getUser());
605 PathUtilities.createPath("newPath", vspName);
606 PathUtilities.submitForTesting();
607 GeneralUIUtils.ultimateWait();
610 reloginWithNewRole(UserRoleEnum.TESTER);GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
611 TesterOperationPage.certifyComponent(serviceMetadata1.getName());
614 reloginWithNewRole(UserRoleEnum.GOVERNOR);
615 GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
616 GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
617 return serviceMetadata1;
620 public VendorSoftwareProductObject getToPathServiceVersions(ResourceReqDetails resourceReqDetails, String filepath, String vnfFileV1, String descriptionV2, String vnfFileV3, User user) throws Exception {
622 ////////////////////////////////////
624 ////////////////////////////////////
626 VendorSoftwareProductObject vendorSoftwareProduct = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFileV1, getUser());
627 String vspName = vendorSoftwareProduct.getName();
629 DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
630 ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFileV1, "The topology template for " + vnfFileV1 + " is as follows : ");
631 DeploymentArtifactPage.clickSubmitForTestingButton(vspName);
632 SetupCDTest.getExtendTest().log(Status.INFO, "relogin as TESTER");
633 reloginWithNewRole(UserRoleEnum.TESTER);
634 GeneralUIUtils.findComponentAndClick(vspName);
635 TesterOperationPage.certifyComponent(vspName);
636 reloginWithNewRole(UserRoleEnum.DESIGNER);
638 ////////////////////////////////////
640 ////////////////////////////////////
642 // vsp create new version
643 Pair<RestResponse, OnboardItemObject> newItemVersion = PathUtilities.createNewItemVersion(
644 vendorSoftwareProduct.getVspId(),
645 vendorSoftwareProduct.getComponentId(),
646 "version with different description", user);
647 assertEquals("did not succeed to create new item version", 200, newItemVersion.left.getErrorCode().intValue());
648 vendorSoftwareProduct.setVersion(newItemVersion.right.getItemId());
649 vendorSoftwareProduct.setComponentId(newItemVersion.right.getItemId());
651 // update vsp description
652 vendorSoftwareProduct.setDescription(descriptionV2);
653 RestResponse restResponse = PathUtilities.updateVendorSoftwareProduct(vendorSoftwareProduct, user);
654 assertEquals("did not succeed to update vsp", 200, restResponse.getErrorCode().intValue());
656 // commit & submit vsp
657 VendorSoftwareProductRestUtils.prepareVspForUse(user, vendorSoftwareProduct, false);
660 HomePage.showVspRepository();
661 PathUtilities.updateVF(vspName, vendorSoftwareProduct);
662 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.UPDATE_VF.getValue());
663 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.SUBMIT_FOR_TESTING_BUTTON.getValue()).click();
664 GeneralUIUtils.ultimateWait();
667 reloginWithNewRole(UserRoleEnum.TESTER);
668 GeneralUIUtils.findComponentAndClick(vspName);
669 TesterOperationPage.certifyComponent(vspName);
670 reloginWithNewRole(UserRoleEnum.DESIGNER);
672 ////////////////////////////////////
674 ////////////////////////////////////
676 // create new version
677 newItemVersion = PathUtilities.createNewItemVersion(
678 vendorSoftwareProduct.getVspId(),
679 vendorSoftwareProduct.getVersion(),
680 "version with different heat", user);
681 assertEquals("did not succeed to create new item version", 200, newItemVersion.left.getErrorCode().intValue());
682 vendorSoftwareProduct.setVersion(newItemVersion.right.getItemId());
683 vendorSoftwareProduct.setComponentId(newItemVersion.right.getItemId());
686 RestResponse uploadHeatPackage = VendorSoftwareProductRestUtils.uploadHeatPackage(filepath, vnfFileV3, vendorSoftwareProduct, user);
687 assertEquals("did not succeed to upload HEAT package", 200, uploadHeatPackage.getErrorCode().intValue());
689 RestResponse validateUpload = VendorSoftwareProductRestUtils.validateUpload(vendorSoftwareProduct, user);
690 assertEquals("did not succeed to validate upload process, reason: " + validateUpload.getResponse(), 200, validateUpload.getErrorCode().intValue());
692 // commit & submit vsp
693 VendorSoftwareProductRestUtils.prepareVspForUse(user, vendorSoftwareProduct, false);
696 HomePage.showVspRepository();
697 PathUtilities.updateVF(vspName, vendorSoftwareProduct);
698 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.UPDATE_VSP.getValue());
699 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.SUBMIT_FOR_TESTING_BUTTON.getValue()).click();
700 GeneralUIUtils.ultimateWait();
703 reloginWithNewRole(UserRoleEnum.TESTER);
704 GeneralUIUtils.findComponentAndClick(vspName);
705 TesterOperationPage.certifyComponent(vspName);
706 reloginWithNewRole(UserRoleEnum.DESIGNER);
708 return vendorSoftwareProduct;
711 public void certifyServiceAsTester (ServiceReqDetails serviceMetaData) throws Exception{
712 PathUtilities.submitForTesting();
713 reloginWithNewRole(UserRoleEnum.TESTER);
714 GeneralUIUtils.findComponentAndClick(serviceMetaData.getName());
715 TesterOperationPage.certifyComponent(serviceMetaData.getName());
719 protected UserRoleEnum getRole() {
720 return UserRoleEnum.DESIGNER;