0671815bdd48cf600cf8d0e0a7cc48fe2639758d
[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             ModelInfo.serviceWithInstantiationTypeMacro,
178             new DeployModernUIMacroDialog()
179         );
180     }
181
182     @Test
183     private void browseServiceModel_deployServiceMacroByMACRO_SERVICESConfig_creationPopupIsOldMacro()  {
184         if (FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI.isActive() ) {
185             throw new TimeBombSkipException("skipping identify macro by uuid for awhile", "2019/11/25");
186             //also need to handle the simulator preset by using good ModelInfo instance
187         }
188         deployServiceAndAssertInstantiationType(
189                 "csar15782222_invariantUUIDMacro.zip",
190                 invariantUUIDMacro,
191                 new DeployOldMacroDialog()
192         );
193     }
194
195     @Test
196     private void browseServiceModel_deployServiceMacroWithPnf_creationPopupIsOldMacro() {
197         deployServiceAndAssertInstantiationType(
198                 "csar15782222_instantiationTypeMacroWithPnf.zip",
199                 invariantUUIDMacro,
200             new DeployOldMacroDialog()
201         );
202     }
203
204     @Test
205     public void browseServiceModel_deployServiceMacroWithCR_creationPopupIsOldMacro()  {
206         deployServiceAndAssertInstantiationType(
207             ModelInfo.collectionResourceService,
208                 FLAG_1908_COLLECTION_RESOURCE_NEW_INSTANTIATION_UI.isActive() ?
209                     new DeployModernUIMacroDialog() :
210                     new DeployOldMacroDialog()
211         );
212     }
213
214     @Test
215     private void browseServiceModel_deployServiceMacroWithNetwork_creationPopupIsMacroByFF()  {
216         deployServiceAndAssertInstantiationType(
217                 "csar15782222_instantiationTypeMacroWithNetwork.zip",
218                 invariantUUIDMacro,
219                 FLAG_NETWORK_TO_ASYNC_INSTANTIATION.isActive() ?
220                 new DeployModernUIMacroDialog() :
221                 new DeployOldMacroDialog()
222         );
223     }
224
225
226     private void deployServiceAndAssertInstantiationType(String modelZipFileName, String modelInvariantId, DeployDialogBase deployDialog)  {
227         deployServiceAndAssertInstantiationType(new ModelInfo("4d71990b-d8ad-4510-ac61-496288d9078e", modelInvariantId, modelZipFileName), deployDialog);
228     }
229
230     private void deployServiceAndAssertInstantiationType(ModelInfo modelInfo, DeployDialogBase deployDialog)  {
231
232         registerExpectationForLegacyServiceDeployment(modelInfo, "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
233         User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
234         relogin(user.credentials);
235
236         BrowseASDCPage browseASDCPage = new BrowseASDCPage();
237         SideMenu.navigateToBrowseASDCPage();
238
239         GeneralUIUtils.ultimateWait();
240         browseASDCPage.clickDeployServiceButtonByServiceUUID(modelInfo.modelVersionId);
241
242         deployDialog.waitForDialogAssertAndClose();
243     }
244
245     @FeatureTogglingTest(value = FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI, flagActive = false)
246     @Test
247     private void testServiceInstantiationAlaCarte()  {
248         User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
249         relogin(user.credentials);
250
251         registerExpectationForLegacyServiceDeployment(aLaCarteServiceCreationTest, "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
252
253         BrowseASDCPage browseASDCPage = new BrowseASDCPage();
254         SideMenu.navigateToBrowseASDCPage();
255
256         Service service = new Service(
257                 "pnf",
258                 aLaCarteServiceCreationTest.modelVersionId,
259                 aLaCarteServiceCreationTest.modelInvariantId,
260                 "action-data",
261                 "1.0",
262                 "Network L1-3",
263                 "PASQUALE vMX vPE based on Juniper 17.2 release. Updated with updated VF for v8.0 of VLM",
264                 null);
265
266
267         logger.info("Expected service model properties: "+service.toString());
268         browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
269         validateServiceCreationDialog(service);
270
271         browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
272
273         assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
274         browseASDCPage.selectSubscriberById("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
275
276         String serviceType = "Emanuel";
277         GeneralUIUtils.findAndWaitByText(serviceType, 30);
278
279         assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
280         browseASDCPage.selectServiceTypeByName(serviceType);
281
282         SelectOption.byTestIdAndVisibleText("yyy1", Constants.OwningEntity.PROJECT_SELECT_TEST_ID);
283         SelectOption.byTestIdAndVisibleText("aaa1", Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
284
285         browseASDCPage.selectSuppressRollback("false");
286
287         browseASDCPage.clickConfirmButton();
288
289         assertSuccessfulServiceInstanceCreation();
290     }
291
292     private static final String serviceName = "CONTRAIL30_L2NODHCP";
293     private static final String modelInvariantId = "5b607929-6088-4614-97ef-cac817508e0e";
294     private static final String serviceUuid = "797a6c41-0f80-4d35-a288-3920c4e06baa";
295
296
297     @DataProvider
298     public static Object[][] filterTexts() {
299         return new Object[][]{{serviceName},{modelInvariantId},{serviceUuid}};
300     }
301
302     @Test(dataProvider = "filterTexts")
303     public void testFilterOptionsInBrowseSdc(String filterText){
304         BrowseASDCPage browseAsdcPage = registerSimulatorAndGoToBrowseSDC();
305         GeneralUIUtils.ultimateWait();
306         assertThat(browseAsdcPage.countCurrentRowsInTable(),(Matchers.greaterThan(1)));
307         browseAsdcPage.fillFilterText(filterText);
308         Assert.assertEquals(browseAsdcPage.countCurrentRowsInTable(),1);
309         Assert.assertTrue(Exists.byTestId("deploy-" + serviceUuid));
310         browseAsdcPage.fillFilterText("");
311
312     }
313
314     @Test
315     private void testCategoryParamsDropdownsExistsInCreationDialog() throws Exception {
316         BrowseASDCPage browseASDCPage = registerSimulatorAndGoToBrowseSDC();
317         Service service = servicesService.getService("2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd");
318         browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
319         DeployModernUIMacroDialog deployMacroDialog = new DeployModernUIMacroDialog();
320         deployMacroDialog.waitForDialogToLoad();
321         deployMacroDialog.assertDialog();
322         deployMacroDialog.clickProjectSelect();
323         deployMacroDialog.clickOwningEntitySelect();
324     }
325
326     private BrowseASDCPage registerSimulatorAndGoToBrowseSDC() {
327         SimulatorApi.registerExpectation(SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET,
328                 "ecompportal_getSessionSlotCheckInterval.json",
329                 "browseASDC/aai_get_services.json",
330                 "browseASDC/get_sdc_catalog_services_2f80c596.json"
331         );
332         SimulatorApi.registerExpectationFromPresets(ImmutableList.of(
333                     new PresetAAIGetSubscribersGet(),
334                     new PresetAAIServiceDesignAndCreationPut()
335                 ),
336                 SimulatorApi.RegistrationStrategy.APPEND);
337         SideMenu.navigateToBrowseASDCPage();
338         return new BrowseASDCPage();
339     }
340
341     //@Test(groups = {"shouldBeMigratedToWorkWithSimulator"})
342     private void testOwningEntityRequiredAndProjectOptional() throws Exception {
343         User user = usersService.getUser(Constants.Users.SILVIA_ROBBINS_TYLER_SILVIA);
344         relogin(user.credentials);
345
346         BrowseASDCPage browseASDCPage = new BrowseASDCPage();
347         SideMenu.navigateToBrowseASDCPage();
348
349         Service service = servicesService.getService("c079d859-4d81-4add-a9c3-94551f96e2b0");
350
351         browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
352         validateServiceCreationDialog(service);
353
354         browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
355
356         assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
357         browseASDCPage.selectSubscriberById("e433710f-9217-458d-a79d-1c7aff376d89");
358
359         String serviceType = "TYLER SILVIA";
360         GeneralUIUtils.findAndWaitByText(serviceType, 30);
361
362         assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
363         browseASDCPage.selectServiceTypeByName(serviceType);
364
365         browseASDCPage.clickConfirmButton();
366
367         GeneralUIUtils.findAndWaitByText("Missing data", 5);
368
369         Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
370
371         browseASDCPage.clickConfirmButton();
372         assertSuccessfulServiceInstanceCreation();
373     }
374
375     //@Test(groups = {"shouldBeMigratedToWorkWithSimulator"})
376     protected void testLineOfBusinessOptionalAndPlatformRequired() throws Exception {
377
378         User user = usersService.getUser(Constants.Users.SILVIA_ROBBINS_TYLER_SILVIA);
379         relogin(user.credentials);
380
381         BrowseASDCPage browseASDCPage = new BrowseASDCPage();
382         SideMenu.navigateToBrowseASDCPage();
383
384         Service service = servicesService.getService("c079d859-4d81-4add-a9c3-94551f96e2b0");
385
386         browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
387         validateServiceCreationDialog(service);
388
389         browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
390
391         assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
392         browseASDCPage.selectSubscriberById("e433710f-9217-458d-a79d-1c7aff376d89");
393
394         String serviceType = "TYLER SILVIA";
395         GeneralUIUtils.findAndWaitByText(serviceType, 30);
396
397         assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
398         browseASDCPage.selectServiceTypeByName(serviceType);
399
400         Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
401
402         browseASDCPage.clickConfirmButton();
403         assertSuccessfulServiceInstanceCreation();
404
405         browseASDCPage.clickCloseButton();
406         GeneralUIUtils.ultimateWait();
407
408         //now add the VNF
409         ViewEditPage viewEditPage = new ViewEditPage();
410
411         viewEditPage.selectNodeInstanceToAdd("VID-RODERICK-05-15-17 0");
412         viewEditPage.generateAndSetInstanceName(Constants.ViewEdit.VNF_INSTANCE_NAME_PREFIX);
413         viewEditPage.selectProductFamily("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
414         viewEditPage.selectLcpRegion("AAIAIC25", "AIC");
415         viewEditPage.selectTenant("092eb9e8e4b7412e8787dd091bc58e86");
416         viewEditPage.setLegacyRegion("llkjhlkjhlkjh");
417
418         browseASDCPage.clickConfirmButton();
419
420         GeneralUIUtils.findAndWaitByText("Missing data", 5);
421
422         Click.onFirstSelectOptionById(Constants.OwningEntity.PLATFORM_SELECT_TEST_ID);
423
424         viewEditPage.clickConfirmButton();
425         assertSuccessfulVNFCreation();
426     }
427
428     private void prepareSimulatorWithServiceModelListBeforeBrowseASDCService(){
429         SimulatorApi.clearAll();
430
431         ImmutableList<BasePreset> presets = ImmutableList.of(
432                 new PresetGetSessionSlotCheckIntervalGet(),
433                 new PresetAAIGetSubscribersGet(),
434                 new PresetAAIServiceDesignAndCreationPut(),
435                 new PresetAAIGetServicesGet());
436
437         SimulatorApi.registerExpectationFromPresets(presets, SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET);
438     }
439
440     @Test
441     private void browseSDCServiceModelListCheckAAIResponse(){
442         prepareSimulatorWithServiceModelListBeforeBrowseASDCService();
443         SideMenu.navigateToBrowseASDCPage();
444         BrowseASDCPage browseASDCPage = new BrowseASDCPage();
445         browseASDCPage.fillFilterText("CheckAAIResponse");
446         GeneralUIUtils.ultimateWait();
447
448         WebElement sdcTableElement = Get.byId("sdcModelsTable");
449         List<WebElement> sdcModelList = sdcTableElement.findElements(By.className("sdcServiceModel"));
450
451         WebElement sdcFirstModel = sdcModelList.get(0);
452         WebElement sdcSecondModel = sdcModelList.get(1);
453         WebElement sdcThirdModel = sdcModelList.get(2);
454
455         //Check uuid
456         By uuid = By.className("uuid");
457         assertEquals(modelUuid, sdcFirstModel.findElement(uuid).getText());
458         assertEquals("1dae721c-a1ef-435f-b811-760c23f467bf" , sdcSecondModel.findElement(uuid).getText());
459         assertEquals("29236d45-e790-4c17-a115-1533cc09b7b1" , sdcThirdModel.findElement(uuid).getText());
460
461         //Check invariantUUID
462         By invariantUUID = By.className("invariantUUID");
463         assertEquals(modelInvariantUUID1, sdcFirstModel.findElement(invariantUUID).getText());
464         assertEquals(modelInvariantUUID2, sdcSecondModel.findElement(invariantUUID).getText());
465         assertEquals(modelInvariantUUID3, sdcThirdModel.findElement(invariantUUID).getText());
466
467         //Check Names
468         By name = By.className("name");
469         assertEquals("CheckAAIResponse_AAAvIRC_mm779p_Service" , sdcFirstModel.findElement(name).getText());
470         assertEquals("CheckAAIResponse_BBBvIRC_mm779p_Service" , sdcSecondModel.findElement(name).getText());
471         assertEquals("CheckAAIResponse_CCCvIRC_mm779p_Service" , sdcThirdModel.findElement(name).getText());
472
473         //Check distribution Status
474         By distributionStatus = By.className("distributionStatus");
475         assertEquals("DISTRIBUTION_COMPLETE_OK" , sdcFirstModel.findElement(distributionStatus).getText());
476         assertEquals("", sdcSecondModel.findElement(distributionStatus).getText());
477         assertEquals("DISTRIBUTION_COMPLETE_ERROR" , sdcThirdModel.findElement(distributionStatus).getText());
478
479         //Check another fields
480         assertEquals("service" , sdcFirstModel.findElement(By.className("category")).getText());
481         assertEquals("1.0" , sdcFirstModel.findElement(By.className("version")).getText());
482     }
483
484     @Test
485     public void browseSdcModel_getEmptyList_noModelsMessageIsShown() {
486         resetGetServicesCache();
487         SimulatorApi.clearAll();
488         SimulatorApi.registerExpectationFromPresets(ImmutableList.of(
489                 new PresetAAIServiceDesignAndCreationPut(true),
490                 new PresetAAIGetSubscribersGet()), SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET);
491         SideMenu.navigateToBrowseASDCPage();
492         GeneralUIUtils.ultimateWait();
493         WebElement serviceModelsTbody = Get.byXpath("//table[@data-tests-id='serviceModelsTable']/tbody");
494         assertFalse(Exists.tagNameInAnotherElement(serviceModelsTbody, "tr"), "Table should be empty on empty results");
495         resetGetServicesCache();
496     }
497
498     private static final String[] macroModelsIds = {
499             "f1bde010-cc5f-4765-941f-75f15b24f9fc",
500             "lmoser410-connector-model-version-id",
501             "ipe-resource-id-ps-02",
502             "797a6c41-0f80-4d35-a288-3920c4e06baa",
503     };
504     private static final String[] alacarteModelsIds = {
505             "0903e1c0-8e03-4936-b5c2-260653b96413",
506             "666a06ee-4b57-46df-bacf-908da8f10c3f",
507             "20c4431c-246d-11e7-93ae-92361f002671",
508     };
509
510     @DataProvider
511     public static Object[][] filterOrchestrationType() {
512         return new Object[][]{{"a la carte", 3, alacarteModelsIds},{"macro", 4, macroModelsIds}};
513     }
514
515     @Test(dataProvider = "filterOrchestrationType")
516     @FeatureTogglingTest(FLAG_SHOW_ORCHESTRATION_TYPE)
517     public void browseSdcModel_filterModelsWithOrchestrationType_alacarte(
518             String orchestrationType,int numberOfOccurrence, String[] expectedModelsIds) {
519         resetGetServicesCache();
520         SimulatorApi.clearAll();
521         BrowseASDCPage browseAsdcPage = registerSimulatorAndGoToBrowseSDC();
522         GeneralUIUtils.ultimateWait();
523         assertThat(browseAsdcPage.countCurrentRowsInTable(),(Matchers.greaterThan(numberOfOccurrence)));
524         browseAsdcPage.fillFilterText(orchestrationType);
525         Assert.assertEquals(browseAsdcPage.countCurrentRowsInTable(),numberOfOccurrence);
526         for(String id : expectedModelsIds) {
527             Assert.assertTrue(browseAsdcPage.isModelWithGivenServiceUUIDVisible(id));
528         }
529         browseAsdcPage.fillFilterText("");
530     }
531
532 }