1 package vid.automation.test.test;
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_2002_IDENTIFY_INVARIANT_MACRO_UUID_BY_BACKEND;
9 import static vid.automation.test.infra.Features.FLAG_5G_IN_NEW_INSTANTIATION_UI;
10 import static vid.automation.test.infra.Features.FLAG_NETWORK_TO_ASYNC_INSTANTIATION;
11 import static vid.automation.test.infra.Features.FLAG_SHOW_ORCHESTRATION_TYPE;
12 import static vid.automation.test.infra.ModelInfo.aLaCarteForBrowseSdc;
13 import static vid.automation.test.infra.ModelInfo.aLaCarteServiceCreationTest;
14 import static vid.automation.test.infra.ModelInfo.instantiationTypeAlacarte_vidNotionsInstantiationUIByUUID;
15 import static vid.automation.test.infra.ModelInfo.macroForBrowseSdc;
17 import com.google.common.collect.ImmutableList;
18 import java.util.List;
19 import org.apache.logging.log4j.LogManager;
20 import org.apache.logging.log4j.Logger;
21 import org.hamcrest.Matchers;
22 import org.jetbrains.annotations.NotNull;
23 import org.onap.sdc.ci.tests.datatypes.UserCredentials;
24 import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
25 import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset;
26 import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetServicesGet;
27 import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet;
28 import org.onap.simulator.presetGenerator.presets.aai.PresetAAIServiceDesignAndCreationPut;
29 import org.onap.simulator.presetGenerator.presets.ecompportal_att.PresetGetSessionSlotCheckIntervalGet;
30 import org.openqa.selenium.By;
31 import org.openqa.selenium.WebElement;
32 import org.testng.Assert;
33 import org.testng.SkipException;
34 import org.testng.annotations.BeforeClass;
35 import org.testng.annotations.BeforeMethod;
36 import org.testng.annotations.DataProvider;
37 import org.testng.annotations.Test;
38 import vid.automation.test.Constants;
39 import vid.automation.test.infra.Click;
40 import vid.automation.test.infra.Exists;
41 import vid.automation.test.infra.FeatureTogglingTest;
42 import vid.automation.test.infra.Get;
43 import vid.automation.test.infra.ModelInfo;
44 import vid.automation.test.infra.SelectOption;
45 import vid.automation.test.model.Service;
46 import vid.automation.test.model.User;
47 import vid.automation.test.sections.BrowseASDCPage;
48 import vid.automation.test.sections.SideMenu;
49 import vid.automation.test.sections.ViewEditPage;
50 import vid.automation.test.sections.deploy.DeployDialogBase;
51 import vid.automation.test.sections.deploy.DeployModernUIALaCarteDialog;
52 import vid.automation.test.sections.deploy.DeployModernUIMacroDialog;
53 import vid.automation.test.sections.deploy.DeployOldALaCarteDialog;
54 import vid.automation.test.sections.deploy.DeployOldMacroDialog;
55 import vid.automation.test.services.ServicesService;
56 import vid.automation.test.services.SimulatorApi;
59 public class BrowseASDCTest extends CreateInstanceDialogBaseTest {
60 private final String invariantUUIDAlacarte = aLaCarteForBrowseSdc.modelInvariantId;
61 private final String invariantUUIDMacro = macroForBrowseSdc.modelInvariantId;
62 public static final String modelInvariantUUID1 = "aeababbc-010b-4a60-8df7-e64c07389466";
63 public static final String modelInvariantUUID2 = "aa2f8e9c-9e47-4b15-a95c-4a9385599abc";
64 public static final String modelInvariantUUID3 = "d849c57d-b6fe-4843-8349-4ab8bbb08d71";
65 public static final String modelUuid = "a8dcd72d-d44d-44f2-aa85-53aa9ca99cba";
67 private ServicesService servicesService = new ServicesService();
69 private final Logger logger = LogManager.getLogger(BrowseASDCTest.class);
72 public void beforeClass() {
73 resetGetServicesCache();
77 public void resetSdcModelCaches() {
78 invalidateSdcModelsCache();
82 protected UserCredentials getUserCredentials() {
83 User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
84 return new UserCredentials(user.credentials.userId, user.credentials.password, Constants.Users.EMANUEL_EMANUEL, "", "");
87 //@Test(groups = {"shouldBeMigratedToWorkWithSimulator"})
88 public void testPNFOnCreatePopup() {
89 Service service = servicesService.getService("f39389e4-2a9c-4085-8ac3-04aea9c651be");
90 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
91 SideMenu.navigateToBrowseASDCPage();
92 browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
93 assertThatServiceCreationDialogIsVisible();
94 validatePNFCreationDialog(service, "Emanuel", "pnf");
97 private void validatePNFCreationDialog(Service service, String serviceType, String serviceRole) {
98 assertServiceMetadata(serviceType, Constants.SERVICE_TYPE);
99 assertServiceMetadata(serviceRole, Constants.SERVICE_ROLE);
100 validateServiceCreationDialog(service);
105 //@Test(groups = {"shouldBeMigratedToWorkWithSimulator"})
106 private void testPNFMacroInstantation() throws Exception {
107 User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
108 relogin(user.credentials);
110 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
111 SideMenu.navigateToBrowseASDCPage();
112 browseASDCPage.clickDeployServiceButtonByServiceUUID("f39389e4-2a9c-4085-8ac3-04aea9c651be");
113 assertThatServiceCreationDialogIsVisible();
114 assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
115 browseASDCPage.selectSubscriberById("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
116 browseASDCPage.selectProductFamily("ebc3bc3d-62fd-4a3f-a037-f619df4ff034");
117 GeneralUIUtils.ultimateWait();
119 browseASDCPage.selectServiceTypeByName("Emanuel");
120 GeneralUIUtils.ultimateWait();
121 browseASDCPage.selectLcpRegion("hvf16");
123 browseASDCPage.selectTenant("a259ae7b7c3f493cb3d91f95a7c18149");
124 assertAllIsPermitted(Constants.BrowseASDC.AIC_OPTION_CLASS);
125 browseASDCPage.selectAicZone("NFT1");
127 Click.onFirstSelectOptionById(Constants.OwningEntity.PROJECT_SELECT_TEST_ID);
128 Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
130 browseASDCPage.clickConfirmButton();
132 assertSuccessfulServiceInstanceCreation();
134 browseASDCPage.clickCloseButton();
136 ViewEditPage viewEditPage = new ViewEditPage();
137 viewEditPage.clickActivateButton();
141 private void browseServiceModel_deployServiceALaCarteByBackendInput_creationPopupIsALaCarte() {
142 // model uuid should be of macro
143 deployServiceAndAssertInstantiationType(
144 "csar15782222_instantiationTypeAlacarte_invariantUUIDMacro.zip",
146 getAlacarteDialogByFlagValue()
151 public static DeployDialogBase getAlacarteDialogByFlagValue() {
152 return FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI.isActive() ?
153 new DeployModernUIALaCarteDialog() :
154 new DeployOldALaCarteDialog();
158 @FeatureTogglingTest(FLAG_5G_IN_NEW_INSTANTIATION_UI)
159 private void browseServiceModel_deployServiceALaCarteByBackendInputHintNewUI_creationPopupIsAngular2() {
160 deployServiceAndAssertInstantiationType(
161 instantiationTypeAlacarte_vidNotionsInstantiationUIByUUID,
162 new DeployModernUIALaCarteDialog()
167 private void browseServiceModel_deployServiceALaCarteBecauseNotOnMACRO_SERVICESConfig_creationPopupIsALaCarte() {
168 deployServiceAndAssertInstantiationType(
169 "csar15782222_instantiationTypeEmpty_invariantUUIDAlacarte.zip",
170 invariantUUIDAlacarte,
171 getAlacarteDialogByFlagValue()
176 private void browseServiceModel_deployServiceMacroByBackendInput_creationPopupIsMacro() {
177 deployServiceAndAssertInstantiationType(
178 ModelInfo.serviceWithInstantiationTypeMacro,
179 new DeployModernUIMacroDialog()
184 private void browseServiceModel_deployServiceMacroByMACRO_SERVICESConfig_creationPopupIsOldMacro() {
185 if (FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI.isActive() &&
186 ! FLAG_2002_IDENTIFY_INVARIANT_MACRO_UUID_BY_BACKEND.isActive()) {
187 throw new SkipException("some 2002 flags shall come along together");
189 deployServiceAndAssertInstantiationType(
190 "csar15782222_invariantUUIDMacro.zip",
192 new DeployOldMacroDialog()
197 private void browseServiceModel_deployServiceMacroWithPnf_creationPopupIsOldMacro() {
198 deployServiceAndAssertInstantiationType(
199 "csar15782222_instantiationTypeMacroWithPnf.zip",
201 new DeployOldMacroDialog()
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()
216 private void browseServiceModel_deployServiceMacroWithNetwork_creationPopupIsMacroByFF() {
217 deployServiceAndAssertInstantiationType(
218 "csar15782222_instantiationTypeMacroWithNetwork.zip",
220 FLAG_NETWORK_TO_ASYNC_INSTANTIATION.isActive() ?
221 new DeployModernUIMacroDialog() :
222 new DeployOldMacroDialog()
227 private void deployServiceAndAssertInstantiationType(String modelZipFileName, String modelInvariantId, DeployDialogBase deployDialog) {
228 deployServiceAndAssertInstantiationType(new ModelInfo("4d71990b-d8ad-4510-ac61-496288d9078e", modelInvariantId, modelZipFileName), deployDialog);
231 private void deployServiceAndAssertInstantiationType(ModelInfo modelInfo, DeployDialogBase deployDialog) {
233 registerExpectationForLegacyServiceDeployment(modelInfo, "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
234 User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
235 relogin(user.credentials);
237 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
238 SideMenu.navigateToBrowseASDCPage();
240 GeneralUIUtils.ultimateWait();
241 browseASDCPage.clickDeployServiceButtonByServiceUUID(modelInfo.modelVersionId);
243 deployDialog.waitForDialogAssertAndClose();
246 @FeatureTogglingTest(value = FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI, flagActive = false)
248 private void testServiceInstantiationAlaCarte() {
249 User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
250 relogin(user.credentials);
252 registerExpectationForLegacyServiceDeployment(aLaCarteServiceCreationTest, "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
254 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
255 SideMenu.navigateToBrowseASDCPage();
257 Service service = new Service(
259 aLaCarteServiceCreationTest.modelVersionId,
260 aLaCarteServiceCreationTest.modelInvariantId,
264 "PASQUALE vMX vPE based on Juniper 17.2 release. Updated with updated VF for v8.0 of VLM",
268 logger.info("Expected service model properties: "+service.toString());
269 browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
270 validateServiceCreationDialog(service);
272 browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
274 assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
275 browseASDCPage.selectSubscriberById("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
277 String serviceType = "Emanuel";
278 GeneralUIUtils.findAndWaitByText(serviceType, 30);
280 assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
281 browseASDCPage.selectServiceTypeByName(serviceType);
283 SelectOption.byTestIdAndVisibleText("yyy1", Constants.OwningEntity.PROJECT_SELECT_TEST_ID);
284 SelectOption.byTestIdAndVisibleText("aaa1", Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
286 browseASDCPage.selectSuppressRollback("false");
288 browseASDCPage.clickConfirmButton();
290 assertSuccessfulServiceInstanceCreation();
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";
299 public static Object[][] filterTexts() {
300 return new Object[][]{{serviceName},{modelInvariantId},{serviceUuid}};
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("");
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();
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"
333 SimulatorApi.registerExpectationFromPresets(ImmutableList.of(
334 new PresetAAIGetSubscribersGet(),
335 new PresetAAIServiceDesignAndCreationPut()
337 SimulatorApi.RegistrationStrategy.APPEND);
338 SideMenu.navigateToBrowseASDCPage();
339 return new BrowseASDCPage();
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);
347 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
348 SideMenu.navigateToBrowseASDCPage();
350 Service service = servicesService.getService("c079d859-4d81-4add-a9c3-94551f96e2b0");
352 browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
353 validateServiceCreationDialog(service);
355 browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
357 assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
358 browseASDCPage.selectSubscriberById("e433710f-9217-458d-a79d-1c7aff376d89");
360 String serviceType = "TYLER SILVIA";
361 GeneralUIUtils.findAndWaitByText(serviceType, 30);
363 assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
364 browseASDCPage.selectServiceTypeByName(serviceType);
366 browseASDCPage.clickConfirmButton();
368 GeneralUIUtils.findAndWaitByText("Missing data", 5);
370 Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
372 browseASDCPage.clickConfirmButton();
373 assertSuccessfulServiceInstanceCreation();
376 //@Test(groups = {"shouldBeMigratedToWorkWithSimulator"})
377 protected void testLineOfBusinessOptionalAndPlatformRequired() throws Exception {
379 User user = usersService.getUser(Constants.Users.SILVIA_ROBBINS_TYLER_SILVIA);
380 relogin(user.credentials);
382 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
383 SideMenu.navigateToBrowseASDCPage();
385 Service service = servicesService.getService("c079d859-4d81-4add-a9c3-94551f96e2b0");
387 browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
388 validateServiceCreationDialog(service);
390 browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
392 assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
393 browseASDCPage.selectSubscriberById("e433710f-9217-458d-a79d-1c7aff376d89");
395 String serviceType = "TYLER SILVIA";
396 GeneralUIUtils.findAndWaitByText(serviceType, 30);
398 assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
399 browseASDCPage.selectServiceTypeByName(serviceType);
401 Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
403 browseASDCPage.clickConfirmButton();
404 assertSuccessfulServiceInstanceCreation();
406 browseASDCPage.clickCloseButton();
407 GeneralUIUtils.ultimateWait();
410 ViewEditPage viewEditPage = new ViewEditPage();
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");
419 browseASDCPage.clickConfirmButton();
421 GeneralUIUtils.findAndWaitByText("Missing data", 5);
422 SelectOption.selectFirstTwoOptionsFromMultiselectById("multi-selectPlatform");
424 viewEditPage.clickConfirmButton();
425 assertSuccessfulVNFCreation();
428 private void prepareSimulatorWithServiceModelListBeforeBrowseASDCService(){
429 SimulatorApi.clearAll();
431 ImmutableList<BasePreset> presets = ImmutableList.of(
432 new PresetGetSessionSlotCheckIntervalGet(),
433 new PresetAAIGetSubscribersGet(),
434 new PresetAAIServiceDesignAndCreationPut(),
435 new PresetAAIGetServicesGet());
437 SimulatorApi.registerExpectationFromPresets(presets, SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET);
441 private void browseSDCServiceModelListCheckAAIResponse(){
442 prepareSimulatorWithServiceModelListBeforeBrowseASDCService();
443 SideMenu.navigateToBrowseASDCPage();
444 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
445 browseASDCPage.fillFilterText("CheckAAIResponse");
446 GeneralUIUtils.ultimateWait();
448 WebElement sdcTableElement = Get.byId("sdcModelsTable");
449 List<WebElement> sdcModelList = sdcTableElement.findElements(By.className("sdcServiceModel"));
451 WebElement sdcFirstModel = sdcModelList.get(0);
452 WebElement sdcSecondModel = sdcModelList.get(1);
453 WebElement sdcThirdModel = sdcModelList.get(2);
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());
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());
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());
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());
479 //Check another fields
480 assertEquals("service" , sdcFirstModel.findElement(By.className("category")).getText());
481 assertEquals("1.0" , sdcFirstModel.findElement(By.className("version")).getText());
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();
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",
504 private static final String[] alacarteModelsIds = {
505 "0903e1c0-8e03-4936-b5c2-260653b96413",
506 "666a06ee-4b57-46df-bacf-908da8f10c3f",
507 "20c4431c-246d-11e7-93ae-92361f002671",
511 public static Object[][] filterOrchestrationType() {
512 return new Object[][]{{"a la carte", 3, alacarteModelsIds},{"macro", 4, macroModelsIds}};
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));
529 browseAsdcPage.fillFilterText("");