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