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_2004_TEMP_BUTTON_TO_INSTANTIATION_STATUS_FILTER;
10 import static vid.automation.test.infra.Features.FLAG_5G_IN_NEW_INSTANTIATION_UI;
11 import static vid.automation.test.infra.Features.FLAG_NETWORK_TO_ASYNC_INSTANTIATION;
12 import static vid.automation.test.infra.Features.FLAG_SHOW_ORCHESTRATION_TYPE;
13 import static vid.automation.test.infra.ModelInfo.aLaCarteForBrowseSdc;
14 import static vid.automation.test.infra.ModelInfo.aLaCarteServiceCreationTest;
15 import static vid.automation.test.infra.ModelInfo.instantiationTypeAlacarte_vidNotionsInstantiationUIByUUID;
16 import static vid.automation.test.infra.ModelInfo.macroForBrowseSdc;
17 import static vid.automation.test.sections.VidBasePage.goOutFromIframe;
18 import static vid.automation.test.sections.VidBasePage.goToIframe;
20 import com.google.common.collect.ImmutableList;
21 import java.util.List;
22 import org.apache.logging.log4j.LogManager;
23 import org.apache.logging.log4j.Logger;
24 import org.hamcrest.Matchers;
25 import org.jetbrains.annotations.NotNull;
26 import org.onap.sdc.ci.tests.datatypes.UserCredentials;
27 import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
28 import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset;
29 import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetServicesGet;
30 import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet;
31 import org.onap.simulator.presetGenerator.presets.aai.PresetAAIServiceDesignAndCreationPut;
32 import org.onap.simulator.presetGenerator.presets.ecompportal_att.PresetGetSessionSlotCheckIntervalGet;
33 import org.openqa.selenium.By;
34 import org.openqa.selenium.WebElement;
35 import org.testng.Assert;
36 import org.testng.SkipException;
37 import org.testng.annotations.BeforeClass;
38 import org.testng.annotations.BeforeMethod;
39 import org.testng.annotations.DataProvider;
40 import org.testng.annotations.Test;
41 import vid.automation.test.Constants;
42 import vid.automation.test.infra.Click;
43 import vid.automation.test.infra.Exists;
44 import vid.automation.test.infra.FeatureTogglingTest;
45 import vid.automation.test.infra.Get;
46 import vid.automation.test.infra.ModelInfo;
47 import vid.automation.test.infra.SelectOption;
48 import vid.automation.test.model.Service;
49 import vid.automation.test.model.User;
50 import vid.automation.test.sections.BrowseASDCPage;
51 import vid.automation.test.sections.InstantiationStatusPage;
52 import vid.automation.test.sections.SideMenu;
53 import vid.automation.test.sections.ViewEditPage;
54 import vid.automation.test.sections.deploy.DeployDialogBase;
55 import vid.automation.test.sections.deploy.DeployModernUIALaCarteDialog;
56 import vid.automation.test.sections.deploy.DeployModernUIMacroDialog;
57 import vid.automation.test.sections.deploy.DeployOldALaCarteDialog;
58 import vid.automation.test.sections.deploy.DeployOldMacroDialog;
59 import vid.automation.test.services.ServicesService;
60 import vid.automation.test.services.SimulatorApi;
63 public class BrowseASDCTest extends CreateInstanceDialogBaseTest {
64 private final String invariantUUIDAlacarte = aLaCarteForBrowseSdc.modelInvariantId;
65 private final String invariantUUIDMacro = macroForBrowseSdc.modelInvariantId;
66 public static final String modelInvariantUUID1 = "aeababbc-010b-4a60-8df7-e64c07389466";
67 public static final String modelInvariantUUID2 = "aa2f8e9c-9e47-4b15-a95c-4a9385599abc";
68 public static final String modelInvariantUUID3 = "d849c57d-b6fe-4843-8349-4ab8bbb08d71";
69 public static final String modelUuid = "a8dcd72d-d44d-44f2-aa85-53aa9ca99cba";
71 private ServicesService servicesService = new ServicesService();
73 private final Logger logger = LogManager.getLogger(BrowseASDCTest.class);
76 public void beforeClass() {
77 resetGetServicesCache();
81 public void resetSdcModelCaches() {
82 invalidateSdcModelsCache();
86 protected UserCredentials getUserCredentials() {
87 User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
88 return new UserCredentials(user.credentials.userId, user.credentials.password, Constants.Users.EMANUEL_EMANUEL, "", "");
91 //@Test(groups = {"shouldBeMigratedToWorkWithSimulator"})
92 public void testPNFOnCreatePopup() {
93 Service service = servicesService.getService("f39389e4-2a9c-4085-8ac3-04aea9c651be");
94 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
95 SideMenu.navigateToBrowseASDCPage();
96 browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
97 assertThatServiceCreationDialogIsVisible();
98 validatePNFCreationDialog(service, "Emanuel", "pnf");
101 private void validatePNFCreationDialog(Service service, String serviceType, String serviceRole) {
102 assertServiceMetadata(serviceType, Constants.SERVICE_TYPE);
103 assertServiceMetadata(serviceRole, Constants.SERVICE_ROLE);
104 validateServiceCreationDialog(service);
109 //@Test(groups = {"shouldBeMigratedToWorkWithSimulator"})
110 private void testPNFMacroInstantation() throws Exception {
111 User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
112 relogin(user.credentials);
114 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
115 SideMenu.navigateToBrowseASDCPage();
116 browseASDCPage.clickDeployServiceButtonByServiceUUID("f39389e4-2a9c-4085-8ac3-04aea9c651be");
117 assertThatServiceCreationDialogIsVisible();
118 assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
119 browseASDCPage.selectSubscriberById("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
120 browseASDCPage.selectProductFamily("ebc3bc3d-62fd-4a3f-a037-f619df4ff034");
121 GeneralUIUtils.ultimateWait();
123 browseASDCPage.selectServiceTypeByName("Emanuel");
124 GeneralUIUtils.ultimateWait();
125 browseASDCPage.selectLcpRegion("hvf16");
127 browseASDCPage.selectTenant("a259ae7b7c3f493cb3d91f95a7c18149");
128 assertAllIsPermitted(Constants.BrowseASDC.AIC_OPTION_CLASS);
129 browseASDCPage.selectAicZone("NFT1");
131 Click.onFirstSelectOptionById(Constants.OwningEntity.PROJECT_SELECT_TEST_ID);
132 Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
134 browseASDCPage.clickConfirmButton();
136 assertSuccessfulServiceInstanceCreation();
138 browseASDCPage.clickCloseButton();
140 ViewEditPage viewEditPage = new ViewEditPage();
141 viewEditPage.clickActivateButton();
145 private void browseServiceModel_deployServiceALaCarteByBackendInput_creationPopupIsALaCarte() {
146 // model uuid should be of macro
147 deployServiceAndAssertInstantiationType(
148 "csar15782222_instantiationTypeAlacarte_invariantUUIDMacro.zip",
150 getAlacarteDialogByFlagValue()
155 public static DeployDialogBase getAlacarteDialogByFlagValue() {
156 return FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI.isActive() ?
157 new DeployModernUIALaCarteDialog() :
158 new DeployOldALaCarteDialog();
162 @FeatureTogglingTest(FLAG_5G_IN_NEW_INSTANTIATION_UI)
163 private void browseServiceModel_deployServiceALaCarteByBackendInputHintNewUI_creationPopupIsAngular2() {
164 deployServiceAndAssertInstantiationType(
165 instantiationTypeAlacarte_vidNotionsInstantiationUIByUUID,
166 new DeployModernUIALaCarteDialog()
171 private void browseServiceModel_deployServiceALaCarteBecauseNotOnMACRO_SERVICESConfig_creationPopupIsALaCarte() {
172 deployServiceAndAssertInstantiationType(
173 "csar15782222_instantiationTypeEmpty_invariantUUIDAlacarte.zip",
174 invariantUUIDAlacarte,
175 getAlacarteDialogByFlagValue()
180 private void browseServiceModel_deployServiceMacroByBackendInput_creationPopupIsMacro() {
181 deployServiceAndAssertInstantiationType(
182 ModelInfo.serviceWithInstantiationTypeMacro,
183 new DeployModernUIMacroDialog()
188 private void browseServiceModel_deployServiceMacroByMACRO_SERVICESConfig_creationPopupIsOldMacro() {
189 if (FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI.isActive() &&
190 ! FLAG_2002_IDENTIFY_INVARIANT_MACRO_UUID_BY_BACKEND.isActive()) {
191 throw new SkipException("some 2002 flags shall come along together");
193 deployServiceAndAssertInstantiationType(
194 "csar15782222_invariantUUIDMacro.zip",
196 new DeployOldMacroDialog()
201 private void browseServiceModel_deployServiceMacroWithPnf_creationPopupIsOldMacro() {
202 deployServiceAndAssertInstantiationType(
203 "csar15782222_instantiationTypeMacroWithPnf.zip",
205 new DeployOldMacroDialog()
210 public void browseServiceModel_deployServiceMacroWithCR_creationPopupIsOldMacro() {
211 deployServiceAndAssertInstantiationType(
212 ModelInfo.collectionResourceService,
213 FLAG_1908_COLLECTION_RESOURCE_NEW_INSTANTIATION_UI.isActive() ?
214 new DeployModernUIMacroDialog() :
215 new DeployOldMacroDialog()
220 private void browseServiceModel_deployServiceMacroWithNetwork_creationPopupIsMacroByFF() {
221 deployServiceAndAssertInstantiationType(
222 "csar15782222_instantiationTypeMacroWithNetwork.zip",
224 FLAG_NETWORK_TO_ASYNC_INSTANTIATION.isActive() ?
225 new DeployModernUIMacroDialog() :
226 new DeployOldMacroDialog()
231 private void deployServiceAndAssertInstantiationType(String modelZipFileName, String modelInvariantId, DeployDialogBase deployDialog) {
232 deployServiceAndAssertInstantiationType(new ModelInfo("4d71990b-d8ad-4510-ac61-496288d9078e", modelInvariantId, modelZipFileName), deployDialog);
235 private void deployServiceAndAssertInstantiationType(ModelInfo modelInfo, DeployDialogBase deployDialog) {
237 registerExpectationForLegacyServiceDeployment(modelInfo, "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
238 User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
239 relogin(user.credentials);
241 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
242 SideMenu.navigateToBrowseASDCPage();
244 GeneralUIUtils.ultimateWait();
245 browseASDCPage.clickDeployServiceButtonByServiceUUID(modelInfo.modelVersionId);
247 deployDialog.waitForDialogAssertAndClose();
250 @FeatureTogglingTest(value = FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI, flagActive = false)
252 private void testServiceInstantiationAlaCarte() {
253 User user = usersService.getUser(Constants.Users.EMANUEL_EMANUEL);
254 relogin(user.credentials);
256 registerExpectationForLegacyServiceDeployment(aLaCarteServiceCreationTest, "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
258 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
259 SideMenu.navigateToBrowseASDCPage();
261 Service service = new Service(
263 aLaCarteServiceCreationTest.modelVersionId,
264 aLaCarteServiceCreationTest.modelInvariantId,
268 "PASQUALE vMX vPE based on Juniper 17.2 release. Updated with updated VF for v8.0 of VLM",
272 logger.info("Expected service model properties: "+service.toString());
273 browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
274 validateServiceCreationDialog(service);
276 browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
278 assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
279 browseASDCPage.selectSubscriberById("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
281 String serviceType = "Emanuel";
282 GeneralUIUtils.findAndWaitByText(serviceType, 30);
284 assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
285 browseASDCPage.selectServiceTypeByName(serviceType);
287 SelectOption.byTestIdAndVisibleText("yyy1", Constants.OwningEntity.PROJECT_SELECT_TEST_ID);
288 SelectOption.byTestIdAndVisibleText("aaa1", Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
290 browseASDCPage.selectSuppressRollback("false");
292 browseASDCPage.clickConfirmButton();
294 assertSuccessfulServiceInstanceCreation();
297 private static final String serviceName = "CONTRAIL30_L2NODHCP";
298 private static final String modelInvariantId = "5b607929-6088-4614-97ef-cac817508e0e";
299 private static final String serviceUuid = "797a6c41-0f80-4d35-a288-3920c4e06baa";
303 public static Object[][] filterTexts() {
304 return new Object[][]{
310 @Test(dataProvider = "filterTexts")
311 public void testFilterOptionsInBrowseSdc(String filterText){
312 BrowseASDCPage browseAsdcPage = registerSimulatorAndGoToBrowseSDC();
313 GeneralUIUtils.ultimateWait();
314 assertThat(browseAsdcPage.countCurrentRowsInTable(),(Matchers.greaterThan(1)));
315 browseAsdcPage.fillFilterText(filterText);
316 Assert.assertEquals(browseAsdcPage.countCurrentRowsInTable(),1);
317 Assert.assertTrue(Exists.byTestId("deploy-" + serviceUuid));
318 browseAsdcPage.fillFilterText("");
323 private void testCategoryParamsDropdownsExistsInCreationDialog() throws Exception {
324 String serviceId = "2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd";
326 DeployModernUIMacroDialog deployMacroDialog = getDeployModernUIMacroDialog(serviceId);
327 deployMacroDialog.assertDialog();
328 deployMacroDialog.clickProjectSelect();
329 deployMacroDialog.clickOwningEntitySelect();
332 private DeployModernUIMacroDialog getDeployModernUIMacroDialog(String serviceId) {
333 BrowseASDCPage browseASDCPage = registerSimulatorAndGoToBrowseSDC();
334 Service service = servicesService.getService(serviceId);
335 browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
336 DeployModernUIMacroDialog deployMacroDialog = new DeployModernUIMacroDialog();
337 deployMacroDialog.waitForDialogToLoad();
338 return deployMacroDialog;
342 @FeatureTogglingTest(FLAG_2004_TEMP_BUTTON_TO_INSTANTIATION_STATUS_FILTER)
343 public void testClickPreviousInstantiationsInCreationDialog() {
345 String serviceId = "2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd";
346 DeployModernUIMacroDialog deployMacroDialog = getDeployModernUIMacroDialog(serviceId);
347 deployMacroDialog.clickPreviousInstantiationButton();
349 //exit form deploy dialog
351 //go into Instantiation Status page
354 InstantiationStatusPage.verifyInstantiationStatusFilterValue(serviceId);
361 private BrowseASDCPage registerSimulatorAndGoToBrowseSDC() {
362 SimulatorApi.registerExpectation(SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET,
363 "ecompportal_getSessionSlotCheckInterval.json",
364 "browseASDC/aai_get_services.json",
365 "browseASDC/get_sdc_catalog_services_2f80c596.json"
367 SimulatorApi.registerExpectationFromPresets(ImmutableList.of(
368 new PresetAAIGetSubscribersGet(),
369 new PresetAAIServiceDesignAndCreationPut()
371 SimulatorApi.RegistrationStrategy.APPEND);
372 SideMenu.navigateToBrowseASDCPage();
373 return new BrowseASDCPage();
376 //@Test(groups = {"shouldBeMigratedToWorkWithSimulator"})
377 private void testOwningEntityRequiredAndProjectOptional() throws Exception {
378 User user = usersService.getUser(Constants.Users.SILVIA_ROBBINS_TYLER_SILVIA);
379 relogin(user.credentials);
381 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
382 SideMenu.navigateToBrowseASDCPage();
384 Service service = servicesService.getService("c079d859-4d81-4add-a9c3-94551f96e2b0");
386 browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
387 validateServiceCreationDialog(service);
389 browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
391 assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
392 browseASDCPage.selectSubscriberById("e433710f-9217-458d-a79d-1c7aff376d89");
394 String serviceType = "TYLER SILVIA";
395 GeneralUIUtils.findAndWaitByText(serviceType, 30);
397 assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
398 browseASDCPage.selectServiceTypeByName(serviceType);
400 browseASDCPage.clickConfirmButton();
402 GeneralUIUtils.findAndWaitByText("Missing data", 5);
404 Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
406 browseASDCPage.clickConfirmButton();
407 assertSuccessfulServiceInstanceCreation();
410 //@Test(groups = {"shouldBeMigratedToWorkWithSimulator"})
411 protected void testLineOfBusinessOptionalAndPlatformRequired() throws Exception {
413 User user = usersService.getUser(Constants.Users.SILVIA_ROBBINS_TYLER_SILVIA);
414 relogin(user.credentials);
416 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
417 SideMenu.navigateToBrowseASDCPage();
419 Service service = servicesService.getService("c079d859-4d81-4add-a9c3-94551f96e2b0");
421 browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
422 validateServiceCreationDialog(service);
424 browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
426 assertDropdownPermittedItemsByLabel(user.subscriberNames, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
427 browseASDCPage.selectSubscriberById("e433710f-9217-458d-a79d-1c7aff376d89");
429 String serviceType = "TYLER SILVIA";
430 GeneralUIUtils.findAndWaitByText(serviceType, 30);
432 assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
433 browseASDCPage.selectServiceTypeByName(serviceType);
435 Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
437 browseASDCPage.clickConfirmButton();
438 assertSuccessfulServiceInstanceCreation();
440 browseASDCPage.clickCloseButton();
441 GeneralUIUtils.ultimateWait();
444 ViewEditPage viewEditPage = new ViewEditPage();
446 viewEditPage.selectNodeInstanceToAdd("VID-RODERICK-05-15-17 0");
447 viewEditPage.generateAndSetInstanceName(Constants.ViewEdit.VNF_INSTANCE_NAME_PREFIX);
448 viewEditPage.selectProductFamily("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
449 viewEditPage.selectLcpRegion("AAIAIC25", "AIC");
450 viewEditPage.selectTenant("092eb9e8e4b7412e8787dd091bc58e86");
451 viewEditPage.setLegacyRegion("llkjhlkjhlkjh");
453 browseASDCPage.clickConfirmButton();
455 GeneralUIUtils.findAndWaitByText("Missing data", 5);
456 SelectOption.selectFirstTwoOptionsFromMultiselectById("multi-selectPlatform");
458 viewEditPage.clickConfirmButton();
459 assertSuccessfulVNFCreation();
462 private void prepareSimulatorWithServiceModelListBeforeBrowseASDCService(){
463 SimulatorApi.clearAll();
465 ImmutableList<BasePreset> presets = ImmutableList.of(
466 new PresetGetSessionSlotCheckIntervalGet(),
467 new PresetAAIGetSubscribersGet(),
468 new PresetAAIServiceDesignAndCreationPut(),
469 new PresetAAIGetServicesGet());
471 SimulatorApi.registerExpectationFromPresets(presets, SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET);
475 private void browseSDCServiceModelListCheckAAIResponse(){
476 prepareSimulatorWithServiceModelListBeforeBrowseASDCService();
477 SideMenu.navigateToBrowseASDCPage();
478 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
479 browseASDCPage.fillFilterText("CheckAAIResponse");
480 GeneralUIUtils.ultimateWait();
482 WebElement sdcTableElement = Get.byId("sdcModelsTable");
483 List<WebElement> sdcModelList = sdcTableElement.findElements(By.className("sdcServiceModel"));
485 WebElement sdcFirstModel = sdcModelList.get(0);
486 WebElement sdcSecondModel = sdcModelList.get(1);
487 WebElement sdcThirdModel = sdcModelList.get(2);
490 By uuid = By.className("uuid");
491 assertEquals(modelUuid, sdcFirstModel.findElement(uuid).getText());
492 assertEquals("1dae721c-a1ef-435f-b811-760c23f467bf" , sdcSecondModel.findElement(uuid).getText());
493 assertEquals("29236d45-e790-4c17-a115-1533cc09b7b1" , sdcThirdModel.findElement(uuid).getText());
495 //Check invariantUUID
496 By invariantUUID = By.className("invariantUUID");
497 assertEquals(modelInvariantUUID1, sdcFirstModel.findElement(invariantUUID).getText());
498 assertEquals(modelInvariantUUID2, sdcSecondModel.findElement(invariantUUID).getText());
499 assertEquals(modelInvariantUUID3, sdcThirdModel.findElement(invariantUUID).getText());
502 By name = By.className("name");
503 assertEquals("CheckAAIResponse_AAAvIRC_mm779p_Service" , sdcFirstModel.findElement(name).getText());
504 assertEquals("CheckAAIResponse_BBBvIRC_mm779p_Service" , sdcSecondModel.findElement(name).getText());
505 assertEquals("CheckAAIResponse_CCCvIRC_mm779p_Service" , sdcThirdModel.findElement(name).getText());
507 //Check distribution Status
508 By distributionStatus = By.className("distributionStatus");
509 assertEquals("DISTRIBUTION_COMPLETE_OK" , sdcFirstModel.findElement(distributionStatus).getText());
510 assertEquals("", sdcSecondModel.findElement(distributionStatus).getText());
511 assertEquals("DISTRIBUTION_COMPLETE_ERROR" , sdcThirdModel.findElement(distributionStatus).getText());
513 //Check another fields
514 assertEquals("service" , sdcFirstModel.findElement(By.className("category")).getText());
515 assertEquals("1.0" , sdcFirstModel.findElement(By.className("version")).getText());
519 public void browseSdcModel_getEmptyList_noModelsMessageIsShown() {
520 resetGetServicesCache();
521 SimulatorApi.clearAll();
522 SimulatorApi.registerExpectationFromPresets(ImmutableList.of(
523 new PresetAAIServiceDesignAndCreationPut(true),
524 new PresetAAIGetSubscribersGet()), SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET);
525 SideMenu.navigateToBrowseASDCPage();
526 GeneralUIUtils.ultimateWait();
527 WebElement serviceModelsTbody = Get.byXpath("//table[@data-tests-id='serviceModelsTable']/tbody");
528 assertFalse(Exists.tagNameInAnotherElement(serviceModelsTbody, "tr"), "Table should be empty on empty results");
529 resetGetServicesCache();
532 private static final String[] macroModelsIds = {
533 "f1bde010-cc5f-4765-941f-75f15b24f9fc",
534 "lmoser410-connector-model-version-id",
535 "ipe-resource-id-ps-02",
536 "797a6c41-0f80-4d35-a288-3920c4e06baa",
538 private static final String[] alacarteModelsIds = {
539 "0903e1c0-8e03-4936-b5c2-260653b96413",
540 "666a06ee-4b57-46df-bacf-908da8f10c3f",
541 "20c4431c-246d-11e7-93ae-92361f002671",
545 public static Object[][] filterOrchestrationType() {
546 return new Object[][]{{"a la carte", 3, alacarteModelsIds},{"macro", 4, macroModelsIds}};
549 @Test(dataProvider = "filterOrchestrationType")
550 @FeatureTogglingTest(FLAG_SHOW_ORCHESTRATION_TYPE)
551 public void browseSdcModel_filterModelsWithOrchestrationType_alacarte(
552 String orchestrationType,int numberOfOccurrence, String[] expectedModelsIds) {
553 resetGetServicesCache();
554 SimulatorApi.clearAll();
555 BrowseASDCPage browseAsdcPage = registerSimulatorAndGoToBrowseSDC();
556 GeneralUIUtils.ultimateWait();
557 assertThat(browseAsdcPage.countCurrentRowsInTable(),(Matchers.greaterThan(numberOfOccurrence)));
558 browseAsdcPage.fillFilterText(orchestrationType);
559 Assert.assertEquals(browseAsdcPage.countCurrentRowsInTable(),numberOfOccurrence);
560 for(String id : expectedModelsIds) {
561 Assert.assertTrue(browseAsdcPage.isModelWithGivenServiceUUIDVisible(id));
563 browseAsdcPage.fillFilterText("");