Sync Integ to Master
[sdc.git] / ui-ci / src / main / java / org / openecomp / sdc / ci / tests / execute / AmdocsComplexService / CreatePath.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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=========================================================
19  */
20
21 package org.openecomp.sdc.ci.tests.execute.AmdocsComplexService;
22
23 import static org.testng.AssertJUnit.assertNotNull;
24 import static org.testng.AssertJUnit.assertTrue;
25
26 import java.awt.AWTException;
27 import java.io.Console;
28 import java.io.File;
29 import java.io.IOException;
30 import java.util.ArrayList;
31 import java.util.Arrays;
32 import java.util.Collections;
33 import java.util.HashMap;
34 import java.util.List;
35 import java.util.Map;
36 import java.util.stream.Collectors;
37 import java.util.Random;
38 import com.mongodb.util.JSON;
39 import org.apache.commons.lang.RandomStringUtils;
40 import org.json.JSONObject;
41 import org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders;
42 import org.openecomp.sdc.ci.tests.datatypes.*;
43 import org.openecomp.sdc.ci.tests.datatypes.enums.CircleSize;
44 import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
45 import org.openecomp.sdc.ci.tests.execute.sanity.Service;
46 import org.openecomp.sdc.ci.tests.execute.setup.ArtifactsCorrelationManager;
47 import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
48 import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
49 import org.openecomp.sdc.ci.tests.pages.CompositionPage;
50 import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
51 import org.openecomp.sdc.ci.tests.pages.GovernorOperationPage;
52 import org.openecomp.sdc.ci.tests.pages.HomePage;
53 import org.openecomp.sdc.ci.tests.pages.OpsOperationPage;
54 import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
55 import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
56 import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
57 import org.openecomp.sdc.ci.tests.utilities.FileHandling;
58 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
59 import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
60 import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
61 import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
62 import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
63 import org.openqa.selenium.By;
64 import org.openqa.selenium.WebElement;
65 import org.stringtemplate.v4.ST;
66 import org.testng.Assert;
67 import org.testng.AssertJUnit;
68 import org.testng.annotations.BeforeMethod;
69 import org.testng.annotations.DataProvider;
70 import org.testng.annotations.Optional;
71 import org.testng.annotations.Parameters;
72 import org.testng.annotations.Test;
73
74 import com.aventstack.extentreports.Status;
75 import com.clearspring.analytics.util.Pair;
76
77 public class CreatePath extends SetupCDTest {
78
79     protected static String filepath = FileHandling.getVnfRepositoryPath();
80     protected String makeDistributionValue;
81
82     @Parameters({"makeDistribution"})
83     @BeforeMethod
84     public void beforeTestReadParams(@Optional("true") String makeDistributionReadValue) {
85         makeDistributionValue = makeDistributionReadValue;
86     }
87
88     //------------------------------------------Tests-----------------------------------------------------
89
90
91     // Jira issue 5610
92     @Test
93     public void AssertPathButtons() throws Exception, Throwable {
94         filepath = "C:\\Users\\ShiraShe\\Desktop";
95         String vnfFile = "fullComposition.zip";
96         String vspName = getToPathFlow(filepath, vnfFile);
97         reloginWithNewRole(UserRoleEnum.DESIGNER);
98         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
99         ServiceUIUtils.createService(serviceMetadata, getUser());
100         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
101         openCreatePath();
102         AssertCreatePath();
103         AssertExtendPath();
104         //SetupCDTest.getExtendTest().log(Status.INFO, String.format("disables buttons are OK"));
105     }
106
107     // Jira issue 5441
108     @Test
109     public void CreatePathTestSanity() throws Exception, Throwable {
110         filepath = "C:\\Users\\ShiraShe\\Desktop";
111         // List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
112         //String vnfFile = fileNamesFromFolder.get(0).toString();
113         String vnfFile = "fullComposition.zip";
114         String vspName = getToPathFlow(filepath, vnfFile);
115         createPath(vspName);
116     }
117
118     // Jira issue 5611
119     @Test
120     public void CreatePathCheckIO() throws Exception, Throwable {
121         filepath = "C:\\Users\\ShiraShe\\Desktop";
122         // List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
123         //String vnfFile = fileNamesFromFolder.get(0).toString();
124         String vnfFile = "fullComposition.zip";
125
126         // getToPathFlow
127         String vspName = onboardAndCertify(filepath, vnfFile);
128         reloginWithNewRole(UserRoleEnum.DESIGNER);
129
130         // create service
131         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
132         ServiceUIUtils.createService(serviceMetadata, getUser());
133         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
134
135         // create path
136         String pathName = createPath(vspName);
137
138         // @@ check in @@
139         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.LifeCyleChangeButtons.CHECK_IN.getValue());
140         GeneralUIUtils.getWebElementByTestID("checkindialog").sendKeys("check in automated confirmation message");
141         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.OK.getValue());
142         GeneralUIUtils.ultimateWait();
143
144         // go to service composition
145         GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue()).sendKeys(serviceMetadata.getName());
146         getDriver().findElements(By.xpath("//*[@data-tests-id='dashboard-Elements']//*[@data-tests-id='" + serviceMetadata.getName() + "']")).get(0).click();
147         GeneralUIUtils.ultimateWait();
148         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
149
150         AssertCreatedPathExistInCompositionPage(pathName);
151
152         // @@ check out @@
153         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.LifeCyleChangeButtons.CHECKOUT.getValue());
154         GeneralUIUtils.ultimateWait();
155
156         AssertCreatedPathExistInCompositionPage(pathName);
157
158     }
159
160     // Jira issue 5441
161     @Test
162     public void CreateMultiplePaths() throws Exception, Throwable {
163         filepath = "C:\\Users\\ShiraShe\\Desktop";
164         // List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
165         //String vnfFile = fileNamesFromFolder.get(0).toString();
166         String vnfFile = "fullComposition.zip";
167         String vspName = getToPathFlow(filepath, vnfFile);
168         createPath(vspName);
169         createPath(vspName);
170         createPathNumOfRows(7);
171         createPathNumOfRows(6);
172         createPathNumOfRows(4);
173         SetupCDTest.getExtendTest().log(Status.INFO, String.format("multiple paths have been created"));
174     }
175
176     // Jira issue 5506
177     @Test
178     public void CreatePathWithComplex() throws Exception, Throwable {
179         List<String> vnfFiles = new ArrayList<>();
180         vnfFiles.add("fullComposition.zip");
181         vnfFiles.add("fullCompositionNew.zip");
182         filepath = "C:\\Users\\ShiraShe\\Desktop";
183         CreatePathComplexServiceFlow(filepath, vnfFiles);
184         //String vnfFile = "fullComposition.zip";
185        // String vnfFile2 = "fullCompositionNew.zip";
186        // runCreatePathComplexServiceFlow(filepath, vnfFile, vnfFile2);
187         SetupCDTest.getExtendTest().log(Status.INFO, String.format("path with complex service has been created"));
188     }
189
190     // Jira issue 5506
191     @Test
192     public void RealScenarioComplex() throws Exception, Throwable {
193         filepath = "C:\\Users\\ShiraShe\\Desktop\\Srini";
194         List<String> vnfFiles = new ArrayList<>();
195         vnfFiles.add("HSS.zip");
196         vnfFiles.add("VMME.zip");
197         CreatePathComplexServiceFlow(filepath, vnfFiles);
198         ExtentTestActions.addScreenshot(Status.INFO, "Complex service_" + vnfFiles.get(0) ,"Complex service created " + vnfFiles.get(1) + " is as follows : ");
199         SetupCDTest.getExtendTest().log(Status.INFO, String.format("path with complex service has been created"));
200     }
201
202     // Jira issue 5506
203     @Test
204     public void CreateExtendedPathWithComplex() throws Exception, Throwable {
205         filepath = "C:\\Users\\ShiraShe\\Desktop";
206         List<String> vnfFiles = new ArrayList<>();
207         vnfFiles.add("fullComposition.zip");
208         vnfFiles.add("fullCompositionNew.zip");
209         //String vnfFile = "fullComposition.zip";
210         //String vnfFile2 = "fullCompositionNew.zip";
211         String[] services = ToComplexService(filepath, vnfFiles);
212         createComplexExtendedPath(services[0], services[1]);
213         ExtentTestActions.addScreenshot(Status.INFO, "Complex service_" + services[0] ,"Complex service created " + services[1] + " is as follows : ");
214
215     }
216
217     // Jira issue 5441
218     @Test
219     public void CreatePathExtendedTest() throws Exception, Throwable {
220         filepath = "C:\\Users\\ShiraShe\\Desktop";
221         // List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
222         //String vnfFile = fileNamesFromFolder.get(0).toString();
223         String vnfFile = "fullComposition.zip";
224         runCreateExtendedPathFlow(filepath, vnfFile);
225     }
226
227     //create service
228     public ServiceReqDetails createService() throws Exception, AWTException {
229         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
230         ServiceUIUtils.createService(serviceMetadata, getUser());
231         return serviceMetadata;
232     }
233
234     // workflow leading to path
235     public String onboardAndCertify(String filepath, String vnfFile) throws Exception, IOException {
236
237         ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
238         Pair<String, VendorSoftwareProductObject> onboardAndValidate = OnboardingUiUtils.onboardAndValidate(resourceReqDetails,filepath, vnfFile, getUser());
239         String vspName = onboardAndValidate.left;
240
241         DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
242         ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFile ,"The topology template for " + vnfFile + " is as follows : ");
243
244         DeploymentArtifactPage.clickSubmitForTestingButton(vspName);
245         SetupCDTest.getExtendTest().log(Status.INFO, String.format("relogin as TESTER"));
246         reloginWithNewRole(UserRoleEnum.TESTER);
247         GeneralUIUtils.findComponentAndClick(vspName);
248         TesterOperationPage.certifyComponent(vspName);
249         return vspName;
250     }
251
252     public List<String> onboardAndCertifyMultipleVFs(String filepath, List<String> vnfFiles) throws Exception, IOException {
253
254         List<String> VFNames = new ArrayList<>();
255         for(int i = 0; i<vnfFiles.size(); i++)
256         {
257             ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
258             Pair<String, VendorSoftwareProductObject> onboardAndValidate = OnboardingUiUtils.onboardAndValidate(resourceReqDetails,filepath, vnfFiles.get(i), getUser());
259             VFNames.add(i, onboardAndValidate.left);
260             DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
261             ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFiles.get(i) ,"The topology template for " + vnfFiles.get(i) + " is as follows : ");
262             DeploymentArtifactPage.clickSubmitForTestingButton(VFNames.get(i));
263         }
264         SetupCDTest.getExtendTest().log(Status.INFO, String.format("relogin as TESTER"));
265         reloginWithNewRole(UserRoleEnum.TESTER);
266         for (int j = 0; j< VFNames.size(); j++)
267         {
268             GeneralUIUtils.findComponentAndClick(VFNames.get(j));
269             TesterOperationPage.certifyComponent(VFNames.get(j));
270         }
271
272         return VFNames;
273     }
274
275     // path components
276
277     public void AssertCreatePath()  throws Exception, IOException {
278         String check = getDriver().findElements(By.xpath("//*[@data-tests-id='Create']")).get(0).getAttribute("disabled");
279         if (check.intern() != "true")
280         {
281             throw new Exception("Button create path should be disabled. open bug to UI team");
282         }
283     }
284
285     public void AssertCreatedPathExistInCompositionPage(String pathName)  throws Exception, IOException {
286         // check path in the list filter
287         checkPathFilter(pathName, true);
288
289         openPathList();
290
291         // assert path is in the list
292         String PathListName1 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
293         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
294     }
295
296     public void AssertExtendPath()  throws Exception, IOException {
297         String check = getDriver().findElements(By.xpath("//*[@data-tests-id='extendPathlnk']")).get(0).getAttribute("class");
298         if (check.intern() != "disabled")
299         {
300             throw new Exception("Button extend path should be disabled. open bug to UI team");
301         }
302     }
303
304     public void createPathNumOfRows(int numOfPathRows)throws Exception, AWTException{
305         openCreatePath();
306         insertValues("extended" + RandomStringUtils.randomAlphanumeric(8),"pathProtocol1", "pathPortNumbers1");
307         selectFirstLineParam();
308         extendPath(numOfPathRows);
309         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
310     }
311
312     public void linkVFs(String vspName, int linksNum)throws Exception, AWTException {
313
314         CompositionPage.searchForElement(vspName);
315         CanvasManager canvasManager = CanvasManager.getCanvasManager();
316         List <CanvasElement> VFs = new  ArrayList<CanvasElement>();
317
318         VFs.add(canvasManager.createElementOnCanvas(vspName));
319
320         for (int i = 1; i<linksNum; i++)
321         {
322             VFs.add(canvasManager.createElementOnCanvas(vspName));
323             GeneralUIUtils.ultimateWait();
324             canvasManager.linkElements(VFs.get(i), CircleSize.VF, VFs.get(i-1), CircleSize.VF);
325             SetupCDTest.getExtendTest().log(Status.INFO, String.format("link VFs"));
326             GeneralUIUtils.ultimateWait();
327         }
328     }
329
330     public void linkServices(String Service1, String Service2, int linksNum)throws Exception, AWTException {
331
332         CanvasManager canvasManager = CanvasManager.getCanvasManager();
333         List <CanvasElement> VFs = new  ArrayList<CanvasElement>();
334
335         // get first service
336         CompositionPage.searchForElement(Service1);
337         VFs.add(canvasManager.createElementOnCanvas(Service1));
338
339         String service = Service2;
340         for (int i = 1; i<linksNum; i++)
341         {
342             CompositionPage.searchForElement(service);
343             VFs.add(canvasManager.createElementOnCanvas(service));
344             GeneralUIUtils.ultimateWait();
345             canvasManager.linkElements(VFs.get(i), CircleSize.SERVICE, VFs.get(i-1), CircleSize.SERVICE);
346             SetupCDTest.getExtendTest().log(Status.INFO, String.format("link services"));
347             GeneralUIUtils.ultimateWait();
348
349             // change service to link
350             if (service.equals(Service2)) {
351                 service = Service1;
352             }
353             else {
354                 service = Service2;
355             }
356         }
357     }
358
359     public void openCreatePath() throws Exception, AWTException{
360
361         getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
362         GeneralUIUtils.ultimateWait();
363         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_PATH_MENU_BUTTON.getValue());
364     }
365
366     public void openPathList() throws Exception, AWTException {
367         getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
368         GeneralUIUtils.ultimateWait();
369         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
370     }
371
372     public void sendValue(String DataTestId, String value) throws Exception, AWTException {
373
374         GeneralUIUtils.getWebElementByTestID(DataTestId).sendKeys(value);
375         GeneralUIUtils.ultimateWait();
376     }
377
378     public void insertValues(String pathName, String pathProtocol, String pathPortNumbers) throws Exception, AWTException {
379
380         sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue(),pathName);
381         sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_PROTOCOL.getValue(),pathProtocol);
382         sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_PORT_NUMBER.getValue(),pathPortNumbers);
383     }
384
385     public void selectFirstLineParam() throws Exception, AWTException{
386         getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrc']//option")).get(0).click();
387         GeneralUIUtils.ultimateWait();
388         getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrcCP']//option")).get(0).click();
389         GeneralUIUtils.ultimateWait();
390         getDriver().findElements(By.xpath("//*[@data-tests-id='linkTarget']//option")).get(0).click();
391         GeneralUIUtils.ultimateWait();
392         getDriver().findElements(By.xpath("//*[@data-tests-id='linkTargetCP']//option")).get(0).click();
393         GeneralUIUtils.ultimateWait();
394     }
395
396     public void checkPathFilter(String pathName, boolean isFound) throws Exception, AWTException{
397         GeneralUIUtils.ultimateWait();
398         List<WebElement> pathFilterList = getDriver().findElements(By.xpath("//*[@data-tests-id='service-path-selector']//option"));
399         if (isFound) {
400             for (int i = 0; i < pathFilterList.size(); i++) {
401                 String element_text = pathFilterList.get(i).getText();
402                 if (element_text.equals(pathName))
403                 {
404                     break;
405                 }
406                 if (i == pathFilterList.size() -1 )
407                 {
408                     SetupCDTest.getExtendTest().log(Status.INFO, String.format("path list filter check failed"));
409                     throw new Exception("path filter list is missing a path");
410                 }
411             }
412         }
413         else {
414             for (int i = 0; i < pathFilterList.size(); i++) {
415                 String element_text = pathFilterList.get(i).getText();
416                 if (element_text.equals(pathName))
417                 {
418                     SetupCDTest.getExtendTest().log(Status.INFO, String.format("path list filter check failed"));
419                     throw new Exception("path filter list is has a path that should be deleted");
420                 }
421             }
422         }
423         SetupCDTest.getExtendTest().log(Status.INFO, String.format("path list filter check passed"));
424     }
425
426     public void extendPath(int numOfLines) throws Exception, AWTException {
427
428         int i;
429         for (i = 0; i < numOfLines; i++) {
430             String check;
431             String index = Integer.toString(i + 2);
432             GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.EXTEND_BUTTON.getValue());
433             List<WebElement> linkSrcs = getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrc']//select"));
434             List<WebElement> linkSrcCPs = getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrcCP']//select"));
435             List<WebElement> linkTargets = getDriver().findElements(By.xpath("//*[@data-tests-id='linkTarget']//select"));
436             List<WebElement> linkTargetCPs = getDriver().findElements(By.xpath("//*[@data-tests-id='linkTargetCP']//select"));
437
438             for (int j = 0; j < i + 2; j++) {
439                 check = linkSrcs.get(j).getAttribute("class");
440                 if (!check.intern().contains("disabled")) {
441                     throw new Exception("Source should be disabled. open bug to UI team");
442                 }
443                 check = linkSrcCPs.get(j).getAttribute("class");
444                 if (!check.intern().contains("disabled")) {
445                     throw new Exception("Source connection point of last lines should be disabled. open bug to UI team");
446                 }
447             }
448             for (int j = 0; j < i + 1; j++) {
449
450                 check = linkTargets.get(j).getAttribute("class");
451                 if (!check.intern().contains("disabled")) {
452                     throw new Exception("Target of last lines should be disabled. open bug to UI team");
453                 }
454                 check = linkTargetCPs.get(j).getAttribute("class");
455                 if (!check.intern().contains("disabled")) {
456                     throw new Exception("Target connection point of last lines should be disabled. open bug to UI team");
457                 }
458             }
459
460             List <WebElement> choices = getDriver().findElements(By.xpath("//*[" + index + "]/*[@data-tests-id='linkTarget']//option"));
461             choices.get((new Random()).nextInt(choices.size())).click();
462             choices = getDriver().findElements(By.xpath("//*[" + index + "]/*[@data-tests-id='linkTargetCP']//option"));
463             choices.get((new Random()).nextInt(choices.size())).click();
464         }
465     }
466
467     public String editPath(String pathName) throws Exception, AWTException{
468         getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).get(0).click();
469         pathName = "name2";
470         GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue()).clear();
471         sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue(), pathName);
472         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.SAVE.getValue());
473         return pathName;
474     }
475
476     public int deleteLines(int numOfLinesToDelete,int numOfLines)throws Exception, AWTException{
477
478         for (int i=0; i<numOfLinesToDelete; i++){
479             getDriver().findElements(By.xpath("//*[@data-tests-id='removeLnk']//span")).get(0).click();
480             numOfLines--;
481         }
482         if (getDriver().findElements(By.xpath("//*[@data-tests-id='linkTargetCP']//option")).size()>(numOfLines+1))
483         {
484             throw new Exception("Path element was not deleted");
485         }
486         GeneralUIUtils.ultimateWait();
487         return numOfLines;
488     }
489
490     public String getToPathFlow(String filepath, String vnfFile) throws Exception, AWTException {
491
492         String vspName = onboardAndCertify(filepath, vnfFile);
493         reloginWithNewRole(UserRoleEnum.DESIGNER);
494         // create service
495         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
496         ServiceUIUtils.createService(serviceMetadata, getUser());
497         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
498         return vspName;
499     }
500
501     // path scenarios
502
503     public String createPath(String vspName) throws Exception, AWTException {
504
505         linkVFs(vspName, 3);
506         openCreatePath();
507         String pathName = "name1";
508         insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
509         //select path elements
510         selectFirstLineParam();
511         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
512         SetupCDTest.getExtendTest().log(Status.INFO, String.format("path has been created"));
513         return pathName;
514     }
515
516     // flows
517
518     public void createExtendedPath(String vspName) throws Exception, AWTException {
519         //drag and drop VFs and link them
520         linkVFs(vspName, 5);
521
522         //open create path box
523         openCreatePath();
524         String pathName = "name1";
525         insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
526         selectFirstLineParam();
527         //extend path
528         int numOfLines = 3;
529         extendPath(numOfLines);
530         //delete line
531         int numOfLinesToDelete = 1;
532         numOfLines = deleteLines(numOfLinesToDelete, numOfLines);
533         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
534         ExtentTestActions.log(Status.INFO, "path has been created");
535
536         // check that path exist in the path filter list
537         checkPathFilter(pathName, true);
538
539         // check that path exist in the path list
540         getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
541         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
542         String PathListName1 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
543
544         // edit path
545         pathName = editPath(pathName);
546
547         // go back to path's list
548         getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
549         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
550
551         // get name
552         String PathListName2 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
553
554         // assert names changed
555         if (PathListName1.equals(PathListName2))
556         {
557             throw new Exception("path name expected to change after edit but did not");
558         }
559
560         // delete path
561         int paths_before_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
562         getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).get(1).click();
563         GeneralUIUtils.ultimateWait();
564         int paths_after_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
565         if (paths_after_deletion == paths_before_deletion)
566         {
567             throw new Exception("path expected to be deleted but did not");
568         }
569
570         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
571         //ArtifactsCorrelationManager.addVNFtoServiceArtifactCorrelation(serviceMetadata.getName(), vspName);
572         //ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
573         //ExtentTestActions.addScreenshot(Status.INFO, "ServiceComposition_" + vnfFile, "The service topology is as follows: ");
574         //ServiceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
575         SetupCDTest.getExtendTest().log(Status.INFO, String.format("Path has been created"));
576
577         // check that path got deleted in the path filter list
578         checkPathFilter(pathName, false);
579     }
580
581     public void createComplexExtendedPath(String Service1, String Service2) throws Exception, AWTException {
582         //drag and drop Services and link them
583         linkServices(Service1, Service2, 5);
584
585         //-----------------------------------------create path-------------------------------------------------
586
587         //open create path box
588         openCreatePath();
589
590         String pathName = "name1";
591         String pathProtocol = "pathProtocol1";
592         String pathPortNumbers = "pathPortNumbers1";
593
594         insertValues(pathName, pathProtocol, pathPortNumbers);
595
596         //select path parameters
597         selectFirstLineParam();
598         //extend path
599         int numOfLines = 3;
600         extendPath(numOfLines);
601
602         //delete line
603         int numOfLinesToDelete = 1;
604         numOfLines = deleteLines(numOfLinesToDelete, numOfLines);
605         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
606         ExtentTestActions.log(Status.INFO, "path has been created");
607
608         //---------------------------------------check path's list-----------------------------
609
610         // go to path's list
611         openPathList();
612
613         // get name
614         String PathListName1 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
615
616         // edit path
617         pathName = editPath(pathName);
618
619         // go back to path's list
620         getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
621         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
622
623         // get name
624         String PathListName2 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
625
626         // assert names changed
627         if (PathListName1.equals(PathListName2))
628         {
629             throw new Exception("path name expected to change after edit but did not");
630         }
631
632         // delete path
633         int paths_before_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
634         getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).get(1).click();
635         Thread.sleep(1000);
636         int paths_after_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
637         if (paths_after_deletion == paths_before_deletion)
638         {
639             throw new Exception("path expected to be deleted but did not");
640         }
641         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
642         //ArtifactsCorrelationManager.addVNFtoServiceArtifactCorrelation(serviceMetadata.getName(), vspName);
643
644         //assertNotNull(vfElement);
645         //ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
646         //ExtentTestActions.addScreenshot(Status.INFO, "ServiceComposition_" + vnfFile, "The service topology is as follows: ");
647
648         //ServiceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
649         SetupCDTest.getExtendTest().log(Status.INFO, String.format("Path has been created"));
650     }
651
652     public String[] getToComplexService(String filepath, String vnfFile, String vnfFile2) throws Exception, AWTException{
653         // create & certify  2 VF
654         String vspName1 = onboardAndCertify(filepath, vnfFile);
655         reloginWithNewRole(UserRoleEnum.DESIGNER);
656         String vspName2 = onboardAndCertify(filepath, vnfFile2);
657
658         // create service 1
659         reloginWithNewRole(UserRoleEnum.DESIGNER);
660         ServiceReqDetails serviceMetadata1 = createService();
661         // go to composition
662         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
663         // create path
664         createPath(vspName1);
665         getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
666         getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
667         getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
668
669         // create service 2
670         ServiceReqDetails serviceMetadata2 = createService();
671         // go to composition
672         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
673         // create path
674         createPath(vspName2);
675         getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
676         getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
677         getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
678
679         //tester
680         reloginWithNewRole(UserRoleEnum.TESTER);
681         GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
682         TesterOperationPage.certifyComponent(serviceMetadata1.getName());
683         GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
684         TesterOperationPage.certifyComponent(serviceMetadata2.getName());
685
686         //governor
687         reloginWithNewRole(UserRoleEnum.GOVERNOR);
688         GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
689         GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
690         GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
691         GovernorOperationPage.approveSerivce(serviceMetadata2.getName());
692
693         //create service for complex service
694         reloginWithNewRole(UserRoleEnum.DESIGNER);
695         // create service
696         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
697         ServiceUIUtils.createService(serviceMetadata, getUser());
698         // go to composition
699         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
700
701         return new String[]{serviceMetadata1.getName(), serviceMetadata2.getName()};
702     }
703
704     public String[] ToComplexService(String filepath, List<String> vnfFiles) throws Exception, AWTException{
705         // create & certify  2 VF
706         List<String> VFNames = onboardAndCertifyMultipleVFs(filepath, vnfFiles);
707
708         // create service 1
709         reloginWithNewRole(UserRoleEnum.DESIGNER);
710         ServiceReqDetails serviceMetadata1 = createService();
711         // go to composition
712         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
713         // create path
714         createPath(VFNames.get(0));
715         getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
716         getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
717         getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
718         GeneralUIUtils.ultimateWait();;
719
720         // create service 2
721         ServiceReqDetails serviceMetadata2 = createService();
722         GeneralUIUtils.ultimateWait();;
723         // go to composition
724         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
725         // create path
726         createPath(VFNames.get(1));
727         getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
728         getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
729         getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
730
731         //tester
732         reloginWithNewRole(UserRoleEnum.TESTER);
733         GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
734         TesterOperationPage.certifyComponent(serviceMetadata1.getName());
735         GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
736         TesterOperationPage.certifyComponent(serviceMetadata2.getName());
737
738         //governor
739         reloginWithNewRole(UserRoleEnum.GOVERNOR);
740         GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
741         GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
742         GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
743         GovernorOperationPage.approveSerivce(serviceMetadata2.getName());
744
745         //create service for complex service
746         reloginWithNewRole(UserRoleEnum.DESIGNER);
747         // create service
748         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
749         ServiceUIUtils.createService(serviceMetadata, getUser());
750         // go to composition
751         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
752
753         return new String[]{serviceMetadata1.getName(), serviceMetadata2.getName()};
754     }
755
756     public void runCreatePathComplexServiceFlow(String filepath, String vnfFile, String vnfFile2) throws Exception, AWTException {
757         // create & certify  2 VF
758         String vspName1 = onboardAndCertify(filepath, vnfFile);
759         reloginWithNewRole(UserRoleEnum.DESIGNER);
760         String vspName2 = onboardAndCertify(filepath, vnfFile2);
761
762         // create service 1
763         reloginWithNewRole(UserRoleEnum.DESIGNER);
764         ServiceReqDetails serviceMetadata1 = createService();
765         // go to composition
766         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
767         // create path
768         createPath(vspName1);
769         getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
770         getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
771         getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
772
773         // create service 2
774         ServiceReqDetails serviceMetadata2 = createService();
775         // go to composition
776         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
777         // create path
778         createPath(vspName2);
779         getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
780         getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
781         getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
782
783         //tester
784         reloginWithNewRole(UserRoleEnum.TESTER);
785         GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
786         TesterOperationPage.certifyComponent(serviceMetadata1.getName());
787         GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
788         TesterOperationPage.certifyComponent(serviceMetadata2.getName());
789
790         //governor
791         reloginWithNewRole(UserRoleEnum.GOVERNOR);
792         GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
793         GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
794         GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
795         GovernorOperationPage.approveSerivce(serviceMetadata2.getName());
796
797         //create service for complex service
798         reloginWithNewRole(UserRoleEnum.DESIGNER);
799         // create service
800         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
801         ServiceUIUtils.createService(serviceMetadata, getUser());
802         // go to composition
803         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
804         // link services
805         CanvasManager canvasManager = CanvasManager.getCanvasManager();
806         CompositionPage.searchForElement(serviceMetadata1.getName());
807         CanvasElement service1 = canvasManager.createElementOnCanvas(serviceMetadata1.getName());
808         CompositionPage.searchForElement(serviceMetadata2.getName());
809         CanvasElement service2 = canvasManager.createElementOnCanvas(serviceMetadata2.getName());
810         canvasManager.linkElements(service1,CircleSize.SERVICE, service2, CircleSize.SERVICE);
811
812         // create path
813         openCreatePath();
814         insertValues("name1", "pathProtocol1", "pathPortNumbers1");
815         selectFirstLineParam();
816         GeneralUIUtils.getWebElementByTestID("Create").click();
817     }
818
819     public void CreatePathComplexServiceFlow(String filepath, List<String> vnfFiles) throws Exception, AWTException {
820         // create & certify  2 VF
821         List<String> vfNames = onboardAndCertifyMultipleVFs(filepath, vnfFiles);
822
823         // create service 1
824         reloginWithNewRole(UserRoleEnum.DESIGNER);
825         ServiceReqDetails serviceMetadata1 = createService();
826         // go to composition
827         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
828         // create path
829         createPath(vfNames.get(0));
830         getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
831         getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
832         getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
833
834         // create service 2
835         ServiceReqDetails serviceMetadata2 = createService();
836         // go to composition
837         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
838         // create path
839         createPath(vfNames.get(0));
840         getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
841         getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
842         getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
843
844         //tester
845         reloginWithNewRole(UserRoleEnum.TESTER);
846         GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
847         TesterOperationPage.certifyComponent(serviceMetadata1.getName());
848         GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
849         TesterOperationPage.certifyComponent(serviceMetadata2.getName());
850
851         //governor
852         reloginWithNewRole(UserRoleEnum.GOVERNOR);
853         GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
854         GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
855         GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
856         GovernorOperationPage.approveSerivce(serviceMetadata2.getName());
857
858         //create service for complex service
859         reloginWithNewRole(UserRoleEnum.DESIGNER);
860         // create service
861         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
862         ServiceUIUtils.createService(serviceMetadata, getUser());
863         // go to composition
864         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
865         // link services
866         CanvasManager canvasManager = CanvasManager.getCanvasManager();
867         CompositionPage.searchForElement(serviceMetadata1.getName());
868         CanvasElement service1 = canvasManager.createElementOnCanvas(serviceMetadata1.getName());
869         CompositionPage.searchForElement(serviceMetadata2.getName());
870         CanvasElement service2 = canvasManager.createElementOnCanvas(serviceMetadata2.getName());
871         canvasManager.linkElements(service1,CircleSize.SERVICE, service2, CircleSize.SERVICE);
872
873         // create path
874         openCreatePath();
875         insertValues("name1", "pathProtocol1", "pathPortNumbers1");
876         selectFirstLineParam();
877         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
878     }
879
880     public void runCreateExtendedPathFlow(String filepath, String vnfFile) throws Exception, AWTException {
881
882         String vspName = getToPathFlow(filepath, vnfFile);
883
884         //drag and drop VFs and link them
885         linkVFs(vspName, 5);
886
887         //-----------------------------------------create path-------------------------------------------------
888
889         //open create path box
890         openCreatePath();
891         String pathName = "name1";
892         insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
893
894         //select path parameters
895         selectFirstLineParam();
896         //extend path
897         int numOfLines = 3;
898         extendPath(numOfLines);
899
900         //delete line
901         int numOfLinesToDelete = 1;
902         numOfLines = deleteLines(numOfLinesToDelete, numOfLines);
903         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
904         ExtentTestActions.log(Status.INFO, "path has been created");
905
906         // check path is on the list
907         openPathList();
908         String PathListName1 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
909
910         // edit path
911         pathName = editPath(pathName);
912
913         // go back to path's list
914         getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
915         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
916
917         // get name
918         String PathListName2 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
919
920         // assert names changes
921         if (PathListName1.equals(PathListName2))
922         {
923             throw new Exception("path name expected to change after edit but did not");
924         }
925
926         // delete path
927         int paths_before_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
928         getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).get(1).click();
929         GeneralUIUtils.ultimateWait();
930         int paths_after_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
931         if (paths_after_deletion == paths_before_deletion)
932         {
933             throw new Exception("path expected to be deleted but did not");
934         }
935         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
936         //ArtifactsCorrelationManager.addVNFtoServiceArtifactCorrelation(serviceMetadata.getName(), vspName);
937         //ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
938         //ExtentTestActions.addScreenshot(Status.INFO, "ServiceComposition_" + vnfFile, "The service topology is as follows: ");
939         //ServiceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
940         SetupCDTest.getExtendTest().log(Status.INFO, String.format("Path has been created"));
941     }
942
943     public void runCreatePathFlow(String filepath, String vnfFile) throws Exception, AWTException {
944         String vspName = onboardAndCertify(filepath, vnfFile);
945
946         reloginWithNewRole(UserRoleEnum.DESIGNER);
947         // create service
948         ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
949         ServiceUIUtils.createService(serviceMetadata, getUser());
950
951         ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
952
953         CompositionPage.searchForElement(vspName);
954         CanvasManager canvasManager = CanvasManager.getCanvasManager();
955         CanvasElement vfElement1 = canvasManager.createElementOnCanvas(vspName);
956         CanvasElement vfElement2 = canvasManager.createElementOnCanvas(vspName);
957         CanvasElement vfElement3 = canvasManager.createElementOnCanvas(vspName);
958         CanvasElement vfElement4 = canvasManager.createElementOnCanvas(vspName);
959         CanvasElement vfElement5 = canvasManager.createElementOnCanvas(vspName);
960         canvasManager.linkElements(vfElement1, CircleSize.VF, vfElement2, CircleSize.VF);
961         canvasManager.linkElements(vfElement3,CircleSize.VF, vfElement2, CircleSize.VF);
962         canvasManager.linkElements(vfElement3, CircleSize.VF, vfElement4, CircleSize.VF);
963         canvasManager.linkElements(vfElement5, CircleSize.VF, vfElement4, CircleSize.VF);
964         canvasManager.linkElements(vfElement5, CircleSize.VF, vfElement1, CircleSize.VF);
965
966         //create path
967
968         getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
969 //        GeneralUIUtils.getWebElementByTestID("pathsMenuBtn").click();
970         GeneralUIUtils.getWebElementByTestID("createPathMenuItem").click();
971         //insert values
972         GeneralUIUtils.getWebElementByTestID("pathName").sendKeys("name");
973         GeneralUIUtils.getWebElementByTestID("pathProtocol").sendKeys("pathProtocol");
974         GeneralUIUtils.getWebElementByTestID("pathPortNumbers").sendKeys("pathPortNumbers");
975         //select path parameters
976
977         getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrc']//option")).get(0).click();
978         getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrcCP']//option")).get(0).click();
979         getDriver().findElements(By.xpath("//*[@data-tests-id='linkTarget']//option")).get(0).click();
980         getDriver().findElements(By.xpath("//*[@data-tests-id='linkTargetCP']//option")).get(0).click();
981         GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
982
983         //ArtifactsCorrelationManager.addVNFtoServiceArtifactCorrelation(serviceMetadata.getName(), vspName);
984
985         //assertNotNull(vfElement);
986         //ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
987         //ExtentTestActions.addScreenshot(Status.INFO, "ServiceComposition_" + vnfFile, "The service topology is as follows: ");
988
989         //ServiceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
990     }
991
992     @Override
993     protected UserRoleEnum getRole() {
994         return UserRoleEnum.DESIGNER;
995     }
996
997 }