aboutsummaryrefslogtreecommitdiffstats
path: root/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PropertiesAssignmentUpdateFlow_New.java
blob: c4b17f659413bfa884dcd5e7e3f6b864709c8cec (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
/*-
 * ============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.sanity;

import com.aventstack.extentreports.Status;
import fj.data.Either;
import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum;
import org.openecomp.sdc.be.model.ComponentInstance;
import org.openecomp.sdc.be.model.Resource;
import org.openecomp.sdc.be.model.User;
import org.openecomp.sdc.ci.tests.datatypes.CanvasElement;
import org.openecomp.sdc.ci.tests.datatypes.CanvasManager;
import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum;
import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails;
import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails;
import org.openecomp.sdc.ci.tests.datatypes.TopMenuButtonsEnum;
import org.openecomp.sdc.ci.tests.datatypes.VendorLicenseModel;
import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject;
import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum;
import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum;
import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
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.GeneralPageElements;
import org.openecomp.sdc.ci.tests.pages.HeatParamNameBuilder;
import org.openecomp.sdc.ci.tests.pages.HomePage;
import org.openecomp.sdc.ci.tests.pages.PropertiesAssignmentPage;
import org.openecomp.sdc.ci.tests.pages.PropertiesPage;
import org.openecomp.sdc.ci.tests.pages.PropertyNameBuilder;
import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage;
import org.openecomp.sdc.ci.tests.utilities.CatalogUIUtilitis;
import org.openecomp.sdc.ci.tests.utilities.FileHandling;
import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils;
import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
import org.openecomp.sdc.ci.tests.utils.general.ElementFactory;
import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtillViaApis;
import org.openecomp.sdc.ci.tests.utils.general.VendorLicenseModelRestUtils;
import org.openecomp.sdc.ci.tests.utils.general.VendorSoftwareProductRestUtils;
import org.openecomp.sdc.ci.tests.verificator.PropertiesAssignmentVerificator;
import org.openecomp.sdc.ci.tests.verificator.VfVerificator;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.util.List;

import static org.testng.Assert.assertTrue;

public class PropertiesAssignmentUpdateFlow_New extends SetupCDTest {

    private static String filePath;
    private static String origFile = "virc_fe_be.csar";
    private static String origFile1 = "virc.csar";
    private User sdncDesignerDetails = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER);


    @BeforeClass
    public void beforeClass() {
        filePath = FileHandling.getFilePath("");
    }

    @BeforeMethod
    public void beforeTest() {
        System.out.println("File repository is : " + filePath);
//        SetupCDTest.getExtendTest().log(Status.INFO, "File repository is : " + filePath);
    }

    //Update VSP tests - validating VF properties/inputs values after updating VF with a new VSP
    @DataProvider(name = "assetFilesInputs", parallel = false)
    public Object[][] createDataInputs() {
        return new Object[][]{
                {"editInputValueTopChange.csar", ""},
                {"editInputValueNoTopChange.csar", "Updated-SRE-Mgt"}};
    }

    /**
     * Topoplogy change in updated file - designer changes in inputs values are not kept after update
     * No topoplogy change in updated file - designer changes in inputs values are kept after update
     *
     * @param updFileName     - csar for update
     * @param validationValue - expected property value after update
     * @throws Exception
     */
    @Test(dataProvider = "assetFilesInputs")
    public void updateInputDefaultValueTest(String updFileName, String validationValue) throws Exception {
        setLog(updFileName);

        String origTestFile = origFile;
        String componentName = "abstract_virc_fe_be_0";
        String inputName = "management_net_name";
        String inputUpdValue = "Updated-SRE-Mgt";

        //Import csar
        ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT,
                ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
        resourceMetaData.setVersion("0.1");
        ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, origTestFile, getUser());

        //Edit Input value
        ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
        PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
        PropertiesAssignmentPage.clickOnInputTab();
        PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildInputField(inputName), inputUpdValue);
        PropertiesAssignmentPage.clickOnSaveButton();

        //Certify  VF via API
        Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
        AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();


        HomePage.navigateToHomePage();
        CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
        GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());

        //Update VF
        ResourceGeneralPage.getLeftMenu().moveToGeneralScreen();
        GeneralPageElements.clickCheckoutButton();
        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file"));
        ResourceUIUtils.updateVfWithCsar(filePath, updFileName);

        //Validate Input value - 1) empty in case of topology change; 2) user value is kept if no topology change
        ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
        PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
        PropertiesAssignmentPage.clickOnInputTab();
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), validationValue);

    }


    @DataProvider(name = "assetFilesProperties", parallel = false)
    public Object[][] createDataProp() {
        return new Object[][]{
                {"editedPropValueToEmpty.csar", "value-prop-vm_type_tag", "updated_by_designer", "updated_by_designer", false}, //no topology change - simple
                {"newPropValueToEmpty.csar", "value-prop-high_availablity", "updated_by_designer", "updated_by_designer", false},
                {"editedPropValueToNew.csar", "value-prop-vm_type_tag", "updated_by_designer", "updated_by_file", false},
                {"virc_fe_be.csar", "value-prop-vm_type_tag", "", "virc_fe_be", true},
                {"editedPropValueToEmptyTopChange.csar", "value-prop-vm_type_tag", "updated_by_designer", "", false}, //topology change - simple
                {"newPropValueToEmptyTopChange.csar", "value-prop-high_availablity", "updated_by_designer", "", false},
                {"editedPropValueToNewTopChange.csar", "value-prop-vm_type_tag", "updated_by_designer", "updated_by_file", false},
                {"virc_fe_be.csar", "value-prop-port_virc_fe_be_data_1_port_mac_requirements.mac_range_plan", "updated_by_designer", "updated_by_designer", false}, //no topology change - complex
                {"virc_fe_be.csar", "value-prop-service_template_filter.count", "12345", "1", false},
                {"virc_fe_be.csar", "value-prop-service_template_filter.substitute_service_template", "", "Nested_virc_fe_beServiceTemplate.yaml", true}};
    }

    /**
     * No topology change in updated file - designer changes in properties values are kept after update
     * OrigFile       Designer       UpdFile       Result After Update
     * ---------------------------------------------------------------
     * prop1=value1   prop1=value2   prop1=null    prop1=value2
     * prop1=null     prop1=value1   prop1=null    prop1=value1
     * prop1=value1   prop1=value2   prop1=value3  prop1=value3
     * prop1=value1   prop1=null     prop1=value1  prop1=value1
     *
     *
     * Topoplogy change in updated file - designer changes in properties values are not kept after update
     * OrigFile       Designer       UpdFile       Result After Update
     * ---------------------------------------------------------------
     * prop1=value1   prop1=value2   prop1=null    prop1=null
     * prop1=null     prop1=value1   prop1=null    prop1=null
     * prop1=value1   prop1=value2   prop1=value3  prop1=value3
     *
     *
     * No topology change in updated files - complex property value changes
     * OrigFile       Designer       UpdFile       Result After Update
     * ---------------------------------------------------------------
     * prop1=null     prop1=value1   prop1=null    prop1=value1
     * prop1=value1   prop1=value2   prop1=value1  prop1=value1
     * prop1=value1   prop1=null     prop1=value1  prop1=value1
     *
     * @param updFileName     - csar for update
     * @param propertyName
     * @param validationValue - expected property value after update
     * @throws Exception
     */
    @Test(dataProvider = "assetFilesProperties")
    public void updatePropertyDefaultValueTest(String updFileName, String propertyName, String updValue, String validationValue, boolean userDeletesValue) throws Exception {
        setLog(updFileName);
        String origTestFile = origFile;
        String componentName = "abstract_virc_fe_be_0";
//        String propertyUpdValue = "updated_by_designer";

        //Import csar
        ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType("ciRes", NormativeTypesEnum.ROOT,
                ResourceCategoryEnum.APPLICATION_L4_DATABASE, getUser().getUserId(), ResourceTypeEnum.VF.toString());
        resourceMetaData.setVersion("0.1");
        ResourceUIUtils.importVfFromCsar(resourceMetaData, filePath, origTestFile, getUser());

        //Edit or delete Input value
        ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
        PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
        if (userDeletesValue) {
            PropertiesAssignmentPage.deletePropertyValue(propertyName);
        } else {
            PropertiesAssignmentPage.editPropertyValue(propertyName, updValue);
        }
        PropertiesAssignmentPage.clickOnSaveButton();

        //Certify  VF via API
        Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1");
        AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft();

        //Update VF
        HomePage.navigateToHomePage();
        CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
        GeneralUIUtils.findComponentAndClick(resourceMetaData.getName());
        ResourceGeneralPage.getLeftMenu().moveToGeneralScreen();
        GeneralPageElements.clickCheckoutButton();
        SetupCDTest.getExtendTest().log(Status.INFO, String.format("Updating VF with new file"));
        ResourceUIUtils.updateVfWithCsar(filePath, updFileName);

        //Validate Input value
        ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
        PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
        PropertiesAssignmentVerificator.validatePropertyValue(propertyName, validationValue);
    }


    //ChangeVersion tests - validating service property values after changing VFi version on service
    @DataProvider(name = "assetFilesServiceProperties", parallel = false)
    public Object[][] createDataServiceProp() {
        return new Object[][]{
                {"max_instances", "", "111", "111"}, //edit service prop value, update with original empty value, keep user value after update
                {"nfc_naming_code", "virc_fe_be", "updated_by_designer", "virc_fe_be"}}; //edit service prop value, update with original value, set original value after update
    }

    @Test(dataProvider = "assetFilesServiceProperties")
    public void changeVfiVersionServicePropertyEditValueTest(String propertyName, String origValue, String updValue, String expectedValue) throws Throwable {
        setLog(propertyName);
        String vnfFile = "vIRC_FE_BE.zip";
        String componentName = "abstract_virc_fe_be_1";
        String inputName = componentName + "_" + propertyName;

        //Import VSP, create VF - v0.1
        String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
        getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
            vendorLicenseModel, null);
        resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
        Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);

        //VF - Declare property as input
        declarePropertyAsInput(propertyName, componentName, resourceReqDetails);
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), origValue);

        //Check in VF, create Service and add VFi to Service
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
        ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
        getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
        org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
                serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
        Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
        ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();

        //Find the VF inputs in Service properties, add or edit properties values
        findServiceProperty(inputName, serviceReqDetails);
        PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(inputName), updValue);
        PropertiesAssignmentPage.clickOnSaveButton();

        //Checkout and check in VF, change VFi version on Service to 0.2
        AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
        AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
        AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);

        //Service - Validate properties values
        viewServiceProperties(serviceReqDetails);
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName), expectedValue);
    }


    @Test
    public void changeVfiVersionServicePropertyDeleteValueTest() throws Throwable {
        String vnfFile = "vIRC_FE_BE.zip";
        String componentName = "abstract_virc_fe_be_1";
        String propertyName = "min_instances";
        String propertyValue = "0";
        String inputName = componentName + "_" + propertyName;

        //Import VSP, create VF - v0.1
        String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
        getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
            vendorLicenseModel, null);
        resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
        Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);

        //VF - Declare properties as inputs
        declarePropertyAsInput(propertyName, componentName, resourceReqDetails);
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), propertyValue);

        //Check in VF, create Service and add VFi to Service
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
        ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
        getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
        org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
                serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
        Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
        ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();

        //Find the VF inputs in Service properties, delete property value
        findServiceProperty(inputName, serviceReqDetails);
        PropertiesAssignmentPage.deletePropertyValue(PropertyNameBuilder.buildSimpleField(inputName));
        PropertiesAssignmentPage.clickOnSaveButton();

        //Checkout and check in VF, change VFi version on Service to 0.2
        AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
        AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
        AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);

        //Service - Validate properties values
        viewServiceProperties(serviceReqDetails);
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName), propertyValue);
    }

    @Test
    public void changeVfiVersionServiceGenericPropertyValueTest() throws Throwable {
        String vnfFile = "vIRC_FE_BE.zip";
        String componentName = "abstract_virc_fe_be_1";
        String propertyName = "nf_type";
        String propertyUpdValue = "added by designer on service";

        //Import VSP, create VF - v0.1
        String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
        getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
            vendorLicenseModel, null);
        resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
        Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);

        //Check in VF, create Service and add VFi to Service
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
        ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
        getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
        org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
                serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
        Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
        ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();

        //Find the VF inputs in Service properties, add or edit property value
        CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
        GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
        CompositionPage.moveToPropertiesScreen();
        PropertiesAssignmentPage.findSearchBoxAndClick(propertyName);
        PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(propertyName), propertyUpdValue);
        PropertiesAssignmentPage.clickOnSaveButton();

        //Checkout and check in VF, change VFi version on Service to 0.2
        AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
        AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
        AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);

        //Service - Validate property value
        viewServiceProperties(serviceReqDetails);
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(propertyName), propertyUpdValue);
    }


    //ChangeVersion tests - validating service input values after changing VFi version on service
    @Test
    public void changeVfiServiceInputEditValueTest() throws Throwable {
        String vnfFile = "vIRC_FE_BE.zip";
        String componentName = "virc_fe_be_volume_0";
        String propertyName = "disk_bus";
        String propertyValue = "added_by_designer";
        String propertyValueUpd = "updated_by_designer";
        String inputName = componentName + "_" + propertyName;

        //Import VSP, create VF - v0.1
        String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
        getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
            vendorLicenseModel, null);
        resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
        Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);

        //Edit Property Value and declare as input
        CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
        viewVfComponentProperties(componentName, resourceReqDetails);
        editAndDeclareSimpleProperty(propertyName, propertyValue);
        PropertiesAssignmentPage.clickOnInputTab();
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), propertyValue);

        //Check in VF and add VFi to Service
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
        ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
        getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
        org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
                serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
        Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
        ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();

        //Find the VF input in Service properties, declare it as service input
        viewServiceProperties(serviceReqDetails);
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName), propertyValue);
        findAndDeclareServiceProperty(inputName);
        PropertiesAssignmentVerificator.validatePropertyValue(
                PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName), propertyValue);

        //Checkout VF, update input value and check in - v0.2
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
        viewVfInputs(resourceReqDetails);
        PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildDeclaredInputField(componentName, propertyName),
                propertyValueUpd);
        PropertiesAssignmentPage.clickOnSaveButton();
        ResourceGeneralPage.clickCheckinButton(resourceReqDetails.getName());

        //Change resource version on service
        resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resource.getName(), "0.2");
        AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);

        //Validate that service contains property with "get_input" value and input with the updated value
        GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
        CompositionPage.moveToPropertiesScreen();
        PropertiesAssignmentPage.isPropertyChecked(inputName);
        PropertiesAssignmentVerificator.validatePropertyValue(
                PropertyNameBuilder.buildServicePropertyValue(componentName, propertyName),
                        PropertyNameBuilder.buildServiceDeclaredPropertyValue(componentInstance, componentName, propertyName));
        PropertiesAssignmentPage.clickOnInputTab();
        PropertiesAssignmentVerificator.validatePropertyValue(
                PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName), propertyValueUpd);
    }

    @Test
    public void changeVfiServiceInputEditBooleanTest() throws Throwable {
        String vnfFile = "vIRC_FE_BE.zip";
        String componentName = "virc_fe_be_volume_0";
        String propertyName = "multi_stage_design";
        String origValue = "FALSE";
        String updValue = "TRUE";

        //Import VSP, create VF - v0.1
        String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
        getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
            vendorLicenseModel, null);
        resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
        Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);

        //Check in VF and add VFi to Service
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
        ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
        getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
        org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
                serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
        Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
        ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();

        //Find the VF input in Service properties, declare it as service input
        CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
        GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
        CompositionPage.moveToPropertiesScreen();
        PropertiesAssignmentPage.findSearchBoxAndClick(propertyName);
        PropertiesAssignmentPage.selectBooleanPropertyValue(PropertyNameBuilder.buildSimpleField(propertyName), updValue);
        PropertiesAssignmentPage.clickOnSaveButton();
        PropertiesAssignmentPage.clickOnDeclareButton();
        PropertiesAssignmentPage.clickOnInputTab();
        PropertiesAssignmentVerificator.validateBooleanPropertyValue(
                PropertyNameBuilder.buildServiceDeclaredFieldServiceLevel(componentInstance, propertyName),
                        updValue);

