aboutsummaryrefslogtreecommitdiffstats
path: root/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/AmdocsComplexService/CreatePath.java
blob: 66bb693778eea9007879cfd0837c90663c417748 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
/*-
 * ============LICENSE_START=======================================================
 * SDC
 * ================================================================================
 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END=========================================================
 */

package org.openecomp.sdc.ci.tests.execute.AmdocsComplexService;

import static org.testng.AssertJUnit.assertNotNull;
import static org.testng.AssertJUnit.assertTrue;

import java.awt.AWTException;
import java.io.Console;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.Random;
import com.mongodb.util.JSON;
import org.apache.commons.lang.RandomStringUtils;
import org.json.JSONObject;
import org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders;
import org.openecomp.sdc.ci.tests.datatypes.*;
import org.openecomp.sdc.ci.tests.datatypes.enums.CircleSize;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
import org.openecomp.sdc.ci.tests.execute.sanity.Service;
import org.openecomp.sdc.ci.tests.execute.setup.ArtifactsCorrelationManager;
import org.openecomp.sdc.ci.tests.execute.setup.ExtentTestActions;
import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest;
import org.openecomp.sdc.ci.tests.pages.CompositionPage;
import org.openecomp.sdc.ci.tests.pages.DeploymentArtifactPage;
import org.openecomp.sdc.ci.tests.pages.GovernorOperationPage;
import org.openecomp.sdc.ci.tests.pages.HomePage;
import org.openecomp.sdc.ci.tests.pages.OpsOperationPage;
import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
import org.openecomp.sdc.ci.tests.pages.ServiceGeneralPage;
import org.openecomp.sdc.ci.tests.pages.TesterOperationPage;
import org.openecomp.sdc.ci.tests.utilities.FileHandling;
import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
import org.openecomp.sdc.ci.tests.utilities.ServiceUIUtils;
import org.openecomp.sdc.ci.tests.utilities.OnboardingUiUtils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
import org.openecomp.sdc.ci.tests.verificator.ServiceVerificator;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.stringtemplate.v4.ST;
import org.testng.Assert;
import org.testng.AssertJUnit;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Optional;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

import com.aventstack.extentreports.Status;
import com.clearspring.analytics.util.Pair;

public class CreatePath extends SetupCDTest {

    protected static String filepath = FileHandling.getVnfRepositoryPath();
    protected String makeDistributionValue;

    @Parameters({"makeDistribution"})
    @BeforeMethod
    public void beforeTestReadParams(@Optional("true") String makeDistributionReadValue) {
        makeDistributionValue = makeDistributionReadValue;
    }

    //------------------------------------------Tests-----------------------------------------------------


    // Jira issue 5610
    @Test
    public void AssertPathButtons() throws Exception, Throwable {
        filepath = "C:\\Users\\ShiraShe\\Desktop";
        String vnfFile = "fullComposition.zip";
        String vspName = getToPathFlow(filepath, vnfFile);
        reloginWithNewRole(UserRoleEnum.DESIGNER);
        ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
        ServiceUIUtils.createService(serviceMetadata, getUser());
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
        openCreatePath();
        AssertCreatePath();
        AssertExtendPath();
        //SetupCDTest.getExtendTest().log(Status.INFO, String.format("disables buttons are OK"));
    }

    // Jira issue 5441
    @Test
    public void CreatePathTestSanity() throws Exception, Throwable {
        filepath = "C:\\Users\\ShiraShe\\Desktop";
        // List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
        //String vnfFile = fileNamesFromFolder.get(0).toString();
        String vnfFile = "fullComposition.zip";
        String vspName = getToPathFlow(filepath, vnfFile);
        createPath(vspName);
    }

