1 package org.openecomp.sdc.ci.tests.execute.sanity;
3 import com.aventstack.extentreports.Status;
4 import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
5 import org.openecomp.sdc.be.model.Resource;
6 import org.openecomp.sdc.be.model.Service;
7 import org.openecomp.sdc.be.model.User;
8 import org.openecomp.sdc.ci.tests.datatypes.*;
9 import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
10 import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
11 import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
12 import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
13 import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
14 import org.openecomp.sdc.ci.tests.pages.*;
15 import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
16 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
17 import org.openecomp.sdc.ci.tests.utilities.PortMirroringUtils;
18 import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
19 import org.openecomp.sdc.ci.tests.utils.general.*;
20 import org.openecomp.sdc.ci.tests.verificator.PropertiesAssignmentVerificator;
21 import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
22 import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
23 import org.testng.Assert;
24 import org.testng.annotations.BeforeClass;
25 import org.testng.annotations.Test;
29 public class UpgradeServices extends SetupCDTest{
32 protected User sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);
33 private String filePath;
36 public void beforeClass(){
37 filePath = org.openecomp.sdc.ci.tests.utilities.FileHandling.getFilePath("");
41 public void upgradeVfOnServiceLevel() throws Throwable{
42 String vnfFile = "2016-227_vmme_vmme_30_1610_e2e.zip";
43 //1. Import VSP, create VF, certify
44 Resource vfResource = createAndCertifyVFfromVSP(vnfFile);
45 //2. Create CR, certify
46 ResourceReqDetails crMetaData = createCRAndCertify();
47 //3. Create PNF, certify
48 ResourceReqDetails pnfMetaData = createPnfAndCertify();
50 //4. Create Service1. Service composition - add 2 VFi
51 Service service1 = createService();
52 getExtendTest().log(Status.INFO, "Add VFi to service twice");
53 CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
54 CanvasManager canvasManager1 = createCanvasManager(service1);
55 CanvasElement vfElementVmme1 = canvasManager1.createElementOnCanvas(vfResource.getName());
56 CanvasElement vfElementVmme11 = canvasManager1.createElementOnCanvas(vfResource.getName());
58 //5. Add CRi, PNFi and PMC to Service1
59 getExtendTest().log(Status.INFO, "Add PMC element to service");
60 CompositionPage.searchForElement(PortMirroringEnum.PMC_ELEMENT_IN_PALLETE.getValue());
61 CanvasElement pmcElement = canvasManager1.createElementOnCanvas(PortMirroringEnum.PMC_ELEMENT_IN_PALLETE.getValue());
62 getExtendTest().log(Status.INFO, "Add CR and PNF elements to service");
63 canvasManager1.createElementOnCanvas(crMetaData.getName());
64 canvasManager1.createElementOnCanvas(pnfMetaData.getName());
66 //6. Link between VF and PMC. Give values to capability properties. Certify Service1.
67 ConnectionWizardPopUpObject connectionWizardPopUpObject = new ConnectionWizardPopUpObject("", "",
68 PortMirroringEnum.PM_REQ_TYPE.getValue(), PortMirroringEnum.PMC_SOURCE_CAP.getValue());
69 Map<String, String> capPropValues1 = canvasManager1.linkElementsWithCapPropAssignment(vfElementVmme1,
70 pmcElement, connectionWizardPopUpObject); //link elements, assign values to properties and save map of values for later validation
71 certifyServiceInUI(service1);
72 service1.setVersion("1.0");
73 service1 = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, service1.getName(), service1.getVersion());
74 String vf1CustUuidOrig = AtomicOperationUtils.getServiceComponentInstanceByName
75 (service1, vfElementVmme1.getElementNameOnCanvas(),true).getCustomizationUUID();
77 //7. Create Service2. Service composition - add VFi. Start certifying Service2 ("certification in progress" stage)
78 Service service2 = createService();
79 getExtendTest().log(Status.INFO, "Add VFi to service");
80 CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
81 CanvasManager canvasManager2 = createCanvasManager(service2);
82 CanvasElement vfElementVmme2 = canvasManager2.createElementOnCanvas(vfResource.getName());
83 getExtendTest().log(Status.INFO, "Start service certification");
84 AtomicOperationUtils.changeComponentState(service2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.STARTCERTIFICATION, true).getLeft();
85 service2 = AtomicOperationUtils.getServiceObject(service2.getUniqueId());
86 String vf2CustUuidOrig = AtomicOperationUtils.getServiceComponentInstanceByName
87 (service2, vfElementVmme2.getElementNameOnCanvas(),true).getCustomizationUUID();
89 //8. Create Service3. Service composition - add VFi. Leave service in "checked out" state
90 Service service3 = createService();
91 getExtendTest().log(Status.INFO, "Add VFi to service");
92 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
93 CanvasManager canvasManager3 = createCanvasManager(service3);
94 CanvasElement vfElementVmme3 = canvasManager3.createElementOnCanvas(vfResource.getName());
95 service3 = AtomicOperationUtils.getServiceObject(service3.getUniqueId()); //updated
96 String vf3CustUuidOrig = AtomicOperationUtils.getServiceComponentInstanceByName
97 (service3, vfElementVmme3.getElementNameOnCanvas(),true).getCustomizationUUID();
99 //9. VF - checkout, save, click "certify"
100 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
101 GeneralUIUtils.findComponentAndClick(vfResource.getName());
102 GeneralPageElements.clickCheckoutButton();
103 GeneralPageElements.clickCreateUpdateButton(10*60);
104 GeneralPageElements.clickCertifyButtonNoUpgradePopupDismiss(vfResource.getName());
106 //10. Validate that Service1 can be upgraded (checked), Service2 and Service3 are locked
107 //TODO - add validation in UI
109 //11. Click Upgrade button
110 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.UPGRADE_SERVICES_OK.getValue());
111 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.UPGRADE_SERVICES_CLOSE.getValue());
113 //12. Open Service1, verify version (1.1), state(checked in), VFi version (v2.0)
114 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
115 GeneralUIUtils.findComponentAndClick(service1.getName());
116 ServiceVerificator.verifyVersionUI("1.1");
117 ServiceVerificator.verifyServiceLifecycleInUI(LifeCycleStateEnum.CHECKIN);
118 ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
119 CanvasManager canvasManager4 = CanvasManager.getCanvasManager();
120 canvasManager4.clickOnCanvaElement(vfElementVmme1);
121 ServiceVerificator.verifyResourceInstanceVersionUI("2.0");
122 canvasManager4.clickOnCanvaElement(vfElementVmme11);
123 ServiceVerificator.verifyResourceInstanceVersionUI("2.0");
125 //13. Verify that VFi CustomizationID is different
126 service1.setVersion("1.1");
127 service1 = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, service1.getName(), service1.getVersion()); //updated
128 String vf1CustUuidUpd = AtomicOperationUtils.getServiceComponentInstanceByName
129 (service1, vfElementVmme1.getElementNameOnCanvas(),true).getCustomizationUUID();
130 Assert.assertTrue(!vf1CustUuidOrig.equals(vf1CustUuidUpd));
132 //14. Verify that capabilities properties assignment is kept
133 canvasManager4.openLinkPopupReqsCapsConnection(vfElementVmme1, pmcElement); //open connection wizard
134 Map<String, String> capPropValues2 = canvasManager4.connectionWizardCollectCapPropValues(); //collect cap prop values
135 Assert.assertTrue(capPropValues1.equals(capPropValues2)); // compare cap prop values before and after changing VF version
136 canvasManager4.clickSaveOnLinkPopup();
138 //15. Open Service2, verify version (0.1), state ("in testing"), VFi version (1.0) and VFi Customization UUID (hasn't changed)
139 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
140 GeneralUIUtils.findComponentAndClick(service2.getName());
141 ServiceVerificator.verifyVersionUI("0.1");
142 ServiceVerificator.verifyServiceLifecycleInUI(LifeCycleStateEnum.IN_TESTING);
143 ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
144 CanvasManager canvasManager5 = CanvasManager.getCanvasManager();
145 canvasManager5.clickOnCanvaElement(vfElementVmme2);
146 ServiceVerificator.verifyResourceInstanceVersionUI("1.0");
147 service2 = AtomicOperationUtils.getServiceObject(service2.getUniqueId()); //updated
148 String vf2CustUuidUpd = AtomicOperationUtils.getServiceComponentInstanceByName
149 (service2, vfElementVmme2.getElementNameOnCanvas(),true).getCustomizationUUID();
150 Assert.assertTrue(vf2CustUuidOrig.equals(vf2CustUuidUpd));
152 //16. Open Service3, verify version (0.1), state ("checked out"), VFi version (1.0) and VFi Customization UUID (hasn't changed)
153 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
154 GeneralUIUtils.findComponentAndClick(service3.getName());
155 ServiceVerificator.verifyVersionUI("0.1");
156 ServiceVerificator.verifyServiceLifecycleInUI(LifeCycleStateEnum.CHECKOUT);
157 ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
158 CanvasManager canvasManager6 = CanvasManager.getCanvasManager();
159 canvasManager6.clickOnCanvaElement(vfElementVmme3);
160 ServiceVerificator.verifyResourceInstanceVersionUI("1.0");
161 service3 = AtomicOperationUtils.getServiceObject(service3.getUniqueId()); //updated
162 String vf3CustUuidUpd = AtomicOperationUtils.getServiceComponentInstanceByName
163 (service3, vfElementVmme3.getElementNameOnCanvas(),true).getCustomizationUUID();
164 Assert.assertTrue(vf3CustUuidOrig.equals(vf3CustUuidUpd));
166 //17. Open CR, checkout, certify. Verify there is no upgrade popup
167 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
168 GeneralUIUtils.findComponentAndClick(crMetaData.getName());
169 ResourceGeneralPage.clickCheckoutButton();
170 ResourceGeneralPage.clickCertifyButton(crMetaData.getName());
171 Assert.assertTrue(!UpgradeServicesPopup.isUpgradePopupShown());
173 //18. Open PNF, checkout, certify. Verify there is no upgrade popup
174 GeneralUIUtils.findComponentAndClick(pnfMetaData.getName());
175 ResourceGeneralPage.clickCheckoutButton();
176 ResourceGeneralPage.clickCertifyButton(pnfMetaData.getName());
177 Assert.assertTrue(!UpgradeServicesPopup.isUpgradePopupShown());
181 public void upgradeAllottedVfOnServiceLevel() throws Throwable {
182 String propUUID = "depending_service_uuid";
183 String propInvUUID = "depending_service_invariant_uuid";
184 String propName = "depending_service_name";
186 //1. Create Service1, certify
187 Service service1 = createService();
188 getExtendTest().log(Status.INFO, "Certify Service1");
189 AtomicOperationUtils.changeComponentState(service1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
190 String serviceName = service1.getName();
191 String serviceInvUUID = service1.getInvariantUUID();
192 String serviceUUIDv1 = service1.getUUID();
194 //2. Import AllottedResource yaml, create VFC, certify
195 String fileName = "Allottedresource.yml";
196 ResourceReqDetails vfcMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
197 ResourceCategoryEnum.ALLOTTED_RESOURCE, getUser());
198 ResourceUIUtils.importVfc(vfcMetaData, filePath, fileName, getUser());
199 ResourceGeneralPage.clickCertifyButton(vfcMetaData.getName());
201 //3. Create VF, add VFCi to canvas
202 ResourceReqDetails vfMetaData = createVFviaAPI(ResourceCategoryEnum.ALLOTTED_RESOURCE_TUNNEL_XCONNECT);
203 CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
204 GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
205 ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
206 CanvasManager canvasManager1 = CanvasManager.getCanvasManager();
207 CanvasElement vfcElement1 = canvasManager1.createElementOnCanvas(vfcMetaData.getName());
209 //4. VF Properties Assignment: edit values of depending service properties, certify VF
210 CompositionPage.moveToPropertiesScreen();
211 PropertiesAssignmentPage.findSearchBoxAndClick(propName);
212 PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(propName), serviceName);
213 PropertiesAssignmentPage.clickOnSaveButton();
214 PropertiesAssignmentPage.findSearchBoxAndClick(propUUID);
215 PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(propUUID), serviceUUIDv1);
216 PropertiesAssignmentPage.clickOnSaveButton();
217 PropertiesAssignmentPage.findSearchBoxAndClick(propInvUUID);
218 PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(propInvUUID), serviceInvUUID);
219 PropertiesAssignmentPage.clickOnSaveButton();
220 ResourceGeneralPage.clickCertifyButton(vfMetaData.getName());
222 //5. Create Service2, add VFi to Service2, certify Service2
223 Service service2 = createService();
224 CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
225 CanvasManager canvasManager2 = createCanvasManager(service2);
226 CanvasElement vfElement1 = canvasManager2.createElementOnCanvas(vfMetaData.getName());
227 getExtendTest().log(Status.INFO, "Certify Service2");
228 AtomicOperationUtils.changeComponentState(service2, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
230 //6. Create Service3, add VFi to Service3, leave Service3 in checked-out state
231 Service service3 = createService();
232 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
233 CanvasManager canvasManager3 = createCanvasManager(service3);
234 CanvasElement vfElement2 = canvasManager3.createElementOnCanvas(vfMetaData.getName());
236 //7. Check out and certify Service1 (keep new UUID)
237 AtomicOperationUtils.changeComponentState(service1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
238 AtomicOperationUtils.changeComponentState(service1, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
239 service1 = AtomicOperationUtils.getServiceObject(service1.getUniqueId());
240 String serviceUUIDv2 = service1.getUUID();
242 //8. Open Service1 and click “Upgrade Services” button
243 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
244 GeneralUIUtils.findComponentAndClick(service1.getName());
245 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.UPDATE_SERVICES_BUTTON.getValue()).click();
247 //9. Validate that Service2 can be upgraded (checked), Service3 is locked
248 //TODO - add validation in UI
250 //10. Click Upgrade button
251 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.UPDATE_SERVICES_OK.getValue());
252 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.UPGRADE_SERVICES_CLOSE.getValue());
254 //11. Open VF, verify that version is 2.0
255 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
256 GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
257 VfVerificator.verifyVersionUI("2.0");
259 //12. VF properties assignment - verify that UUID value is updated, other values are the same
260 ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
261 PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(propUUID),serviceUUIDv2);
262 PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(propInvUUID),serviceInvUUID);
263 PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(propName),serviceName);
265 //13. Open Service2, verify version 1.1 and state "in design check in", select VFi, verify version 2.0
266 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
267 GeneralUIUtils.findComponentAndClick(service2.getName());
268 ServiceVerificator.verifyVersionUI("1.1");
269 ServiceVerificator.verifyServiceLifecycleInUI(LifeCycleStateEnum.CHECKIN);
270 ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
271 CanvasManager canvasManager4 = CanvasManager.getCanvasManager();
272 canvasManager4.clickOnCanvaElement(vfElement1);
273 ServiceVerificator.verifyResourceInstanceVersionUI("2.0");
275 //14. Open Service3, select VFi in composition, verify version 1.0
276 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
277 GeneralUIUtils.findComponentAndClick(service3.getName());
278 ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
279 CanvasManager canvasManager5 = CanvasManager.getCanvasManager();
280 canvasManager5.clickOnCanvaElement(vfElement2);
281 ServiceVerificator.verifyResourceInstanceVersionUI("1.0");
285 public void upgradeServiceProxyOnServiceLevel() throws Throwable {
286 //1. Create Port Mirroring Service1, certify
287 PortMirrioringConfigurationObject portMirrioringConfigurationObject = PortMirroringUtils.createPortMirriongConfigurationStructure(true);
288 Service service1 = portMirrioringConfigurationObject.getService();
289 Service serviceSource = portMirrioringConfigurationObject.getServiceContainerVmme_Source();
290 CanvasElement pmcElement = portMirrioringConfigurationObject.getPortMirroringConfigurationElement();
291 CanvasElement sourceElement = portMirrioringConfigurationObject.getServiceElementVmmeSourceName();
292 Map<String, String> capPropValues1 = portMirrioringConfigurationObject.getCapPropValues();
293 certifyServiceInUI(service1);
294 service1 = AtomicOperationUtils.getServiceObject(service1.getUniqueId());
295 String serviceSourceName = portMirrioringConfigurationObject.getServiceElementVmmeSourceName().getElementNameOnCanvas();
296 String sourceUuidOrig = AtomicOperationUtils.getServiceComponentInstanceByName
297 (service1, serviceSourceName,true).getCustomizationUUID();
299 //2. Create Service2, add source service to it
300 Service service2 = createService();
301 CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
302 CanvasManager canvasManager1 = createCanvasManager(service2);
303 CanvasElement serviceSourceElement = canvasManager1.createElementOnCanvas(serviceSource.getName());
305 //3. Checkout and certify serviceSource
306 AtomicOperationUtils.changeComponentState(serviceSource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
307 AtomicOperationUtils.changeComponentState(serviceSource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
308 serviceSource = AtomicOperationUtils.getServiceObject(serviceSource.getUniqueId());
310 //4. Open Service2, click Update button
311 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
312 GeneralUIUtils.findComponentAndClick(serviceSource.getName());
313 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.UPDATE_SERVICES_BUTTON.getValue()).click();
315 //5. Validate that Service1 can be upgraded (checked), Service2 is locked
316 //TODO - add validation in UI
318 //6. Click Upgrade button
319 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.UPDATE_SERVICES_OK.getValue());
320 GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.UPGRADE_SERVICES_CLOSE.getValue());
322 //7. Open Service1, verify version 1.1 and state "in design check in", select VFi, verify version 2.0
323 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
324 GeneralUIUtils.findComponentAndClick(service1.getName());
325 ServiceVerificator.verifyVersionUI("1.1");
326 ServiceVerificator.verifyServiceLifecycleInUI(LifeCycleStateEnum.CHECKIN);
327 ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
328 CanvasManager canvasManager2 = CanvasManager.getCanvasManager();
329 canvasManager2.clickOnCanvaElement(serviceSourceElement);
330 ServiceVerificator.verifyResourceInstanceVersionUI("2.0");
332 //8. Verify that capabilities properties values are kept
333 canvasManager2.openLinkPopupReqsCapsConnection(sourceElement, pmcElement); //open connection wizard
334 Map<String, String> capPropValues2 = canvasManager2.connectionWizardCollectCapPropValues(); //collect cap prop values
335 Assert.assertTrue(capPropValues1.equals(capPropValues2)); // compare cap prop values before and after changing VF version
336 canvasManager2.clickSaveOnLinkPopup();
338 //9. Verify that CustomizationUUID of service source instance is changed
339 service1.setVersion("1.1");//updated
340 service1 = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, service1.getName(), service1.getVersion());
341 String sourceUuidUpd = AtomicOperationUtils.getServiceComponentInstanceByName
342 (service1, serviceSourceName,true).getCustomizationUUID();
343 Assert.assertTrue(!sourceUuidOrig.equals(sourceUuidUpd));
345 //10. Open Service3, select VFi in composition, verify version 1.0
346 GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
347 GeneralUIUtils.findComponentAndClick(service2.getName());
348 ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
349 CanvasManager canvasManager3 = CanvasManager.getCanvasManager();
350 canvasManager3.clickOnCanvaElement(serviceSourceElement);
351 ServiceVerificator.verifyResourceInstanceVersionUI("1.0");
360 private CanvasManager createCanvasManager(Service service1) throws Exception {
361 GeneralUIUtils.findComponentAndClick(service1.getName());
362 ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
363 return CanvasManager.getCanvasManager();
366 private void certifyServiceInUI(Service service1) throws Exception {
367 getExtendTest().log(Status.INFO, "Certify Service");
368 ServiceGeneralPage.clickSubmitForTestingButton(service1.getName());
369 reloginWithNewRole(UserRoleEnum.TESTER);
370 GeneralUIUtils.findComponentAndClick(service1.getName());
371 TesterOperationPage.certifyComponent(service1.getName());
372 reloginWithNewRole(UserRoleEnum.DESIGNER);
375 private Service createService() throws Exception {
376 ServiceReqDetails serviceReqDetails1 = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
377 getExtendTest().log(Status.INFO, "Create Service " + serviceReqDetails1.getName() );
378 return AtomicOperationUtils.createCustomService(serviceReqDetails1, UserRoleEnum.DESIGNER, true).left().value();
381 private ResourceReqDetails createPnfAndCertify() throws Exception {
382 ResourceReqDetails pnfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.PNF, getUser());
383 ResourceUIUtils.createPNF(pnfMetaData, getUser());
384 ResourceGeneralPage.clickCertifyButton(pnfMetaData.getName());
388 private Resource createAndCertifyVFfromVSP(String vnfFile) throws Exception {
389 String filePath = FileHandling.getPortMirroringRepositoryPath();
390 getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
391 AmdocsLicenseMembers amdocsLicenseMembers = VendorLicenseModelRestUtils.createVendorLicense(getUser());
392 ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();//getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
393 VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails, amdocsLicenseMembers, null);
394 resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
395 Resource vfResource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);
396 vfResource = (Resource) AtomicOperationUtils.changeComponentState(vfResource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();
400 private ResourceReqDetails createCRAndCertify() throws Exception {
401 ResourceReqDetails crMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.CR, getUser());
402 ResourceUIUtils.createCR(crMetaData, getUser());
403 ResourceGeneralPage.clickCertifyButton(crMetaData.getName());
407 private ResourceReqDetails createVFviaAPI(ResourceCategoryEnum resourceCategory) {
408 ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, resourceCategory, getUser());
409 SetupCDTest.getExtendTest().log(Status.INFO, String.format("Creating VF %s", vfMetaData.getName()));
410 AtomicOperationUtils.createResourceByResourceDetails(vfMetaData, UserRoleEnum.DESIGNER, true).left().value();
414 protected UserRoleEnum getRole() {
415 return UserRoleEnum.DESIGNER;