//        //Checkout VF and check in - v0.2
        AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
        AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();

//        //Change resource version on service
        resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resource.getName(), "0.2");
        AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);

//        //Validate that service contains property with "get_input" value and input with the updated value
        viewServiceProperties(serviceReqDetails);
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(propertyName),
                PropertyNameBuilder.buildServiceDeclaredPropValueServiceLevel(componentInstance, propertyName));
        PropertiesAssignmentPage.isPropertyChecked(propertyName);
        PropertiesAssignmentPage.clickOnInputTab();
        PropertiesAssignmentVerificator.validateBooleanPropertyValue(
                PropertyNameBuilder.buildServiceDeclaredFieldServiceLevel(componentInstance, propertyName),
                        origValue);
    }

    @Test
    public void changeVfiServiceInputDeleteValueTest() throws Throwable {
        String vnfFile = "vIRC_FE_BE.zip";
        String componentName = "abstract_virc_fe_be_0";
        String propertyName = "vm_type_tag";
        String propertyValue = "updated_by_designer";
        String inputName = componentName + "_" + propertyName;

        //Import VSP, create VF - v0.1
        String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
        getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
            vendorLicenseModel, null);
        resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
        Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);

        //Edit Property Value and declare as input
        CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
        viewVfComponentProperties(componentName, resourceReqDetails);
        editAndDeclareSimpleProperty(propertyName, propertyValue);
        PropertiesAssignmentPage.clickOnInputTab();
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), propertyValue);

        //Check in VF and add VFi to Service
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
        ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
        getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
        org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
                serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
        Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
        ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();

        //Find the VF input in Service properties, declare it as service input
        viewServiceProperties(serviceReqDetails);
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName), propertyValue);
        findAndDeclareServiceProperty(inputName);
        PropertiesAssignmentVerificator.validatePropertyValue(
                PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName), propertyValue);

        //Checkout VF, update input value and check in - v0.2
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
        viewVfInputs(resourceReqDetails);
        PropertiesAssignmentPage.deletePropertyValue(PropertyNameBuilder.buildDeclaredInputField(componentName, propertyName));
        PropertiesAssignmentPage.clickOnSaveButton();
        ResourceGeneralPage.clickCheckinButton(resourceReqDetails.getName());

        //Change resource version on service
        resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resource.getName(), "0.2");
        AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);

        //Validate that service contains property with "get_input" value and input with the updated value
        GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
        CompositionPage.moveToPropertiesScreen();
        PropertiesAssignmentPage.isPropertyChecked(inputName);
        PropertiesAssignmentVerificator.validatePropertyValue(
                PropertyNameBuilder.buildServicePropertyValue(componentName, propertyName),
                        PropertyNameBuilder.buildServiceDeclaredPropertyValue(componentInstance, componentName, propertyName));
        PropertiesAssignmentPage.clickOnInputTab();
        PropertiesAssignmentVerificator.validatePropertyValue(
                PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName), propertyValue);
    }

    @Test
    public void changeVfiServiceInputAddValueTest() throws Throwable {
        String vnfFile = "vIRC_FE_BE.zip";
        String componentName = "virc_fe_be_volume_0";
        String propertyName = "disk_bus";
        String propertyValue = "updated_by_designer";
        String inputName = componentName + "_" + propertyName;

        //Import VSP, create VF - v0.1
        String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
        getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
            vendorLicenseModel, null);
        resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
        Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);

        //Edit Property Value and declare as input
        declarePropertyAsInput(propertyName, componentName, resourceReqDetails);
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), "");

        //Check in VF and add VFi to Service
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
        ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
        getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
        org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
                serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
        Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
        ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();

        //Find the VF input in Service properties, declare it as service input
        viewServiceProperties(serviceReqDetails);
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName), "");
        findAndDeclareServiceProperty(inputName);
        PropertiesAssignmentVerificator.validatePropertyValue(
                PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName), "");

        //Checkout VF, update input value and check in - v0.2
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
        viewVfInputs(resourceReqDetails);
        PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildDeclaredInputField(componentName, propertyName), propertyValue);
        PropertiesAssignmentPage.clickOnSaveButton();
        ResourceGeneralPage.clickCheckinButton(resourceReqDetails.getName());

        //Change resource version on service
        resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resource.getName(), "0.2");
        AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);

        //Validate that service contains property with "get_input" value and input with the updated value
        GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
        CompositionPage.moveToPropertiesScreen();
        PropertiesAssignmentPage.isPropertyChecked(inputName);
        PropertiesAssignmentVerificator.validatePropertyValue(
                PropertyNameBuilder.buildServicePropertyValue(componentName, propertyName),
                        PropertyNameBuilder.buildServiceDeclaredPropertyValue(componentInstance, componentName, propertyName));
        PropertiesAssignmentPage.clickOnInputTab();
        PropertiesAssignmentVerificator.validatePropertyValue(
                PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName), propertyValue);
    }

    @Test
    public void changeVfiServiceInputDeleteInputTest() throws Throwable {
        String vnfFile = "vIRC_FE_BE.zip";
        String componentName = "virc_fe_be_volume_0";
        String propertyName = "disk_bus";
        String propertyValue = "added_by_designer";
        String inputName = componentName + "_" + propertyName;

        //Import VSP, create VF - v0.1
        String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
        getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
            vendorLicenseModel, null);
        resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
        Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);

        //Edit Property Value and declare as input
        CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
        viewVfComponentProperties(componentName, resourceReqDetails);
        editAndDeclareSimpleProperty(propertyName, propertyValue);
        PropertiesAssignmentPage.clickOnInputTab();
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildInputField(inputName), propertyValue);

        //Check in VF and add VFi to Service
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
        ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
        getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
        org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
                serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
        Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true);
        ComponentInstance componentInstance = addComponentInstanceToComponentContainer.left().value();

        //Find the VF input in Service properties, declare it as service input
        viewServiceProperties(serviceReqDetails);
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildSimpleField(inputName), propertyValue);
        findAndDeclareServiceProperty(inputName);
        PropertiesAssignmentVerificator.validatePropertyValue(
                PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName), propertyValue);

        //Checkout VF, delete input  and check in - v0.2
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
        viewVfInputs(resourceReqDetails);
        PropertiesAssignmentPage.clickOnDeleteInputButton();
        PropertiesAssignmentPage.clickOnDeleteInputDialogConfirmationButton();
        ResourceGeneralPage.clickCheckinButton(resourceReqDetails.getName());

        //Change resource version on service
        resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resource.getName(), "0.2");
        AtomicOperationUtils.changeComponentInstanceVersion(service, componentInstance, resource, UserRoleEnum.DESIGNER, true);

        //Validate that service property and input are deleted
        GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
        CompositionPage.moveToPropertiesScreen();
        PropertiesAssignmentPage.findProperty(inputName);
        assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildSimpleField(inputName)));
        PropertiesAssignmentPage.clickOnInputTab();
        assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildServiceDeclaredFieldVfLevel(componentInstance, componentName, propertyName)));
    }


    //ChangeVersion test - validating VF input values after changing VFCi version on VF
    @Test
    public void updateVFCPropertyChangeVFCiVersionTest() throws Throwable {
        ResourceReqDetails atomicResourceMetaData;
        String prop1 = "network_role";
        String propValue1 = "added_value_1";
        String prop2 = "is_default";
        String propValue2 = "TRUE";
        String propDefaultValue2 = "FALSE";

        //Import VFC, certify VFC
        String fileName = "importVFC_VFC23.yml";
        atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VFC, NormativeTypesEnum.ROOT,
                ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser());
        ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser());
        String vfcName = atomicResourceMetaData.getName();
        ResourceGeneralPage.clickCheckinButton(vfcName);

        //Create VF
        ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser());
        ResourceUIUtils.createVF(vfMetaData, getUser());

        //Add VFCi to VF canvas
        ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
        CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
        CanvasElement vfcElement = vfCanvasManager.createElementOnCanvas(vfcName);

        //VF Properties Assignment - edit properties values and declare as input
        CompositionPage.moveToPropertiesScreen();
        PropertiesAssignmentPage.findSearchBoxAndClick(prop1);
        PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(prop1), propValue1);
        PropertiesAssignmentPage.clickOnSaveButton();
        PropertiesAssignmentPage.clickOnDeclareButton();
        PropertiesAssignmentPage.findSearchBoxAndClick(prop2);
        PropertiesAssignmentPage.selectBooleanPropertyValue(PropertyNameBuilder.buildSimpleField(prop2), propValue2);
        PropertiesAssignmentPage.clickOnSaveButton();
        PropertiesAssignmentPage.clickOnDeclareButton();

        //Check out and check in VFC - v0.2
        HomePage.navigateToHomePage();
        GeneralUIUtils.findComponentAndClick(vfcName);
        ResourceGeneralPage.clickCheckoutButton();
        ResourceGeneralPage.clickCheckinButton(vfcName);

        //Change VFCi version in VF
        GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
        ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
        vfCanvasManager = CanvasManager.getCanvasManager();
        CompositionPage.changeComponentVersion(vfCanvasManager, vfcElement, "0.2");
        VfVerificator.verifyInstanceVersion(vfMetaData, getUser(), atomicResourceMetaData.getName(), "0.2");

        Resource resource = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, vfMetaData.getName(), "0.1");
        List<ComponentInstance> components = resource.getComponentInstances();
        String normalizedName = components.get(0).getNormalizedName();
        CompositionPage.moveToPropertiesScreen();
        PropertiesAssignmentPage.clickOnInputTab();
        //Verify that input value of the declared property that is EMPTY by default hasn't changed
        PropertiesAssignmentVerificator.validatePropertyValue(PropertyNameBuilder.buildDeclaredInputField(normalizedName, prop1), propValue1);
        //Verify that input value of the declared property that is NOT EMPTY by default has been changed
        PropertiesAssignmentVerificator.validateBooleanPropertyValue(PropertyNameBuilder.buildDeclaredInputField(normalizedName, prop2), propDefaultValue2);

        //Check out VFC - v0.3, delete a property, check in VFC
        HomePage.navigateToHomePage();
        GeneralUIUtils.findComponentAndClick(vfcName);
        ResourceGeneralPage.clickCheckoutButton();
        ResourceGeneralPage.getLeftMenu().moveToPropertiesScreen();
        PropertiesPage.clickDeletePropertyFromPopup(prop1);
        PropertiesPage.clickDeletePropertyFromPopup(prop2);
        ResourceGeneralPage.clickCheckinButton(vfcName);

        //Change VFCi version in VF
        GeneralUIUtils.findComponentAndClick(vfMetaData.getName());
        ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
        vfCanvasManager = CanvasManager.getCanvasManager();
        CompositionPage.changeComponentVersion(vfCanvasManager, vfcElement, "0.3");
        VfVerificator.verifyInstanceVersion(vfMetaData, getUser(), atomicResourceMetaData.getName(), "0.3");

        //Verify that properties and inputs were removed
        CompositionPage.moveToPropertiesScreen();
        PropertiesAssignmentPage.findProperty(prop1);
        assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildSimpleField(prop1)));
        PropertiesAssignmentPage.findProperty(prop2);
        assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildSimpleField(prop2)));
        PropertiesAssignmentPage.clickOnInputTab();
        PropertiesAssignmentPage.findProperty(normalizedName + "_" + prop1);
        assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildDeclaredInputField(normalizedName, prop1)));
        PropertiesAssignmentPage.findProperty(normalizedName + "_" + prop2);
        assertTrue(GeneralUIUtils.isElementInvisibleByTestId(PropertyNameBuilder.buildDeclaredInputField(normalizedName, prop2)));
    }

    //ChangeVersion test - validating HEAT param values after changing VFi version on Service
    @Test
    public void updateHeatParamChangeVfiVersionTest() throws Throwable {
        String vnfFile = "vIRC_FE_BE.zip";
        String artifactName = "base_fe_be";
        String heatParamName = "availability_zone_0";
        String heatParamUpdValue = "Updated_ZoneA";

        //Import VSP, create VF - v0.1
        String filePath = org.openecomp.sdc.ci.tests.utils.general.FileHandling.getVnfRepositoryPath();
        getExtendTest().log(Status.INFO, "Going to upload VNF " + vnfFile);
        VendorLicenseModel vendorLicenseModel = VendorLicenseModelRestUtils.createVendorLicense(getUser());
        ResourceReqDetails resourceReqDetails = ElementFactory.getDefaultResource(); //getResourceReqDetails(ComponentConfigurationTypeEnum.DEFAULT);
        VendorSoftwareProductObject vendorSoftwareProductObject = VendorSoftwareProductRestUtils.createAndFillVendorSoftwareProduct(resourceReqDetails, vnfFile, filePath, sdncDesignerDetails,
            vendorLicenseModel, null);
        resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(resourceReqDetails, vendorSoftwareProductObject);
        Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails);

        //Check in VF and add VFi to Service
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();
        ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(sdncDesignerDetails);
        getExtendTest().log(Status.INFO, "Create Service: " + serviceReqDetails.getName());
        org.openecomp.sdc.be.model.Service service = AtomicOperationUtils.createCustomService(
                serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value();
        CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
        GeneralUIUtils.findComponentAndClick(service.getName());
        ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
        CanvasManager vfCanvasManager = CanvasManager.getCanvasManager();
        CanvasElement vfElement = vfCanvasManager.createElementOnCanvas(resource.getName());

        //Select VFi on canvas, open Deployment Artifacts tab
        vfCanvasManager.clickOnCanvaElement(vfElement);
        CompositionPage.showDeploymentArtifactTab();
        DeploymentArtifactPage.hoverArtifact(artifactName);
        DeploymentArtifactPage.clickEditEnvArtifact(artifactName);
        DeploymentArtifactPage.editHeatParamValue(HeatParamNameBuilder.buildCurrentHeatParamValue(heatParamName), heatParamUpdValue);
        DeploymentArtifactPage.clickSaveEnvParameters();

        //Checkout and check in VF - v0.2
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();

        //Change VFi version on Service canvas - v0.2
        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
        GeneralUIUtils.findComponentAndClick(service.getName());
        ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
        vfCanvasManager = CanvasManager.getCanvasManager();
        CompositionPage.changeComponentVersion(vfCanvasManager, vfElement, "0.2");
//        VfVerificator.verifyInstanceVersion(service, getUser(), resource.getName(), "0.2");

        //Validate that edited heatparam value is kept
        CompositionPage.showDeploymentArtifactTab();
        DeploymentArtifactPage.hoverArtifact(artifactName);
        DeploymentArtifactPage.clickEditEnvArtifact(artifactName);
        PropertiesAssignmentVerificator.validatePropertyValue(HeatParamNameBuilder.buildCurrentHeatParamValue(heatParamName), heatParamUpdValue);
        DeploymentArtifactPage.clickCloseEnvParameters();

        //Check out VF, delete heatparam value, check in VF - v0.3
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKOUT, true).getLeft();
        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
        GeneralUIUtils.findComponentAndClick(resource.getName());
        ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen();
        DeploymentArtifactPage.clickEditEnvArtifact(artifactName);
        DeploymentArtifactPage.clickOnDeleteHeatParamValue(heatParamName);
        DeploymentArtifactPage.clickSaveEnvParameters();
        resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CHECKIN, true).getLeft();

        //Change VFi version on Service canvas - v0.3
        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
        GeneralUIUtils.findComponentAndClick(service.getName());
        ResourceGeneralPage.getLeftMenu().moveToCompositionScreen();
        vfCanvasManager = CanvasManager.getCanvasManager();
        CompositionPage.changeComponentVersion(vfCanvasManager, vfElement, "0.3");

        //Validate that edited heatparam value is kept, default value is empty
        CompositionPage.showDeploymentArtifactTab();
        DeploymentArtifactPage.hoverArtifact(artifactName);
        DeploymentArtifactPage.clickEditEnvArtifact(artifactName);
        PropertiesAssignmentVerificator.validatePropertyValue(HeatParamNameBuilder.buildCurrentHeatParamValue(heatParamName), heatParamUpdValue);
        PropertiesAssignmentVerificator.validatePropertyValueIsNull(HeatParamNameBuilder.buildDefaultHeatParamValue(heatParamName));
        DeploymentArtifactPage.clickCloseEnvParameters();
    }


    private void declarePropertyAsInput(String propertyName, String componentName, ResourceReqDetails resourceReqDetails) throws Exception {
        CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG);
        viewVfComponentProperties(componentName, resourceReqDetails);
        findAndDeclareServiceProperty(propertyName);
    }

    private void viewServiceProperties(ServiceReqDetails serviceReqDetails) throws Exception {
        GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click();
        GeneralUIUtils.findComponentAndClick(serviceReqDetails.getName());
        CompositionPage.moveToPropertiesScreen();
    }

    private void findServiceProperty(String inputName, ServiceReqDetails serviceReqDetails) throws Exception {
        viewServiceProperties(serviceReqDetails);
        PropertiesAssignmentPage.findSearchBoxAndClick(inputName);
    }

    private void viewVfComponentProperties(String componentName, ResourceReqDetails resourceReqDetails) throws Exception {
        GeneralUIUtils.findComponentAndClick(resourceReqDetails.getName());
        ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
        PropertiesAssignmentPage.clickOnComponentInComposition(componentName);
    }

    private void findAndDeclareServiceProperty(String inputName) throws Exception {
        PropertiesAssignmentPage.findSearchBoxAndClick(inputName);
        PropertiesAssignmentPage.clickOnDeclareButton();
        PropertiesAssignmentPage.clickOnInputTab();
    }

    private void editAndDeclareSimpleProperty(String propertyName, String propertyValue) throws Exception {
        PropertiesAssignmentPage.editPropertyValue(PropertyNameBuilder.buildSimpleField(propertyName), propertyValue);
        PropertiesAssignmentPage.clickOnSaveButton();
        PropertiesAssignmentPage.findSearchBoxAndClick(propertyName);
        PropertiesAssignmentPage.clickOnDeclareButton();
    }

    private void viewVfInputs(ResourceReqDetails resourceReqDetails) throws Exception {
        GeneralUIUtils.findComponentAndClick(resourceReqDetails.getName());
        ResourceGeneralPage.getLeftMenu().moveToPropertiesAssignmentScreen();
        PropertiesAssignmentPage.clickOnInputTab();
    }

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

}