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.onap.sdc.frontend.ci.tests.execute.AmdocsComplexService;
23 import com.aventstack.extentreports.Status;
24 import com.clearspring.analytics.util.Pair;
25 import org.apache.http.HttpStatus;
26 import org.onap.sdc.backend.ci.tests.datatypes.http.RestResponse;
27 import org.onap.sdc.frontend.ci.tests.utilities.FileHandling;
28 import org.onap.sdc.frontend.ci.tests.utilities.GeneralUIUtils;
29 import org.onap.sdc.frontend.ci.tests.utilities.OnboardingUiUtils;
30 import org.onap.sdc.frontend.ci.tests.utilities.ResourceUIUtils;
31 import org.onap.sdc.backend.ci.tests.utils.general.ElementFactory;
32 import org.onap.sdc.backend.ci.tests.utils.general.VendorSoftwareProductRestUtils;
33 import org.openecomp.sdc.be.model.User;
34 import org.onap.sdc.frontend.ci.tests.datatypes.CanvasElement;
35 import org.onap.sdc.frontend.ci.tests.datatypes.CanvasManager;
36 import org.onap.sdc.frontend.ci.tests.datatypes.DataTestIdEnum;
37 import org.onap.sdc.backend.ci.tests.datatypes.ResourceReqDetails;
38 import org.onap.sdc.backend.ci.tests.datatypes.ServiceReqDetails;
39 import org.onap.sdc.backend.ci.tests.datatypes.VendorSoftwareProductObject;
40 import org.onap.sdc.backend.ci.tests.datatypes.enums.UserRoleEnum;
41 import org.onap.sdc.frontend.ci.tests.execute.setup.ExtentTestActions;
42 import org.onap.sdc.frontend.ci.tests.execute.setup.SetupCDTest;
43 import org.onap.sdc.frontend.ci.tests.pages.CompositionPage;
44 import org.onap.sdc.frontend.ci.tests.pages.DeploymentArtifactPage;
45 import org.onap.sdc.frontend.ci.tests.pages.GovernorOperationPage;
46 import org.onap.sdc.frontend.ci.tests.pages.HomePage;
47 import org.onap.sdc.frontend.ci.tests.pages.ServiceGeneralPage;
48 import org.onap.sdc.frontend.ci.tests.pages.TesterOperationPage;
49 import org.testng.annotations.BeforeMethod;
50 import org.testng.annotations.Optional;
51 import org.testng.annotations.Parameters;
52 import org.testng.annotations.Test;
54 import java.util.ArrayList;
55 import java.util.List;
57 import static org.testng.AssertJUnit.assertEquals;
58 import static org.testng.AssertJUnit.assertNotSame;
62 ElementsChanges extends SetupCDTest {
64 private static final int NUMBER_OF_LINKS = 3;
65 protected static String filePath = FileHandling.getFilePath("ComplexService");
66 private static String fullCompositionFile = "fullComposition.zip";
67 private static String test = "test.zip";
68 private static String fullCompositionFile2 = "test.zip";
69 private static String HSSFile = "HSS.zip";
70 private static String VMMEFile = "VMME.zip";
71 private static String WithPort = "withPort.zip";
72 private static String withoutPort = "withoutPort.zip";
73 private static String makeDistributionValue;
75 @Parameters({"makeDistribution"})
77 public void beforeTestReadParams(@Optional("true") String makeDistributionReadValue) {
78 makeDistributionValue = makeDistributionReadValue;
81 //------------------------------------------Tests-----------------------------------------------------
83 // Test#1 Jira issue 6324
85 public void DeleteComponent() throws Exception {
86 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
87 String vspName = onboardAndCertify(resourceReqDetails, filePath, fullCompositionFile);
88 reloginWithNewRole(UserRoleEnum.DESIGNER);
89 ServiceReqDetails serviceMetadata = PathUtilities.createService(getUser());
90 List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, NUMBER_OF_LINKS);
91 String pathName = PathUtilities.createPathWithoutLink("DeleteComponent", vspName);
92 PathUtilities.deleteComponents(VFs);
93 PathValidations.validatePathListIsEmpty();
94 certifyServiceAsTester(serviceMetadata);
98 // Test#2 Jira issue 6325
100 public void DeleteServiceComponent() throws Exception {
101 ServiceReqDetails serviceMetadata = getToComplexService(filePath, fullCompositionFile);
102 reloginWithNewRole(UserRoleEnum.DESIGNER);
103 ServiceReqDetails complexService = PathUtilities.createService(getUser());
104 List<CanvasElement> services = createComplexPath(serviceMetadata.getName());
105 PathUtilities.deleteComponents(services);
106 PathValidations.validatePathListIsEmpty();
107 certifyServiceAsTester(complexService);
110 // Test#3 Jira issue 6364
112 public void ManualUpdateVF() throws Exception {
113 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
114 String vspName = onboardAndCertify(resourceReqDetails, filePath, fullCompositionFile);
115 reloginWithNewRole(UserRoleEnum.DESIGNER);
116 ServiceReqDetails serviceMetadata = PathUtilities.createService(getUser());
117 PathUtilities.createPath("ManualUpdateVF", vspName);
118 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.HOME_FROM_COMPOSITION.getValue());
119 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.MainMenuButtons.ONBOARD_BUTTON.getValue());
120 /// GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.ONBOARD_CATALOG.getValue());
121 ResourceUIUtils.clickOnElementByText(vspName, null);
122 ResourceUIUtils.clickOnElementByText("Create New Version", null);
123 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ComplexServiceAmdocs.NEW_VSP_VERSION_DESCRIPTION.getValue()).sendKeys("new vsap version for service path");
124 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.SUBMIT_NEW_VSP_VERSION_DESCRIPTION.getValue());
126 // VendorSoftwareProductObject v = new VendorSoftwareProductObject();
127 //VendorSoftwareProductRestUtils.uploadHeatPackage(filePath,fullCompositionFile,v,getUser());
128 //upload new heat +commit submit
130 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.MainMenuButtons.ONBOARD_BUTTON.getValue());
132 GeneralUIUtils.findComponentAndClick(serviceMetadata.getName());
133 ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
134 // CanvasManager.getCanvasManager().clickOnCanvaElement(vf);
136 //validate path still exist
137 certifyServiceAsTester(serviceMetadata);
141 public void UpdateComponent() throws Exception {
142 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
143 String vspName = onboardAndCertify(resourceReqDetails, filePath, VMMEFile);
148 public void UpdateComponentWithouForwarder() throws Exception {
149 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
150 String vsp_v2_description = "change description for version 2";
151 VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, WithPort, vsp_v2_description, withoutPort, getUser());
154 ServiceReqDetails service = PathUtilities.createService(getUser());
157 String vspName = vendorSoftwareProductObject.getName();
158 String pathName = "path1";
159 List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
160 CanvasManager canvasManager = CanvasManager.getCanvasManager();
161 for (CanvasElement element : VFs) {
162 CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
164 PathUtilities.openCreatePath();
165 PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
166 PathUtilities.selectFirstLineParam();
167 PathValidations.extendPath(NUMBER_OF_LINKS);
168 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
174 // validate version change has no effect
175 for (CanvasElement element : VFs) {
176 RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
177 // change to version with different capabiliteis
178 CompositionPage.changeComponentVersion(canvasManager, element, "3.0", false);
179 // click on warning message
180 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
181 GeneralUIUtils.ultimateWait();
182 // validate paths changed
183 RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
185 "response message failed expectation, expectation is to change",
186 ServiceForwardingPathsResponse.getResponse(),
187 ServiceForwardingPathsResponse2.getResponse());
188 // validate there are no error messages
189 PathValidations.ValidateThereIsNoErrorMessage();
191 CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
192 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
193 GeneralUIUtils.ultimateWait();
194 // validate paths hasn't changed
195 RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
197 "response message failed expectation, expectation is not to change",
198 ServiceForwardingPathsResponse2.getResponse(),
199 ServiceForwardingPathsResponse3.getResponse());
200 // validate there are no error messages
201 PathValidations.ValidateThereIsNoErrorMessage();
204 ///////////////////////
205 // post requisites //
206 ///////////////////////
209 certifyServiceAsTester(service);
213 // Test#3 Jira issue - 6230
215 public void ValidatePathServiceVersions() throws Exception {
217 //////////////////////
219 //////////////////////
222 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
223 String vsp_v2_description = "change description for version 2";
224 VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, HSSFile, vsp_v2_description, fullCompositionFile, getUser());
227 ServiceReqDetails service = PathUtilities.createService(getUser());
230 String vspName = vendorSoftwareProductObject.getName();
231 String pathName = "path1";
232 List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
233 CanvasManager canvasManager = CanvasManager.getCanvasManager();
234 for (CanvasElement element : VFs) {
235 CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
237 PathUtilities.openCreatePath();
238 PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
239 PathUtilities.selectFirstLineParam();
240 PathValidations.extendPath(NUMBER_OF_LINKS);
241 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
247 // validate version change has no effect
248 for (CanvasElement element : VFs) {
249 RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
251 CompositionPage.changeComponentVersion(canvasManager, element, "2.0", false);
252 // validate paths hasn't changed
253 RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
255 "response message failed expectation, expectation is not to change",
256 ServiceForwardingPathsResponse.getResponse(),
257 ServiceForwardingPathsResponse2.getResponse());
258 // validate there are no error messages
259 PathValidations.ValidateThereIsNoErrorMessage();
261 CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
262 // validate paths hasn't changed
263 RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
265 "response message failed expectation, expectation is not to change",
266 ServiceForwardingPathsResponse.getResponse(),
267 ServiceForwardingPathsResponse3.getResponse());
268 // validate there are no error messages
269 PathValidations.ValidateThereIsNoErrorMessage();
272 ///////////////////////
273 // post requisites //
274 ///////////////////////
277 certifyServiceAsTester(service);
281 // Test#3 Jira issue - 6189
283 public void ValidatePathServiceVersionsDifferentCapabilities() throws Exception {
285 //////////////////////
287 //////////////////////
290 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
291 String vsp_v2_description = "change description for version 2";
292 VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, HSSFile, vsp_v2_description, fullCompositionFile, getUser());
295 ServiceReqDetails service = PathUtilities.createService(getUser());
298 String vspName = vendorSoftwareProductObject.getName();
299 String pathName = "path1";
300 List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
301 CanvasManager canvasManager = CanvasManager.getCanvasManager();
302 for (CanvasElement element : VFs) {
303 CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
305 PathUtilities.openCreatePath();
306 PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
307 PathUtilities.selectFirstLineParam();
308 PathValidations.extendPath(NUMBER_OF_LINKS);
309 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
315 // validate version change has no effect
316 for (CanvasElement element : VFs) {
317 RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
318 // change to version with different capabiliteis
319 CompositionPage.changeComponentVersion(canvasManager, element, "3.0", false);
320 // click on warning message
321 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
322 GeneralUIUtils.ultimateWait();
323 // validate paths changed
324 RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
326 "response message failed expectation, expectation is to change",
327 ServiceForwardingPathsResponse.getResponse(),
328 ServiceForwardingPathsResponse2.getResponse());
329 // validate there are no error messages
330 PathValidations.ValidateThereIsNoErrorMessage();
332 CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
333 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
334 GeneralUIUtils.ultimateWait();
335 // validate paths hasn't changed
336 RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
338 "response message failed expectation, expectation is not to change",
339 ServiceForwardingPathsResponse2.getResponse(),
340 ServiceForwardingPathsResponse3.getResponse());
341 // validate there are no error messages
342 PathValidations.ValidateThereIsNoErrorMessage();
345 ///////////////////////
346 // post requisites //
347 ///////////////////////
350 certifyServiceAsTester(service);
354 // Test#3 Jira issue - 6231
356 public void ValidatePathServiceVersionsnegative() throws Exception {
358 //////////////////////
360 //////////////////////
363 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
364 String vsp_v2_description = "change description for version 2";
365 VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, HSSFile, vsp_v2_description, fullCompositionFile, getUser());
368 ServiceReqDetails service = PathUtilities.createService(getUser());
371 String vspName = vendorSoftwareProductObject.getName();
372 String pathName = "path1";
373 List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
374 CanvasManager canvasManager = CanvasManager.getCanvasManager();
375 for (CanvasElement element : VFs) {
376 CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
378 PathUtilities.openCreatePath();
379 PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
380 PathUtilities.selectFirstLineParam();
381 PathValidations.extendPath(NUMBER_OF_LINKS);
382 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
388 // validate version change has no effect
389 for (CanvasElement element : VFs) {
390 RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
391 // change to version with different capabiliteis
392 CompositionPage.changeComponentVersion(canvasManager, element, "3.0", false);
393 // click on warning message to cancel
394 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ModalItems.CANCEL.getValue() + "']").get(0).click();
395 GeneralUIUtils.ultimateWait();
396 // validate paths changed
397 RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
399 "response message failed expectation, expectation is not to change",
400 ServiceForwardingPathsResponse.getResponse(),
401 ServiceForwardingPathsResponse2.getResponse());
402 // validate there are no error messages
403 PathValidations.ValidateThereIsNoErrorMessage();
405 CompositionPage.changeComponentVersion(canvasManager, element, "3.0", true);
406 // click on warning message
407 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
408 GeneralUIUtils.ultimateWait();
409 // validate paths hasn't changed
410 RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
412 "response message failed expectation, expectation is to change",
413 ServiceForwardingPathsResponse2.getResponse(),
414 ServiceForwardingPathsResponse3.getResponse());
415 // validate there are no error messages
416 PathValidations.ValidateThereIsNoErrorMessage();
419 ///////////////////////
420 // post requisites //
421 ///////////////////////
424 certifyServiceAsTester(service);
428 // Test#3 Jira issue - 6189
430 public void ValidatePathServiceVersionsDifferentCapabilitiesInComplexService() throws Exception {
432 //////////////////////
434 //////////////////////
437 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
438 String vsp_v2_description = "change description for version 2";
439 VendorSoftwareProductObject vendorSoftwareProductObject = getToPathServiceVersions(resourceReqDetails, filePath, HSSFile, vsp_v2_description, fullCompositionFile, getUser());
442 ServiceReqDetails service = PathUtilities.createService(getUser());
445 String vspName = vendorSoftwareProductObject.getName();
446 String pathName = "path1";
447 List<CanvasElement> VFs = PathUtilities.linkVFs(vspName, 2);
448 CanvasManager canvasManager = CanvasManager.getCanvasManager();
449 for (CanvasElement element : VFs) {
450 CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
452 PathUtilities.openCreatePath();
453 PathUtilities.insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
454 PathUtilities.selectFirstLineParam();
455 PathValidations.extendPath(NUMBER_OF_LINKS);
456 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
459 certifyServiceAsTester(service);
461 reloginWithNewRole(UserRoleEnum.DESIGNER);
463 // create new version
464 GeneralUIUtils.findComponentAndClick(service.getName());
465 ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
466 canvasManager = CanvasManager.getCanvasManager();
467 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.LifeCyleChangeButtons.CHECKOUT.getValue());
473 // validate version change has no effect
474 for (CanvasElement element : VFs) {
475 RestResponse ServiceForwardingPathsResponse = PathUtilities.getServiceForwardingPathsAPI(service.getName());
476 // change to version with different capabilities
477 CompositionPage.changeComponentVersion(canvasManager, element, "3.0", false);
478 // click on warning message
479 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
480 GeneralUIUtils.ultimateWait();
481 // validate paths changed
482 RestResponse ServiceForwardingPathsResponse2 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
484 "response message failed expectation, expectation is to change",
485 ServiceForwardingPathsResponse.getResponse(),
486 ServiceForwardingPathsResponse2.getResponse());
487 // validate there are no error messages
488 PathValidations.ValidateThereIsNoErrorMessage();
490 CompositionPage.changeComponentVersion(canvasManager, element, "1.0", false);
491 GeneralUIUtils.findElementsByXpath("//*[@data-tests-id='" + DataTestIdEnum.ComplexServiceAmdocs.OK.getValue() + "']").get(0).click();
492 GeneralUIUtils.ultimateWait();
493 // validate paths hasn't changed
494 RestResponse ServiceForwardingPathsResponse3 = PathUtilities.getServiceForwardingPathsAPI(service.getName());
496 "response message failed expectation, expectation is not to change",
497 ServiceForwardingPathsResponse2.getResponse(),
498 ServiceForwardingPathsResponse3.getResponse());
499 // validate there are no error messages
500 PathValidations.ValidateThereIsNoErrorMessage();
503 ///////////////////////
504 // post requisites //
505 ///////////////////////
508 certifyServiceAsTester(service);
512 public void ComplexServiceSanity() throws Exception {
513 // create & certify 2 VFs
514 List<String> vnfFiles = new ArrayList<>();
515 vnfFiles.add(HSSFile);
516 vnfFiles.add(fullCompositionFile);
517 List<String> VFNames = onboardAndCertifyMultipleVFs(filePath, vnfFiles);
518 reloginWithNewRole(UserRoleEnum.DESIGNER);
521 ServiceReqDetails serviceMetadata1 = PathUtilities.createService(getUser());
524 String path1 = "newPath";
525 PathUtilities.createPath(path1, VFNames.get(0));
526 PathUtilities.submitForTesting();
527 GeneralUIUtils.ultimateWait();
530 ServiceReqDetails serviceMetadata2 = PathUtilities.createService(getUser());
533 String path2 = "newPath2";
534 PathUtilities.createPath(path2, VFNames.get(1));
535 PathUtilities.submitForTesting();
538 reloginWithNewRole(UserRoleEnum.TESTER);
539 GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
540 TesterOperationPage.certifyComponent(serviceMetadata1.getName());
541 GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
542 TesterOperationPage.certifyComponent(serviceMetadata2.getName());
545 reloginWithNewRole(UserRoleEnum.GOVERNOR);
546 GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
547 GovernorOperationPage.approveService(serviceMetadata1.getName());
548 GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
549 GovernorOperationPage.approveService(serviceMetadata2.getName());
551 // create service for complex service
552 reloginWithNewRole(UserRoleEnum.DESIGNER);
553 ServiceReqDetails serviceMetadata3 = PathUtilities.createService(getUser());
555 // validate complex's path
556 String[] services = {serviceMetadata1.getName(), serviceMetadata2.getName(), serviceMetadata3.getName()};
557 PathValidations.validateComplexExtendedPath(services);
559 // validate certification
560 certifyServiceAsTester(serviceMetadata3);
563 ////////////////////////////////////////////////////////////////////////////////////////
565 ////////////////////////////////////////////////////////////////////////////////////////
567 // workflow leading to path
568 public String onboardAndCertify(ResourceReqDetails resourceReqDetails, String filePath, String vnfFile) throws Exception {
569 VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFile, getUser());
570 String vspName = vendorSoftwareProductObject.getName();
572 DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
573 ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFile, "The topology template for " + vnfFile + " is as follows : ");
575 DeploymentArtifactPage.clickSubmitForTestingButton(vspName);
576 SetupCDTest.getExtendTest().log(Status.INFO, "relogin as TESTER");
577 reloginWithNewRole(UserRoleEnum.TESTER);
578 GeneralUIUtils.findComponentAndClick(vspName);
579 TesterOperationPage.certifyComponent(vspName);
583 public List<String> onboardAndCertifyMultipleVFs(String filePath, List<String> vnfFiles) throws Exception {
584 List<String> VFNames = new ArrayList<>();
585 for (int i = 0; i < vnfFiles.size(); i++) {
586 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
587 VendorSoftwareProductObject vendorSoftwareProductObject = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFiles.get(i), getUser());
588 VFNames.add(i, vendorSoftwareProductObject.getName());
589 DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
590 ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFiles.get(i), "The topology template for " + vnfFiles.get(i) + " is as follows : ");
591 DeploymentArtifactPage.clickSubmitForTestingButton(VFNames.get(i));
593 SetupCDTest.getExtendTest().log(Status.INFO, "relogin as TESTER");
594 reloginWithNewRole(UserRoleEnum.TESTER);
595 for (String VFName : VFNames) {
596 GeneralUIUtils.findComponentAndClick(VFName);
597 TesterOperationPage.certifyComponent(VFName);
602 public static List<CanvasElement> createComplexPath(String service) throws Exception {
603 List<CanvasElement> services = PathUtilities.linkServices(service, service, NUMBER_OF_LINKS);
604 PathUtilities.createPathWithoutLink("name1", service);
605 PathUtilities.createPathWithoutLink("name2", service);
609 public ServiceReqDetails getToComplexService(String filepath, String vnfFile) throws Exception {
610 // create & certify VF
611 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
612 String vspName = onboardAndCertify(resourceReqDetails, filepath, vnfFile);
613 reloginWithNewRole(UserRoleEnum.DESIGNER);
614 ServiceReqDetails serviceMetadata1 = PathUtilities.createService(getUser());
617 PathUtilities.createPath("newPath", vspName);
618 PathUtilities.submitForTesting();
619 GeneralUIUtils.ultimateWait();
622 reloginWithNewRole(UserRoleEnum.TESTER);
623 GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
624 TesterOperationPage.certifyComponent(serviceMetadata1.getName());
627 reloginWithNewRole(UserRoleEnum.GOVERNOR);
628 GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
629 GovernorOperationPage.approveService(serviceMetadata1.getName());
630 return serviceMetadata1;
633 public VendorSoftwareProductObject getToPathServiceVersions(ResourceReqDetails resourceReqDetails, String filepath, String vnfFileV1, String descriptionV2, String vnfFileV3, User user) throws Exception {
635 ////////////////////////////////////
637 ////////////////////////////////////
639 VendorSoftwareProductObject vendorSoftwareProduct = OnboardingUiUtils.onboardAndValidate(resourceReqDetails, filePath, vnfFileV1, getUser());
640 String vspName = vendorSoftwareProduct.getName();
642 DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
643 ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFileV1, "The topology template for " + vnfFileV1 + " is as follows : ");
644 DeploymentArtifactPage.clickSubmitForTestingButton(vspName);
645 SetupCDTest.getExtendTest().log(Status.INFO, "relogin as TESTER");
646 reloginWithNewRole(UserRoleEnum.TESTER);
647 GeneralUIUtils.findComponentAndClick(vspName);
648 TesterOperationPage.certifyComponent(vspName);
649 reloginWithNewRole(UserRoleEnum.DESIGNER);
651 ////////////////////////////////////
653 ////////////////////////////////////
655 // vsp create new version
656 Pair<RestResponse, OnboardItemObject> newItemVersion = PathUtilities.createNewItemVersion(
657 vendorSoftwareProduct.getVspId(),
658 vendorSoftwareProduct.getComponentId(),
659 "version with different description", user);
660 assertEquals("did not succeed to create new item version", HttpStatus.SC_OK, newItemVersion.left.getErrorCode().intValue());
661 vendorSoftwareProduct.setVersion(newItemVersion.right.getItemId());
662 vendorSoftwareProduct.setComponentId(newItemVersion.right.getItemId());
664 // update vsp description
665 vendorSoftwareProduct.setDescription(descriptionV2);
666 RestResponse restResponse = PathUtilities.updateVendorSoftwareProduct(vendorSoftwareProduct, user);
667 assertEquals("did not succeed to update vsp", HttpStatus.SC_OK, restResponse.getErrorCode().intValue());
669 // commit & submit vsp
670 VendorSoftwareProductRestUtils.prepareVspForUse(user, vendorSoftwareProduct, false);
673 HomePage.showVspRepository();
674 PathUtilities.updateVF(vspName, vendorSoftwareProduct);
675 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.UPDATE_VF.getValue());
676 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.SUBMIT_FOR_TESTING_BUTTON.getValue()).click();
677 GeneralUIUtils.ultimateWait();
680 reloginWithNewRole(UserRoleEnum.TESTER);
681 GeneralUIUtils.findComponentAndClick(vspName);
682 TesterOperationPage.certifyComponent(vspName);
683 reloginWithNewRole(UserRoleEnum.DESIGNER);
685 ////////////////////////////////////
687 ////////////////////////////////////
689 // create new version
690 newItemVersion = PathUtilities.createNewItemVersion(
691 vendorSoftwareProduct.getVspId(),
692 vendorSoftwareProduct.getVersion(),
693 "version with different heat", user);
694 assertEquals("did not succeed to create new item version", HttpStatus.SC_OK, newItemVersion.left.getErrorCode().intValue());
695 vendorSoftwareProduct.setVersion(newItemVersion.right.getItemId());
696 vendorSoftwareProduct.setComponentId(newItemVersion.right.getItemId());
699 RestResponse uploadHeatPackage = VendorSoftwareProductRestUtils.uploadHeatPackage(filepath, vnfFileV3, vendorSoftwareProduct, user);
700 assertEquals("did not succeed to upload HEAT package", HttpStatus.SC_OK, uploadHeatPackage.getErrorCode().intValue());
702 RestResponse validateUpload = VendorSoftwareProductRestUtils.validateUpload(vendorSoftwareProduct, user);
703 assertEquals("did not succeed to validate upload process, reason: " + validateUpload.getResponse(), HttpStatus.SC_OK, validateUpload.getErrorCode().intValue());
705 // commit & submit vsp
706 VendorSoftwareProductRestUtils.prepareVspForUse(user, vendorSoftwareProduct, false);
709 HomePage.showVspRepository();
710 PathUtilities.updateVF(vspName, vendorSoftwareProduct);
711 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.UPDATE_VSP.getValue());
712 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.SUBMIT_FOR_TESTING_BUTTON.getValue()).click();
713 GeneralUIUtils.ultimateWait();
716 reloginWithNewRole(UserRoleEnum.TESTER);
717 GeneralUIUtils.findComponentAndClick(vspName);
718 TesterOperationPage.certifyComponent(vspName);
719 reloginWithNewRole(UserRoleEnum.DESIGNER);
721 return vendorSoftwareProduct;
724 public void certifyServiceAsTester(ServiceReqDetails serviceMetaData) throws Exception {
725 PathUtilities.submitForTesting();
726 reloginWithNewRole(UserRoleEnum.TESTER);
727 GeneralUIUtils.findComponentAndClick(serviceMetaData.getName());
728 TesterOperationPage.certifyComponent(serviceMetaData.getName());
732 protected UserRoleEnum getRole() {
733 return UserRoleEnum.DESIGNER;