0331420df882f7adb51208554a644f2684c1a17d
[vid.git] / vid-automation / src / main / java / vid / automation / test / test / BrowseASDCTest.java
1 package vid.automation.test.test;
2
3 import static org.hamcrest.MatcherAssert.assertThat;
4 import static org.testng.Assert.assertEquals;
5 import static org.testng.Assert.assertFalse;
6 import static vid.automation.test.infra.Features.FLAG_1908_COLLECTION_RESOURCE_NEW_INSTANTIATION_UI;
7 import static vid.automation.test.infra.Features.FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI;
8 import static vid.automation.test.infra.Features.FLAG_5G_IN_NEW_INSTANTIATION_UI;
9 import static vid.automation.test.infra.Features.FLAG_NETWORK_TO_ASYNC_INSTANTIATION;
10 import static vid.automation.test.infra.Features.FLAG_SHOW_ORCHESTRATION_TYPE;
11 import static vid.automation.test.infra.ModelInfo.aLaCarteForBrowseSdc;
12 import static vid.automation.test.infra.ModelInfo.aLaCarteServiceCreationTest;
13 import static vid.automation.test.infra.ModelInfo.instantiationTypeAlacarte_vidNotionsInstantiationUIByUUID;
14 import static vid.automation.test.infra.ModelInfo.macroForBrowseSdc;
15
16 import com.google.common.collect.ImmutableList;
17 import java.util.List;
18 import org.apache.logging.log4j.LogManager;
19 import org.apache.logging.log4j.Logger;
20 import org.hamcrest.Matchers;
21 import org.jetbrains.annotations.NotNull;
22 import org.onap.sdc.ci.tests.datatypes.UserCredentials;
23 import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
24 import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset;
25 import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetServicesGet;
26 import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet;
27 import org.onap.simulator.presetGenerator.presets.aai.PresetAAIServiceDesignAndCreationPut;
28 import org.onap.simulator.presetGenerator.presets.ecompportal_att.PresetGetSessionSlotCheckIntervalGet;
29 import org.openqa.selenium.By;
30 import org.openqa.selenium.WebElement;
31 import org.testng.Assert;
32 import org.testng.TimeBombSkipException;
33 import org.testng.annotations.BeforeClass;
34 import org.testng.annotations.BeforeMethod;
35 import org.testng.annotations.DataProvider;
36 import org.testng.annotations.Test;
37 import vid.automation.test.Constants;
38 import vid.automation.test.infra.Click;
39 import vid.automation.test.infra.Exists;
40 import vid.automation.test.infra.FeatureTogglingTest;
41 import vid.automation.test.infra.Get;
42 import vid.automation.test.infra.ModelInfo;
43 import vid.automation.test.infra.SelectOption;
44 import vid.automation.test.model.Service;
45 import vid.automation.test.model.User;
46 import vid.automation.test.sections.BrowseASDCPage;
47 import vid.automation.test.sections.SideMenu;
48 import vid.automation.test.sections.ViewEditPage;
49 import vid.automation.test.sections.deploy.DeployDialogBase;
50 import vid.automation.test.sections.deploy.DeployModernUIALaCarteDialog;
51 import vid.automation.test.sections.deploy.DeployModernUIMacroDialog;
52 import vid.automation.test.sections.deploy.DeployOldALaCarteDialog;
53 import vid.automation.test.sections.deploy.DeployOldMacroDialog;
54 import vid.automation.test.services.ServicesService;
55 import vid.automation.test.services.SimulatorApi;
56
57
58 public class BrowseASDCTest extends CreateInstanceDialogBaseTest {
59     private final String invariantUUIDAlacarte = aLaCarteForBrowseSdc.modelInvariantId;
60     private final String invariantUUIDMacro = macroForBrowseSdc.modelInvariantId;
61     public static final String modelInvariantUUID1 = "aeababbc-010b-4a60-8df7-e64c07389466";
62     public static final String modelInvariantUUID2 = "aa2f8e9c-9e47-4b15-a95c-4a9385599abc";
63     public static final String modelInvariantUUID3 = "d849c57d-b6fe-4843-8349-4ab8bbb08d71";
64     public static final String modelUuid = "a8dcd72d-d44d-44f2-aa85-53aa9ca99cba";
65
66     private ServicesService servicesService = new ServicesService();
67
68     private final Logger logger = LogManager.getLogger(BrowseASDCTest.class);
69
70     @BeforeClass
71     public void beforeClass() {
72         resetGetServicesCache();
73     }
74
75     @BeforeMethod
76     public void resetSdcModelCaches() {
77         invalidateSdcModelsCache();
78     }
79
80     @Override
81     protected UserCredentials getUserCredentials() {
82         User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
83         return new UserCredentials(user.credentials.userId, user.credentials.password, Constants.Users.EMANUEL_EMANUEL, "", "");
84     }
85
86     //@Test(groups = {"shouldBeMigratedToWorkWithSimulator"})
87     public void testPNFOnCreatePopup() {
88         Service service = servicesService.getService("f39389e4-2a9c-4085-8ac3-04aea9c651be");
89         BrowseASDCPage browseASDCPage = new BrowseASDCPage();
90         SideMenu.navigateToBrowseASDCPage();
91         browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
92         assertThatServiceCreationDialogIsVisible();
93         validatePNFCreationDialog(service, "Emanuel", "pnf");
94     }
95
96     private void validatePNFCreationDialog(Service service, String serviceType, String serviceRole) {
97         assertServiceMetadata(serviceType, Constants.SERVICE_TYPE);
98         assertServiceMetadata(serviceRole, Constants.SERVICE_ROLE);
99         validateServiceCreationDialog(service);
100     }
101
102
103
104     //@Test(groups = {"shouldBeMigratedToWorkWithSimulator"})
105     private void testPNFMacroInstantation() throws Exception {
106         User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
107         relogin(user.credentials);
108
109         BrowseASDCPage browseASDCPage = new BrowseASDCPage();
110         SideMenu.navigateToBrowseASDCPage();
111         browseASDCPage.clickDeployServiceButtonByServiceUUID("f39389e4-2a9c-4085-8ac3-04aea9c651be");
112         assertThatServiceCreationDialogIsVisible();
113         assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
114         browseASDCPage.selectSubscriberById("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
115         browseASDCPage.selectProductFamily("ebc3bc3d-62fd-4a3f-a037-f619df4ff034");
116         GeneralUIUtils.ultimateWait();
117
118         browseASDCPage.selectServiceTypeByName("Emanuel");
119         GeneralUIUtils.ultimateWait();
120         browseASDCPage.selectLcpRegion("hvf16");
121
122         browseASDCPage.selectTenant("a259ae7b7c3f493cb3d91f95a7c18149");
123         assertAllIsPermitted(Constants.BrowseASDC.AIC_OPTION_CLASS);
124         browseASDCPage.selectAicZone("NFT1");
125
126         Click.onFirstSelectOptionById(Constants.OwningEntity.PROJECT_SELECT_TEST_ID);
127         Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
128
129         browseASDCPage.clickConfirmButton();
130
131         assertSuccessfulServiceInstanceCreation();
132
133         browseASDCPage.clickCloseButton();
134
135         ViewEditPage viewEditPage = new ViewEditPage();
136         viewEditPage.clickActivateButton();
137     }
138
139     @Test
140     private void browseServiceModel_deployServiceALaCarteByBackendInput_creationPopupIsALaCarte()  {
141         // model uuid should be of macro
142         deployServiceAndAssertInstantiationType(
143                 "csar15782222_instantiationTypeAlacarte_invariantUUIDMacro.zip",
144                 invariantUUIDMacro,
145             getAlacarteDialogByFlagValue()
146         );
147     }
148
149     @NotNull
150     public static DeployDialogBase getAlacarteDialogByFlagValue() {
151         return FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI.isActive() ?
152             new DeployModernUIALaCarteDialog() :
153             new DeployOldALaCarteDialog();
154     }
155
156     @Test
157     @FeatureTogglingTest(FLAG_5G_IN_NEW_INSTANTIATION_UI)
158     private void browseServiceModel_deployServiceALaCarteByBackendInputHintNewUI_creationPopupIsAngular2()  {
159         deployServiceAndAssertInstantiationType(
160                 instantiationTypeAlacarte_vidNotionsInstantiationUIByUUID,
161                 new DeployModernUIALaCarteDialog()
162         );
163     }
164
165     @Test
166     private void browseServiceModel_deployServiceALaCarteBecauseNotOnMACRO_SERVICESConfig_creationPopupIsALaCarte()  {
167         deployServiceAndAssertInstantiationType(
168                 "csar15782222_instantiationTypeEmpty_invariantUUIDAlacarte.zip",
169                 invariantUUIDAlacarte,
170             getAlacarteDialogByFlagValue()
171         );
172     }
173
174     @Test
175     private void browseServiceModel_deployServiceMacroByBackendInput_creationPopupIsMacro()  {
176         deployServiceAndAssertInstantiationType(
177                 "csar15782222_instantiationTypeMacro_invariantUUIDAlacarte_withoutNetworks.zip",
178                 invariantUUIDAlacarte,
179                 new DeployModernUIMacroDialog()
180         );
181     }
182
183     @Test
184     private void browseServiceModel_deployServiceMacroByMACRO_SERVICESConfig_creationPopupIsOldMacro()  {
185         if (FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI.isActive() ) {
186             throw new TimeBombSkipException("skipping identify macro by uuid for awhile", "2019/11/25");
187             //also need to handle the simulator preset by using good ModelInfo instance
188         }
189         deployServiceAndAssertInstantiationType(
190                 "csar15782222_invariantUUIDMacro.zip",
191                 invariantUUIDMacro,
192                 new DeployOldMacroDialog()
193         );
194     }
195
196     @Test
197     private void browseServiceModel_deployServiceMacroWithPnf_creationPopupIsOldMacro() {
198         deployServiceAndAssertInstantiationType(
199                 "csar15782222_instantiationTypeMacroWithPnf.zip",
200                 invariantUUIDMacro,
201             new DeployOldMacroDialog()
202         );
203     }
204
205     @Test
206     public void browseServiceModel_deployServiceMacroWithCR_creationPopupIsOldMacro()  {
207         deployServiceAndAssertInstantiationType(
208             ModelInfo.collectionResourceService,
209                 FLAG_1908_COLLECTION_RESOURCE_NEW_INSTANTIATION_UI.isActive() ?
210                     new DeployModernUIMacroDialog() :
211                     new DeployOldMacroDialog()
212         );
213     }
214
215     @Test
216     private void browseServiceModel_deployServiceMacroWithNetwork_creationPopupIsMacroByFF()  {
217         deployServiceAndAssertInstantiationType(
218                 "csar15782222_instantiationTypeMacroWithNetwork.zip",
219                 invariantUUIDMacro,
220                 FLAG_NETWORK_TO_ASYNC_INSTANTIATION.isActive() ?
221                 new DeployModernUIMacroDialog() :
222                 new DeployOldMacroDialog()
223         );
224     }
225
226
227     private void deployServiceAndAssertInstantiationType(String modelZipFileName, String modelInvariantId, DeployDialogBase deployDialog)  {
228         deployServiceAndAssertInstantiationType(new ModelInfo("4d71990b-d8ad-4510-ac61-496288d9078e", modelInvariantId, modelZipFileName), deployDialog);
229     }
230
231     private void deployServiceAndAssertInstantiationType(ModelInfo modelInfo, DeployDialogBase deployDialog)  {
232
233         registerExpectationForLegacyServiceDeployment(modelInfo, "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
234         User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
235         relogin(user.credentials);
236
237         BrowseASDCPage browseASDCPage = new BrowseASDCPage();
238         SideMenu.navigateToBrowseASDCPage();
239
240         GeneralUIUtils.ultimateWait();
241         browseASDCPage.clickDeployServiceButtonByServiceUUID(modelInfo.modelVersionId);
242
243         deployDialog.waitForDialogAssertAndClose();
244     }
245
246     @FeatureTogglingTest(value = FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI, flagActive = false)
247     @Test
248     private void testServiceInstantiationAlaCarte()  {
249         User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
250         relogin(user.credentials);
251
252         registerExpectationForLegacyServiceDeployment(aLaCarteServiceCreationTest, "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
253
254         BrowseASDCPage browseASDCPage = new BrowseASDCPage();
255         SideMenu.navigateToBrowseASDCPage();
256
257         Service service = new Service(
258                 "pnf",
259                 aLaCarteServiceCreationTest.modelVersionId,
260                 aLaCarteServiceCreationTest.modelInvariantId,
261                 "action-data",
262                 "1.0",
263                 "Network L1-3",
264                 "PASQUALE vMX vPE based on Juniper 17.2 release. Updated with updated VF for v8.0 of VLM",
265                 null);
266
267
268         logger.info("Expected service model properties: "+service.toString());
269         browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
270         validateServiceCreationDialog(service);
271
272         browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
273
274         assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
275         browseASDCPage.selectSubscriberById("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
276
277         String serviceType = "Emanuel";
278         GeneralUIUtils.findAndWaitByText(serviceType, 30);
279
280         assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
281         browseASDCPage.selectServiceTypeByName(serviceType);
282
283         SelectOption.byTestIdAndVisibleText("yyy1", Constants.OwningEntity.PROJECT_SELECT_TEST_ID);
284         SelectOption.byTestIdAndVisibleText("aaa1", Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
285
286         browseASDCPage.selectSuppressRollback("false");
287
288         browseASDCPage.clickConfirmButton();
289
290         assertSuccessfulServiceInstanceCreation();
291     }
292
293     private static final String serviceName = "CONTRAIL30_L2NODHCP";
294     private static final String modelInvariantId = "5b607929-6088-4614-97ef-cac817508e0e";
295     private static final String serviceUuid = "797a6c41-0f80-4d35-a288-3920c4e06baa";
296
297
298     @DataProvider
299     public static Object[][] filterTexts() {
300         return new Object[][]{{serviceName},{modelInvariantId},{serviceUuid}};
301     }
302
303     @Test(dataProvider = "filterTexts")
304     public void testFilterOptionsInBrowseSdc(String filterText){
305         BrowseASDCPage browseAsdcPage = registerSimulatorAndGoToBrowseSDC();
306         GeneralUIUtils.ultimateWait();
307         assertThat(browseAsdcPage.countCurrentRowsInTable(),(Matchers.greaterThan(1)));
308         browseAsdcPage.fillFilterText(filterText);
309         Assert.assertEquals(browseAsdcPage.countCurrentRowsInTable(),1);
310         Assert.assertTrue(Exists.byTestId("deploy-" + serviceUuid));
311         browseAsdcPage.fillFilterText("");
312
313     }
314
315     @Test
316     private void testCategoryParamsDropdownsExistsInCreationDialog() throws Exception {
317         BrowseASDCPage browseASDCPage = registerSimulatorAndGoToBrowseSDC();
318         Service service = servicesService.getService("2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd");
319         browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
320         DeployModernUIMacroDialog deployMacroDialog = new DeployModernUIMacroDialog();
321         deployMacroDialog.waitForDialogToLoad();
322         deployMacroDialog.assertDialog();
323         deployMacroDialog.clickProjectSelect();
324         deployMacroDialog.clickOwningEntitySelect();
325     }
326
327     private BrowseASDCPage registerSimulatorAndGoToBrowseSDC() {
328         SimulatorApi.registerExpectation(SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET,
329                 "ecompportal_getSessionSlotCheckInterval.json",
330                 "browseASDC/aai_get_services.json",
331                 "browseASDC/get_sdc_catalog_services_2f80c596.json"
332         );
333         SimulatorApi.registerExpectationFromPresets(ImmutableList.of(
334                     new PresetAAIGetSubscribersGet(),
335                     new PresetAAIServiceDesignAndCreationPut()
336                 ),
337                 SimulatorApi.RegistrationStrategy.APPEND);
338         SideMenu.navigateToBrowseASDCPage();
339         return new BrowseASDCPage();
340     }
341
342     //@Test(groups = {"shouldBeMigratedToWorkWithSimulator"})
343     private void testOwningEntityRequiredAndProjectOptional() throws Exception {
344         User user = usersService.getUser(Constants.Users.SILVIA_ROBBINS_TYLER_SILVIA);
345         relogin(user.credentials);
346
347         BrowseASDCPage browseASDCPage = new BrowseASDCPage();
348         SideMenu.navigateToBrowseASDCPage();
349
350         Service service = servicesService.getService("c079d859-4d81-4add-a9c3-94551f96e2b0");
351
352         browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
353         validateServiceCreationDialog(service);
354
355         browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
356
357         assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
358         browseASDCPage.selectSubscriberById("e433710f-9217-458d-a79d-1c7aff376d89");
359
360         String serviceType = "TYLER SILVIA";
361         GeneralUIUtils.findAndWaitByText(serviceType, 30);
362
363         assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
364         browseASDCPage.selectServiceTypeByName(serviceType);
365
366         browseASDCPage.clickConfirmButton();
367
368         GeneralUIUtils.findAndWaitByText("Missing data", 5);
369
370         Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
371
372         browseASDCPage.clickConfirmButton();
373         assertSuccessfulServiceInstanceCreation();
374     }
375
376     //@Test(groups = {"shouldBeMigratedToWorkWithSimulator"})
377     protected void testLineOfBusinessOptionalAndPlatformRequired() throws Exception {
378
379         User user = usersService.getUser(Constants.Users.SILVIA_ROBBINS_TYLER_SILVIA);
380         relogin(user.credentials);
381
382         BrowseASDCPage browseASDCPage = new BrowseASDCPage();
383         SideMenu.navigateToBrowseASDCPage();
384
385         Service service = servicesService.getService("c079d859-4d81-4add-a9c3-94551f96e2b0");
386
387         browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
388         validateServiceCreationDialog(service);
389
390         browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
391
392         assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
393         browseASDCPage.selectSubscriberById("e433710f-9217-458d-a79d-1c7aff376d89");
394
395         String serviceType = "TYLER SILVIA";
396         GeneralUIUtils.findAndWaitByText(serviceType, 30);
397
398         assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
399         browseASDCPage.selectServiceTypeByName(serviceType);
400
401         Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
402
403         browseASDCPage.clickConfirmButton();
404         assertSuccessfulServiceInstanceCreation();
405
406         browseASDCPage.clickCloseButton();
407         GeneralUIUtils.ultimateWait();
408
409         //now add the VNF
410         ViewEditPage viewEditPage = new ViewEditPage();
411
412         viewEditPage.selectNodeInstanceToAdd("VID-RODERICK-05-15-17 0");
413         viewEditPage.generateAndSetInstanceName(Constants.ViewEdit.VNF_INSTANCE_NAME_PREFIX);
414         viewEditPage.selectProductFamily("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
415         viewEditPage.selectLcpRegion("AAIAIC25", "AIC");
416         viewEditPage.selectTenant("092eb9e8e4b7412e8787dd091bc58e86");
417         viewEditPage.setLegacyRegion("llkjhlkjhlkjh");
418
419         browseASDCPage.clickConfirmButton();
420
421         GeneralUIUtils.findAndWaitByText("Missing data", 5);
422
423         Click.onFirstSelectOptionById(Constants.OwningEntity.PLATFORM_SELECT_TEST_ID);
424
425         viewEditPage.clickConfirmButton();
426         assertSuccessfulVNFCreation();
427     }
428
429     private void prepareSimulatorWithServiceModelListBeforeBrowseASDCService(){
430         SimulatorApi.clearAll();
431
432         ImmutableList<BasePreset> presets = ImmutableList.of(
433                 new PresetGetSessionSlotCheckIntervalGet(),
434                 new PresetAAIGetSubscribersGet(),
435                 new PresetAAIServiceDesignAndCreationPut(),
436                 new PresetAAIGetServicesGet());
437
438         SimulatorApi.registerExpectationFromPresets(presets, SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET);
439     }
440
441     @Test
442     private void browseSDCServiceModelListCheckAAIResponse(){
443         prepareSimulatorWithServiceModelListBeforeBrowseASDCService();
444         SideMenu.navigateToBrowseASDCPage();
445         BrowseASDCPage browseASDCPage = new BrowseASDCPage();
446         browseASDCPage.fillFilterText("CheckAAIResponse");
447         GeneralUIUtils.ultimateWait();
448
449         WebElement sdcTableElement = Get.byId("sdcModelsTable");
450         List<WebElement> sdcModelList = sdcTableElement.findElements(By.className("sdcServiceModel"));
451
452         WebElement sdcFirstModel = sdcModelList.get(0);
453         WebElement sdcSecondModel = sdcModelList.get(1);
454         WebElement sdcThirdModel = sdcModelList.get(2);
455
456         //Check uuid
457         By uuid = By.className("uuid");
458         assertEquals(modelUuid, sdcFirstModel.findElement(uuid).getText());
459         assertEquals("1dae721c-a1ef-435f-b811-760c23f467bf" , sdcSecondModel.findElement(uuid).getText());
460         assertEquals("29236d45-e790-4c17-a115-1533cc09b7b1" , sdcThirdModel.findElement(uuid).getText());
461
462         //Check invariantUUID
463         By invariantUUID = By.className("invariantUUID");
464         assertEquals(modelInvariantUUID1, sdcFirstModel.findElement(invariantUUID).getText());
465         assertEquals(modelInvariantUUID2, sdcSecondModel.findElement(invariantUUID).getText());
466         assertEquals(modelInvariantUUID3, sdcThirdModel.findElement(invariantUUID).getText());
467
468         //Check Names
469         By name = By.className("name");
470         assertEquals("CheckAAIResponse_AAAvIRC_mm779p_Service" , sdcFirstModel.findElement(name).getText());
471         assertEquals("CheckAAIResponse_BBBvIRC_mm779p_Service" , sdcSecondModel.findElement(name).getText());
472         assertEquals("CheckAAIResponse_CCCvIRC_mm779p_Service" , sdcThirdModel.findElement(name).getText());
473
474         //Check distribution Status
475         By distributionStatus = By.className("distributionStatus");
476         assertEquals("DISTRIBUTION_COMPLETE_OK" , sdcFirstModel.findElement(distributionStatus).getText());
477         assertEquals("", sdcSecondModel.findElement(distributionStatus).getText());
478         assertEquals("DISTRIBUTION_COMPLETE_ERROR" , sdcThirdModel.findElement(distributionStatus).getText());
479
480         //Check another fields
481         assertEquals("service" , sdcFirstModel.findElement(By.className("category")).getText());
482         assertEquals("1.0" , sdcFirstModel.findElement(By.className("version")).getText());
483     }
484
485     @Test
486     public void browseSdcModel_getEmptyList_noModelsMessageIsShown() {
487         resetGetServicesCache();
488         SimulatorApi.clearAll();
489         SimulatorApi.registerExpectationFromPresets(ImmutableList.of(
490                 new PresetAAIServiceDesignAndCreationPut(true),
491                 new PresetAAIGetSubscribersGet()), SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET);
492         SideMenu.navigateToBrowseASDCPage();
493         GeneralUIUtils.ultimateWait();
494         WebElement serviceModelsTbody = Get.byXpath("//table[@data-tests-id='serviceModelsTable']/tbody");
495         assertFalse(Exists.tagNameInAnotherElement(serviceModelsTbody, "tr"), "Table should be empty on empty results");
496         resetGetServicesCache();
497     }
498
499     private static final String[] macroModelsIds = {
500             "f1bde010-cc5f-4765-941f-75f15b24f9fc",
501             "lmoser410-connector-model-version-id",
502             "ipe-resource-id-ps-02",
503             "797a6c41-0f80-4d35-a288-3920c4e06baa",
504     };
505     private static final String[] alacarteModelsIds = {
506             "0903e1c0-8e03-4936-b5c2-260653b96413",
507             "666a06ee-4b57-46df-bacf-908da8f10c3f",
508             "20c4431c-246d-11e7-93ae-92361f002671",
509     };
510
511     @DataProvider
512     public static Object[][] filterOrchestrationType() {
513         return new Object[][]{{"a la carte", 3, alacarteModelsIds},{"macro", 4, macroModelsIds}};
514     }
515
516     @Test(dataProvider = "filterOrchestrationType")
517     @FeatureTogglingTest(FLAG_SHOW_ORCHESTRATION_TYPE)
518     public void browseSdcModel_filterModelsWithOrchestrationType_alacarte(
519             String orchestrationType,int numberOfOccurrence, String[] expectedModelsIds) {
520         resetGetServicesCache();
521         SimulatorApi.clearAll();
522         BrowseASDCPage browseAsdcPage = registerSimulatorAndGoToBrowseSDC();
523         GeneralUIUtils.ultimateWait();
524         assertThat(browseAsdcPage.countCurrentRowsInTable(),(Matchers.greaterThan(numberOfOccurrence)));
525         browseAsdcPage.fillFilterText(orchestrationType);
526         Assert.assertEquals(browseAsdcPage.countCurrentRowsInTable(),numberOfOccurrence);
527         for(String id : expectedModelsIds) {
528             Assert.assertTrue(browseAsdcPage.isModelWithGivenServiceUUIDVisible(id));
529         }
530         browseAsdcPage.fillFilterText("");
531     }
532
533 }