    // Jira issue 5611
    @Test
    public void CreatePathCheckIO() throws Exception, Throwable {
        filepath = "C:\\Users\\ShiraShe\\Desktop";
        // List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
        //String vnfFile = fileNamesFromFolder.get(0).toString();
        String vnfFile = "fullComposition.zip";

        // getToPathFlow
        String vspName = onboardAndCertify(filepath, vnfFile);
        reloginWithNewRole(UserRoleEnum.DESIGNER);

        // create service
        ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
        ServiceUIUtils.createService(serviceMetadata, getUser());
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();

        // create path
        String pathName = createPath(vspName);

        // @@ check in @@
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.LifeCyleChangeButtons.CHECK_IN.getValue());
        GeneralUIUtils.getWebElementByTestID("checkindialog").sendKeys("check in automated confirmation message");
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ModalItems.OK.getValue());
        GeneralUIUtils.ultimateWait();

        // go to service composition
        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtons.SEARCH_BOX.getValue()).sendKeys(serviceMetadata.getName());
        getDriver().findElements(By.xpath("//*[@data-tests-id='dashboard-Elements']//*[@data-tests-id='" + serviceMetadata.getName() + "']")).get(0).click();
        GeneralUIUtils.ultimateWait();
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();

        AssertCreatedPathExistInCompositionPage(pathName);

        // @@ check out @@
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.LifeCyleChangeButtons.CHECKOUT.getValue());
        GeneralUIUtils.ultimateWait();

        AssertCreatedPathExistInCompositionPage(pathName);

    }

    // Jira issue 5441
    @Test
    public void CreateMultiplePaths() throws Exception, Throwable {
        filepath = "C:\\Users\\ShiraShe\\Desktop";
        // List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
        //String vnfFile = fileNamesFromFolder.get(0).toString();
        String vnfFile = "fullComposition.zip";
        String vspName = getToPathFlow(filepath, vnfFile);
        createPath(vspName);
        createPath(vspName);
        createPathNumOfRows(7);
        createPathNumOfRows(6);
        createPathNumOfRows(4);
        SetupCDTest.getExtendTest().log(Status.INFO, String.format("multiple paths have been created"));
    }

    // Jira issue 5506
    @Test
    public void CreatePathWithComplex() throws Exception, Throwable {
        List<String> vnfFiles = new ArrayList<>();
        vnfFiles.add("fullComposition.zip");
        vnfFiles.add("fullCompositionNew.zip");
        filepath = "C:\\Users\\ShiraShe\\Desktop";
        CreatePathComplexServiceFlow(filepath, vnfFiles);
        //String vnfFile = "fullComposition.zip";
       // String vnfFile2 = "fullCompositionNew.zip";
       // runCreatePathComplexServiceFlow(filepath, vnfFile, vnfFile2);
        SetupCDTest.getExtendTest().log(Status.INFO, String.format("path with complex service has been created"));
    }

    // Jira issue 5506
    @Test
    public void RealScenarioComplex() throws Exception, Throwable {
        filepath = "C:\\Users\\ShiraShe\\Desktop\\Srini";
        List<String> vnfFiles = new ArrayList<>();
        vnfFiles.add("HSS.zip");
        vnfFiles.add("VMME.zip");
        CreatePathComplexServiceFlow(filepath, vnfFiles);
        ExtentTestActions.addScreenshot(Status.INFO, "Complex service_" + vnfFiles.get(0) ,"Complex service created " + vnfFiles.get(1) + " is as follows : ");
        SetupCDTest.getExtendTest().log(Status.INFO, String.format("path with complex service has been created"));
    }

    // Jira issue 5506
    @Test
    public void CreateExtendedPathWithComplex() throws Exception, Throwable {
        filepath = "C:\\Users\\ShiraShe\\Desktop";
        List<String> vnfFiles = new ArrayList<>();
        vnfFiles.add("fullComposition.zip");
        vnfFiles.add("fullCompositionNew.zip");
        //String vnfFile = "fullComposition.zip";
        //String vnfFile2 = "fullCompositionNew.zip";
        String[] services = ToComplexService(filepath, vnfFiles);
        createComplexExtendedPath(services[0], services[1]);
        ExtentTestActions.addScreenshot(Status.INFO, "Complex service_" + services[0] ,"Complex service created " + services[1] + " is as follows : ");

    }

    // Jira issue 5441
    @Test
    public void CreatePathExtendedTest() throws Exception, Throwable {
        filepath = "C:\\Users\\ShiraShe\\Desktop";
        // List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList();
        //String vnfFile = fileNamesFromFolder.get(0).toString();
        String vnfFile = "fullComposition.zip";
        runCreateExtendedPathFlow(filepath, vnfFile);
    }

    //create service
    public ServiceReqDetails createService() throws Exception, AWTException {
        ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
        ServiceUIUtils.createService(serviceMetadata, getUser());
        return serviceMetadata;
    }

    // workflow leading to path
    public String onboardAndCertify(String filepath, String vnfFile) throws Exception, IOException {

        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
        Pair<String, VendorSoftwareProductObject> onboardAndValidate = OnboardingUiUtils.onboardAndValidate(resourceReqDetails,filepath, vnfFile, getUser());
        String vspName = onboardAndValidate.left;

        DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
        ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFile ,"The topology template for " + vnfFile + " is as follows : ");

        DeploymentArtifactPage.clickSubmitForTestingButton(vspName);
        SetupCDTest.getExtendTest().log(Status.INFO, String.format("relogin as TESTER"));
        reloginWithNewRole(UserRoleEnum.TESTER);
        GeneralUIUtils.findComponentAndClick(vspName);
        TesterOperationPage.certifyComponent(vspName);
        return vspName;
    }

    public List<String> onboardAndCertifyMultipleVFs(String filepath, List<String> vnfFiles) throws Exception, IOException {

        List<String> VFNames = new ArrayList<>();
        for(int i = 0; i<vnfFiles.size(); i++)
        {
            ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource();
            Pair<String, VendorSoftwareProductObject> onboardAndValidate = OnboardingUiUtils.onboardAndValidate(resourceReqDetails,filepath, vnfFiles.get(i), getUser());
            VFNames.add(i, onboardAndValidate.left);
            DeploymentArtifactPage.getLeftPanel().moveToCompositionScreen();
            ExtentTestActions.addScreenshot(Status.INFO, "TopologyTemplate_" + vnfFiles.get(i) ,"The topology template for " + vnfFiles.get(i) + " is as follows : ");
            DeploymentArtifactPage.clickSubmitForTestingButton(VFNames.get(i));
        }
        SetupCDTest.getExtendTest().log(Status.INFO, String.format("relogin as TESTER"));
        reloginWithNewRole(UserRoleEnum.TESTER);
        for (int j = 0; j< VFNames.size(); j++)
        {
            GeneralUIUtils.findComponentAndClick(VFNames.get(j));
            TesterOperationPage.certifyComponent(VFNames.get(j));
        }

        return VFNames;
    }

    // path components

    public void AssertCreatePath()  throws Exception, IOException {
        String check = getDriver().findElements(By.xpath("//*[@data-tests-id='Create']")).get(0).getAttribute("disabled");
        if (check.intern() != "true")
        {
            throw new Exception("Button create path should be disabled. open bug to UI team");
        }
    }

    public void AssertCreatedPathExistInCompositionPage(String pathName)  throws Exception, IOException {
        // check path in the list filter
        checkPathFilter(pathName, true);

        openPathList();

        // assert path is in the list
        String PathListName1 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
    }

    public void AssertExtendPath()  throws Exception, IOException {
        String check = getDriver().findElements(By.xpath("//*[@data-tests-id='extendPathlnk']")).get(0).getAttribute("class");
        if (check.intern() != "disabled")
        {
            throw new Exception("Button extend path should be disabled. open bug to UI team");
        }
    }

    public void createPathNumOfRows(int numOfPathRows)throws Exception, AWTException{
        openCreatePath();
        insertValues("extended" + RandomStringUtils.randomAlphanumeric(8),"pathProtocol1", "pathPortNumbers1");
        selectFirstLineParam();
        extendPath(numOfPathRows);
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
    }

    public void linkVFs(String vspName, int linksNum)throws Exception, AWTException {

        CompositionPage.searchForElement(vspName);
        CanvasManager canvasManager = CanvasManager.getCanvasManager();
        List <CanvasElement> VFs = new  ArrayList<CanvasElement>();

        VFs.add(canvasManager.createElementOnCanvas(vspName));

        for (int i = 1; i<linksNum; i++)
        {
            VFs.add(canvasManager.createElementOnCanvas(vspName));
            GeneralUIUtils.ultimateWait();
            canvasManager.linkElements(VFs.get(i), CircleSize.VF, VFs.get(i-1), CircleSize.VF);
            SetupCDTest.getExtendTest().log(Status.INFO, String.format("link VFs"));
            GeneralUIUtils.ultimateWait();
        }
    }

    public void linkServices(String Service1, String Service2, int linksNum)throws Exception, AWTException {

        CanvasManager canvasManager = CanvasManager.getCanvasManager();
        List <CanvasElement> VFs = new  ArrayList<CanvasElement>();

        // get first service
        CompositionPage.searchForElement(Service1);
        VFs.add(canvasManager.createElementOnCanvas(Service1));

        String service = Service2;
        for (int i = 1; i<linksNum; i++)
        {
            CompositionPage.searchForElement(service);
            VFs.add(canvasManager.createElementOnCanvas(service));
            GeneralUIUtils.ultimateWait();
            canvasManager.linkElements(VFs.get(i), CircleSize.SERVICE, VFs.get(i-1), CircleSize.SERVICE);
            SetupCDTest.getExtendTest().log(Status.INFO, String.format("link services"));
            GeneralUIUtils.ultimateWait();

            // change service to link
            if (service.equals(Service2)) {
                service = Service1;
            }
            else {
                service = Service2;
            }
        }
    }

    public void openCreatePath() throws Exception, AWTException{

        getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
        GeneralUIUtils.ultimateWait();
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_PATH_MENU_BUTTON.getValue());
    }

    public void openPathList() throws Exception, AWTException {
        getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
        GeneralUIUtils.ultimateWait();
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
    }

    public void sendValue(String DataTestId, String value) throws Exception, AWTException {

        GeneralUIUtils.getWebElementByTestID(DataTestId).sendKeys(value);
        GeneralUIUtils.ultimateWait();
    }

    public void insertValues(String pathName, String pathProtocol, String pathPortNumbers) throws Exception, AWTException {

        sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue(),pathName);
        sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_PROTOCOL.getValue(),pathProtocol);
        sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_PORT_NUMBER.getValue(),pathPortNumbers);
    }

    public void selectFirstLineParam() throws Exception, AWTException{
        getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrc']//option")).get(0).click();
        GeneralUIUtils.ultimateWait();
        getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrcCP']//option")).get(0).click();
        GeneralUIUtils.ultimateWait();
        getDriver().findElements(By.xpath("//*[@data-tests-id='linkTarget']//option")).get(0).click();
        GeneralUIUtils.ultimateWait();
        getDriver().findElements(By.xpath("//*[@data-tests-id='linkTargetCP']//option")).get(0).click();
        GeneralUIUtils.ultimateWait();
    }

    public void checkPathFilter(String pathName, boolean isFound) throws Exception, AWTException{
        GeneralUIUtils.ultimateWait();
        List<WebElement> pathFilterList = getDriver().findElements(By.xpath("//*[@data-tests-id='service-path-selector']//option"));
        if (isFound) {
            for (int i = 0; i < pathFilterList.size(); i++) {
                String element_text = pathFilterList.get(i).getText();
                if (element_text.equals(pathName))
                {
                    break;
                }
                if (i == pathFilterList.size() -1 )
                {
                    SetupCDTest.getExtendTest().log(Status.INFO, String.format("path list filter check failed"));
                    throw new Exception("path filter list is missing a path");
                }
            }
        }
        else {
            for (int i = 0; i < pathFilterList.size(); i++) {
                String element_text = pathFilterList.get(i).getText();
                if (element_text.equals(pathName))
                {
                    SetupCDTest.getExtendTest().log(Status.INFO, String.format("path list filter check failed"));
                    throw new Exception("path filter list is has a path that should be deleted");
                }
            }
        }
        SetupCDTest.getExtendTest().log(Status.INFO, String.format("path list filter check passed"));
    }

    public void extendPath(int numOfLines) throws Exception, AWTException {

        int i;
        for (i = 0; i < numOfLines; i++) {
            String check;
            String index = Integer.toString(i + 2);
            GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.EXTEND_BUTTON.getValue());
            List<WebElement> linkSrcs = getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrc']//select"));
            List<WebElement> linkSrcCPs = getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrcCP']//select"));
            List<WebElement> linkTargets = getDriver().findElements(By.xpath("//*[@data-tests-id='linkTarget']//select"));
            List<WebElement> linkTargetCPs = getDriver().findElements(By.xpath("//*[@data-tests-id='linkTargetCP']//select"));

            for (int j = 0; j < i + 2; j++) {
                check = linkSrcs.get(j).getAttribute("class");
                if (!check.intern().contains("disabled")) {
                    throw new Exception("Source should be disabled. open bug to UI team");
                }
                check = linkSrcCPs.get(j).getAttribute("class");
                if (!check.intern().contains("disabled")) {
                    throw new Exception("Source connection point of last lines should be disabled. open bug to UI team");
                }
            }
            for (int j = 0; j < i + 1; j++) {

                check = linkTargets.get(j).getAttribute("class");
                if (!check.intern().contains("disabled")) {
                    throw new Exception("Target of last lines should be disabled. open bug to UI team");
                }
                check = linkTargetCPs.get(j).getAttribute("class");
                if (!check.intern().contains("disabled")) {
                    throw new Exception("Target connection point of last lines should be disabled. open bug to UI team");
                }
            }

            List <WebElement> choices = getDriver().findElements(By.xpath("//*[" + index + "]/*[@data-tests-id='linkTarget']//option"));
            choices.get((new Random()).nextInt(choices.size())).click();
            choices = getDriver().findElements(By.xpath("//*[" + index + "]/*[@data-tests-id='linkTargetCP']//option"));
            choices.get((new Random()).nextInt(choices.size())).click();
        }
    }

    public String editPath(String pathName) throws Exception, AWTException{
        getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).get(0).click();
        pathName = "name2";
        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue()).clear();
        sendValue(DataTestIdEnum.ComplexServiceAmdocs.PATH_NAME.getValue(), pathName);
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.SAVE.getValue());
        return pathName;
    }

    public int deleteLines(int numOfLinesToDelete,int numOfLines)throws Exception, AWTException{

        for (int i=0; i<numOfLinesToDelete; i++){
            getDriver().findElements(By.xpath("//*[@data-tests-id='removeLnk']//span")).get(0).click();
            numOfLines--;
        }
        if (getDriver().findElements(By.xpath("//*[@data-tests-id='linkTargetCP']//option")).size()>(numOfLines+1))
        {
            throw new Exception("Path element was not deleted");
        }
        GeneralUIUtils.ultimateWait();
        return numOfLines;
    }

    public String getToPathFlow(String filepath, String vnfFile) throws Exception, AWTException {

        String vspName = onboardAndCertify(filepath, vnfFile);
        reloginWithNewRole(UserRoleEnum.DESIGNER);
        // create service
        ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
        ServiceUIUtils.createService(serviceMetadata, getUser());
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
        return vspName;
    }

    // path scenarios

    public String createPath(String vspName) throws Exception, AWTException {

        linkVFs(vspName, 3);
        openCreatePath();
        String pathName = "name1";
        insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
        //select path elements
        selectFirstLineParam();
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
        SetupCDTest.getExtendTest().log(Status.INFO, String.format("path has been created"));
        return pathName;
    }

    // flows

    public void createExtendedPath(String vspName) throws Exception, AWTException {
        //drag and drop VFs and link them
        linkVFs(vspName, 5);

        //open create path box
        openCreatePath();
        String pathName = "name1";
        insertValues(pathName, "pathProtocol1", "pathPortNumbers1");
        selectFirstLineParam();
        //extend path
        int numOfLines = 3;
        extendPath(numOfLines);
        //delete line
        int numOfLinesToDelete = 1;
        numOfLines = deleteLines(numOfLinesToDelete, numOfLines);
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
        ExtentTestActions.log(Status.INFO, "path has been created");

        // check that path exist in the path filter list
        checkPathFilter(pathName, true);

        // check that path exist in the path list
        getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());
        String PathListName1 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();

        // edit path
        pathName = editPath(pathName);

        // go back to path's list
        getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());

        // get name
        String PathListName2 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();

        // assert names changed
        if (PathListName1.equals(PathListName2))
        {
            throw new Exception("path name expected to change after edit but did not");
        }

        // delete path
        int paths_before_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
        getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).get(1).click();
        GeneralUIUtils.ultimateWait();
        int paths_after_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
        if (paths_after_deletion == paths_before_deletion)
        {
            throw new Exception("path expected to be deleted but did not");
        }

        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
        //ArtifactsCorrelationManager.addVNFtoServiceArtifactCorrelation(serviceMetadata.getName(), vspName);
        //ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
        //ExtentTestActions.addScreenshot(Status.INFO, "ServiceComposition_" + vnfFile, "The service topology is as follows: ");
        //ServiceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Path has been created"));

        // check that path got deleted in the path filter list
        checkPathFilter(pathName, false);
    }

    public void createComplexExtendedPath(String Service1, String Service2) throws Exception, AWTException {
        //drag and drop Services and link them
        linkServices(Service1, Service2, 5);

        //-----------------------------------------create path-------------------------------------------------

        //open create path box
        openCreatePath();

        String pathName = "name1";
        String pathProtocol = "pathProtocol1";
        String pathPortNumbers = "pathPortNumbers1";

        insertValues(pathName, pathProtocol, pathPortNumbers);

        //select path parameters
        selectFirstLineParam();
        //extend path
        int numOfLines = 3;
        extendPath(numOfLines);

        //delete line
        int numOfLinesToDelete = 1;
        numOfLines = deleteLines(numOfLinesToDelete, numOfLines);
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
        ExtentTestActions.log(Status.INFO, "path has been created");

        //---------------------------------------check path's list-----------------------------

        // go to path's list
        openPathList();

        // get name
        String PathListName1 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();

        // edit path
        pathName = editPath(pathName);

        // go back to path's list
        getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());

        // get name
        String PathListName2 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();

        // assert names changed
        if (PathListName1.equals(PathListName2))
        {
            throw new Exception("path name expected to change after edit but did not");
        }

        // delete path
        int paths_before_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
        getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).get(1).click();
        Thread.sleep(1000);
        int paths_after_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
        if (paths_after_deletion == paths_before_deletion)
        {
            throw new Exception("path expected to be deleted but did not");
        }
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
        //ArtifactsCorrelationManager.addVNFtoServiceArtifactCorrelation(serviceMetadata.getName(), vspName);

        //assertNotNull(vfElement);
        //ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
        //ExtentTestActions.addScreenshot(Status.INFO, "ServiceComposition_" + vnfFile, "The service topology is as follows: ");

        //ServiceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Path has been created"));
    }

    public String[] getToComplexService(String filepath, String vnfFile, String vnfFile2) throws Exception, AWTException{
        // create & certify  2 VF
        String vspName1 = onboardAndCertify(filepath, vnfFile);
        reloginWithNewRole(UserRoleEnum.DESIGNER);
        String vspName2 = onboardAndCertify(filepath, vnfFile2);

        // create service 1
        reloginWithNewRole(UserRoleEnum.DESIGNER);
        ServiceReqDetails serviceMetadata1 = createService();
        // go to composition
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
        // create path
        createPath(vspName1);
        getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
        getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
        getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();

        // create service 2
        ServiceReqDetails serviceMetadata2 = createService();
        // go to composition
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
        // create path
        createPath(vspName2);
        getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
        getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
        getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();

        //tester
        reloginWithNewRole(UserRoleEnum.TESTER);
        GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
        TesterOperationPage.certifyComponent(serviceMetadata1.getName());
        GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
        TesterOperationPage.certifyComponent(serviceMetadata2.getName());

        //governor
        reloginWithNewRole(UserRoleEnum.GOVERNOR);
        GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
        GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
        GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
        GovernorOperationPage.approveSerivce(serviceMetadata2.getName());

        //create service for complex service
        reloginWithNewRole(UserRoleEnum.DESIGNER);
        // create service
        ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
        ServiceUIUtils.createService(serviceMetadata, getUser());
        // go to composition
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();

        return new String[]{serviceMetadata1.getName(), serviceMetadata2.getName()};
    }

    public String[] ToComplexService(String filepath, List<String> vnfFiles) throws Exception, AWTException{
        // create & certify  2 VF
        List<String> VFNames = onboardAndCertifyMultipleVFs(filepath, vnfFiles);

        // create service 1
        reloginWithNewRole(UserRoleEnum.DESIGNER);
        ServiceReqDetails serviceMetadata1 = createService();
        // go to composition
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
        // create path
        createPath(VFNames.get(0));
        getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
        getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
        getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();
        GeneralUIUtils.ultimateWait();;

        // create service 2
        ServiceReqDetails serviceMetadata2 = createService();
        GeneralUIUtils.ultimateWait();;
        // go to composition
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
        // create path
        createPath(VFNames.get(1));
        getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
        getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
        getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();

        //tester
        reloginWithNewRole(UserRoleEnum.TESTER);
        GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
        TesterOperationPage.certifyComponent(serviceMetadata1.getName());
        GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
        TesterOperationPage.certifyComponent(serviceMetadata2.getName());

        //governor
        reloginWithNewRole(UserRoleEnum.GOVERNOR);
        GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
        GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
        GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
        GovernorOperationPage.approveSerivce(serviceMetadata2.getName());

        //create service for complex service
        reloginWithNewRole(UserRoleEnum.DESIGNER);
        // create service
        ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
        ServiceUIUtils.createService(serviceMetadata, getUser());
        // go to composition
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();

        return new String[]{serviceMetadata1.getName(), serviceMetadata2.getName()};
    }

    public void runCreatePathComplexServiceFlow(String filepath, String vnfFile, String vnfFile2) throws Exception, AWTException {
        // create & certify  2 VF
        String vspName1 = onboardAndCertify(filepath, vnfFile);
        reloginWithNewRole(UserRoleEnum.DESIGNER);
        String vspName2 = onboardAndCertify(filepath, vnfFile2);

        // create service 1
        reloginWithNewRole(UserRoleEnum.DESIGNER);
        ServiceReqDetails serviceMetadata1 = createService();
        // go to composition
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
        // create path
        createPath(vspName1);
        getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
        getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
        getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();

        // create service 2
        ServiceReqDetails serviceMetadata2 = createService();
        // go to composition
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
        // create path
        createPath(vspName2);
        getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
        getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
        getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();

        //tester
        reloginWithNewRole(UserRoleEnum.TESTER);
        GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
        TesterOperationPage.certifyComponent(serviceMetadata1.getName());
        GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
        TesterOperationPage.certifyComponent(serviceMetadata2.getName());

        //governor
        reloginWithNewRole(UserRoleEnum.GOVERNOR);
        GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
        GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
        GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
        GovernorOperationPage.approveSerivce(serviceMetadata2.getName());

        //create service for complex service
        reloginWithNewRole(UserRoleEnum.DESIGNER);
        // create service
        ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
        ServiceUIUtils.createService(serviceMetadata, getUser());
        // go to composition
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
        // link services
        CanvasManager canvasManager = CanvasManager.getCanvasManager();
        CompositionPage.searchForElement(serviceMetadata1.getName());
        CanvasElement service1 = canvasManager.createElementOnCanvas(serviceMetadata1.getName());
        CompositionPage.searchForElement(serviceMetadata2.getName());
        CanvasElement service2 = canvasManager.createElementOnCanvas(serviceMetadata2.getName());
        canvasManager.linkElements(service1,CircleSize.SERVICE, service2, CircleSize.SERVICE);

        // create path
        openCreatePath();
        insertValues("name1", "pathProtocol1", "pathPortNumbers1");
        selectFirstLineParam();
        GeneralUIUtils.getWebElementByTestID("Create").click();
    }

    public void CreatePathComplexServiceFlow(String filepath, List<String> vnfFiles) throws Exception, AWTException {
        // create & certify  2 VF
        List<String> vfNames = onboardAndCertifyMultipleVFs(filepath, vnfFiles);

        // create service 1
        reloginWithNewRole(UserRoleEnum.DESIGNER);
        ServiceReqDetails serviceMetadata1 = createService();
        // go to composition
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
        // create path
        createPath(vfNames.get(0));
        getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
        getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
        getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();

        // create service 2
        ServiceReqDetails serviceMetadata2 = createService();
        // go to composition
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
        // create path
        createPath(vfNames.get(0));
        getDriver().findElements(By.xpath("//*[@data-tests-id='submit_for_testing']")).get(0).click();
        getDriver().findElements(By.xpath("//*[@data-tests-id='changeLifeCycleMessage']")).get(0).sendKeys("new Service to test");
        getDriver().findElements(By.xpath("//*[@data-tests-id='OK']")).get(0).click();

        //tester
        reloginWithNewRole(UserRoleEnum.TESTER);
        GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
        TesterOperationPage.certifyComponent(serviceMetadata1.getName());
        GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
        TesterOperationPage.certifyComponent(serviceMetadata2.getName());

        //governor
        reloginWithNewRole(UserRoleEnum.GOVERNOR);
        GeneralUIUtils.findComponentAndClick(serviceMetadata1.getName());
        GovernorOperationPage.approveSerivce(serviceMetadata1.getName());
        GeneralUIUtils.findComponentAndClick(serviceMetadata2.getName());
        GovernorOperationPage.approveSerivce(serviceMetadata2.getName());

        //create service for complex service
        reloginWithNewRole(UserRoleEnum.DESIGNER);
        // create service
        ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
        ServiceUIUtils.createService(serviceMetadata, getUser());
        // go to composition
        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();
        // link services
        CanvasManager canvasManager = CanvasManager.getCanvasManager();
        CompositionPage.searchForElement(serviceMetadata1.getName());
        CanvasElement service1 = canvasManager.createElementOnCanvas(serviceMetadata1.getName());
        CompositionPage.searchForElement(serviceMetadata2.getName());
        CanvasElement service2 = canvasManager.createElementOnCanvas(serviceMetadata2.getName());
        canvasManager.linkElements(service1,CircleSize.SERVICE, service2, CircleSize.SERVICE);

        // create path
        openCreatePath();
        insertValues("name1", "pathProtocol1", "pathPortNumbers1");
        selectFirstLineParam();
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
    }

    public void runCreateExtendedPathFlow(String filepath, String vnfFile) throws Exception, AWTException {

        String vspName = getToPathFlow(filepath, vnfFile);

        //drag and drop VFs and link them
        linkVFs(vspName, 5);

        //-----------------------------------------create path-------------------------------------------------

        //open create path box
        openCreatePath();
        String pathName = "name1";
        insertValues(pathName, "pathProtocol1", "pathPortNumbers1");

        //select path parameters
        selectFirstLineParam();
        //extend path
        int numOfLines = 3;
        extendPath(numOfLines);

        //delete line
        int numOfLinesToDelete = 1;
        numOfLines = deleteLines(numOfLinesToDelete, numOfLines);
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());
        ExtentTestActions.log(Status.INFO, "path has been created");

        // check path is on the list
        openPathList();
        String PathListName1 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();

        // edit path
        pathName = editPath(pathName);

        // go back to path's list
        getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.PATH_LIST_BUTTON.getValue());

        // get name
        String PathListName2 = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']")).get(0).getText();

        // assert names changes
        if (PathListName1.equals(PathListName2))
        {
            throw new Exception("path name expected to change after edit but did not");
        }

        // delete path
        int paths_before_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
        getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).get(1).click();
        GeneralUIUtils.ultimateWait();
        int paths_after_deletion = getDriver().findElements(By.xpath("//*[text()='"+pathName+"']/parent::*//span")).size();
        if (paths_after_deletion == paths_before_deletion)
        {
            throw new Exception("path expected to be deleted but did not");
        }
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.PropertiesAssignmentScreen.INPUT_DELETE_DIALOG_CLOSE.getValue());
        //ArtifactsCorrelationManager.addVNFtoServiceArtifactCorrelation(serviceMetadata.getName(), vspName);
        //ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
        //ExtentTestActions.addScreenshot(Status.INFO, "ServiceComposition_" + vnfFile, "The service topology is as follows: ");
        //ServiceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Path has been created"));
    }

    public void runCreatePathFlow(String filepath, String vnfFile) throws Exception, AWTException {
        String vspName = onboardAndCertify(filepath, vnfFile);

        reloginWithNewRole(UserRoleEnum.DESIGNER);
        // create service
        ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService();
        ServiceUIUtils.createService(serviceMetadata, getUser());

        ServiceGeneralPage.getLeftMenu().moveToCompositionScreen();

        CompositionPage.searchForElement(vspName);
        CanvasManager canvasManager = CanvasManager.getCanvasManager();
        CanvasElement vfElement1 = canvasManager.createElementOnCanvas(vspName);
        CanvasElement vfElement2 = canvasManager.createElementOnCanvas(vspName);
        CanvasElement vfElement3 = canvasManager.createElementOnCanvas(vspName);
        CanvasElement vfElement4 = canvasManager.createElementOnCanvas(vspName);
        CanvasElement vfElement5 = canvasManager.createElementOnCanvas(vspName);
        canvasManager.linkElements(vfElement1, CircleSize.VF, vfElement2, CircleSize.VF);
        canvasManager.linkElements(vfElement3,CircleSize.VF, vfElement2, CircleSize.VF);
        canvasManager.linkElements(vfElement3, CircleSize.VF, vfElement4, CircleSize.VF);
        canvasManager.linkElements(vfElement5, CircleSize.VF, vfElement4, CircleSize.VF);
        canvasManager.linkElements(vfElement5, CircleSize.VF, vfElement1, CircleSize.VF);

        //create path

        getDriver().findElements(By.xpath("//*[@data-tests-id='pathsMenuBtn']/parent::*")).get(0).click();
//        GeneralUIUtils.getWebElementByTestID("pathsMenuBtn").click();
        GeneralUIUtils.getWebElementByTestID("createPathMenuItem").click();
        //insert values
        GeneralUIUtils.getWebElementByTestID("pathName").sendKeys("name");
        GeneralUIUtils.getWebElementByTestID("pathProtocol").sendKeys("pathProtocol");
        GeneralUIUtils.getWebElementByTestID("pathPortNumbers").sendKeys("pathPortNumbers");
        //select path parameters

        getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrc']//option")).get(0).click();
        getDriver().findElements(By.xpath("//*[@data-tests-id='linkSrcCP']//option")).get(0).click();
        getDriver().findElements(By.xpath("//*[@data-tests-id='linkTarget']//option")).get(0).click();
        getDriver().findElements(By.xpath("//*[@data-tests-id='linkTargetCP']//option")).get(0).click();
        GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ComplexServiceAmdocs.CREATE_BUTTON.getValue());

        //ArtifactsCorrelationManager.addVNFtoServiceArtifactCorrelation(serviceMetadata.getName(), vspName);

        //assertNotNull(vfElement);
        //ServiceVerificator.verifyNumOfComponentInstances(serviceMetadata, "0.1", 1, getUser());
        //ExtentTestActions.addScreenshot(Status.INFO, "ServiceComposition_" + vnfFile, "The service topology is as follows: ");

        //ServiceGeneralPage.clickSubmitForTestingButton(serviceMetadata.getName());
    }

    @Override
    protected UserRoleEnum getRole() {
        return UserRoleEnum.DESIGNER;
    }

}