1 package vid.automation.test.test;
3 import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils;
4 import org.testng.annotations.Test;
5 import vid.automation.test.Constants;
6 import vid.automation.test.infra.Click;
7 import vid.automation.test.model.*;
8 import vid.automation.test.sections.BrowseASDCPage;
9 import vid.automation.test.sections.SideMenu;
10 import vid.automation.test.sections.ViewEditPage;
11 import vid.automation.test.services.ServicesService;
12 import vid.automation.test.services.UsersService;
14 import java.io.IOException;
16 public class BrowseASDCTest extends CreateInstanceDialogBaseTest {
17 private UsersService usersService = new UsersService();
18 private ServicesService servicesService = new ServicesService();
20 public BrowseASDCTest() throws IOException {
24 public void testPNFOnCreatePopup() throws Exception {
25 Service service = servicesService.getService("f39389e4-2a9c-4085-8ac3-04aea9c651be");
26 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
27 SideMenu.navigateToBrowseASDCPage();
28 browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
29 assertThatServiceCreationDialogIsVisible();
30 validatePNFCreationDialog(service, "Mobility", "pnf");
33 private void validatePNFCreationDialog(Service service, String serviceType, String serviceRole) {
34 assertServiceMetadata(serviceType, Constants.SERVICE_TYPE);
35 assertServiceMetadata(serviceRole, Constants.SERVICE_ROLE);
36 validateServiceCreationDialog(service);
40 private void testPNFMacroInstantation() throws Exception {
41 User user = usersService.getUser(Constants.Users.MOBILITY_MOBILITY);
42 relogin(user.credentials);
44 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
45 SideMenu.navigateToBrowseASDCPage();
46 browseASDCPage.clickDeployServiceButtonByServiceUUID("f39389e4-2a9c-4085-8ac3-04aea9c651be");
47 assertThatServiceCreationDialogIsVisible();
48 assertDropdownPermittedItemsByValue(user.subscribers, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
49 browseASDCPage.selectSubscriberById("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
50 browseASDCPage.selectProductFamily("ebc3bc3d-62fd-4a3f-a037-f619df4ff034");
51 GeneralUIUtils.ultimateWait();
53 browseASDCPage.selectServiceTypeByName("Mobility");
54 GeneralUIUtils.ultimateWait();
55 browseASDCPage.selectLcpRegion("mtn16");
57 browseASDCPage.selectTenant("a259ae7b7c3f493cb3d91f95a7c18149");
58 assertAllIsPermitted(Constants.BrowseASDC.AIC_OPTION_CLASS);
59 browseASDCPage.selectAicZone("NFT1");
61 Click.onFirstSelectOptionById(Constants.OwningEntity.PROJECT_SELECT_TEST_ID);
62 Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
64 browseASDCPage.clickConfirmButton();
66 assertSuccessfulServiceInstanceCreation();
68 browseASDCPage.clickCloseButton();
70 ViewEditPage viewEditPage = new ViewEditPage();
71 viewEditPage.clickActivateButton();
75 private void testServiceInstantation() throws Exception {
76 User user = usersService.getUser(Constants.Users.USP_VOICE_VIRTUAL_USP);
77 relogin(user.credentials);
79 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
80 SideMenu.navigateToBrowseASDCPage();
82 Service service = servicesService.getService("c079d859-4d81-4add-a9c3-94551f96e2b0");
84 browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
85 validateServiceCreationDialog(service);
87 browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
89 assertDropdownPermittedItemsByValue(user.subscribers, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
90 browseASDCPage.selectSubscriberById("e433710f-9217-458d-a79d-1c7aff376d89");
92 String serviceType = "VIRTUAL USP";
93 GeneralUIUtils.findAndWaitByText(serviceType, 30);
95 assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
96 browseASDCPage.selectServiceTypeByName(serviceType);
98 Click.onFirstSelectOptionById(Constants.OwningEntity.PROJECT_SELECT_TEST_ID);
99 Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
101 browseASDCPage.selectSuppressRollback("false");
103 browseASDCPage.clickConfirmButton();
105 assertSuccessfulServiceInstanceCreation();
107 browseASDCPage.clickCloseButton();
108 GeneralUIUtils.ultimateWait();
110 addVNF("VID-PCRF-05-15-17 0", "AAIAIC25", "092eb9e8e4b7412e8787dd091bc58e86",
111 "false", "some legacy region", "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", user.tenants);
112 addVolumeGroup("VidPcrf051517..pcrf_nimbus_pcm..module-4", "AAIAIC25",
113 "092eb9e8e4b7412e8787dd091bc58e86", "false", "some legacy region", user.tenants);
114 addVFModule("VidPcrf051517..pcrf_nimbus_psm..module-1", "AAIAIC25",
115 "092eb9e8e4b7412e8787dd091bc58e86", "false", "some legacy region", user.tenants);
119 private void testCategoryParamsDropdownsExistsInCreationDialog() throws Exception {
120 User user = usersService.getUser(Constants.Users.USP_VOICE_VIRTUAL_USP);
121 relogin(user.credentials);
123 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
124 SideMenu.navigateToBrowseASDCPage();
126 Service service = servicesService.getService("c079d859-4d81-4add-a9c3-94551f96e2b0");
128 browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
129 assertThatServiceCreationDialogIsVisible();
131 GeneralUIUtils.clickOnElementByTestId(Constants.OwningEntity.PROJECT_SELECT_TEST_ID);
132 GeneralUIUtils.clickOnElementByTestId(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
136 private void testOwningEntityRequiredAndProjectOptional() throws Exception {
137 User user = usersService.getUser(Constants.Users.USP_VOICE_VIRTUAL_USP);
138 relogin(user.credentials);
140 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
141 SideMenu.navigateToBrowseASDCPage();
143 Service service = servicesService.getService("c079d859-4d81-4add-a9c3-94551f96e2b0");
145 browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
146 validateServiceCreationDialog(service);
148 browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
150 assertDropdownPermittedItemsByValue(user.subscribers, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
151 browseASDCPage.selectSubscriberById("e433710f-9217-458d-a79d-1c7aff376d89");
153 String serviceType = "VIRTUAL USP";
154 GeneralUIUtils.findAndWaitByText(serviceType, 30);
156 assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
157 browseASDCPage.selectServiceTypeByName(serviceType);
159 browseASDCPage.clickConfirmButton();
161 GeneralUIUtils.findAndWaitByText("Missing data", 5);
163 Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
165 browseASDCPage.clickConfirmButton();
166 assertSuccessfulServiceInstanceCreation();
170 protected void testLineOfBusinessOptionalAndPlatformRequired() throws Exception {
172 User user = usersService.getUser(Constants.Users.USP_VOICE_VIRTUAL_USP);
173 relogin(user.credentials);
175 BrowseASDCPage browseASDCPage = new BrowseASDCPage();
176 SideMenu.navigateToBrowseASDCPage();
178 Service service = servicesService.getService("c079d859-4d81-4add-a9c3-94551f96e2b0");
180 browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
181 validateServiceCreationDialog(service);
183 browseASDCPage.setInstanceName(browseASDCPage.generateInstanceName());
185 assertDropdownPermittedItemsByValue(user.subscribers, Constants.CreateNewInstance.SUBSCRIBER_NAME_OPTION_CLASS);
186 browseASDCPage.selectSubscriberById("e433710f-9217-458d-a79d-1c7aff376d89");
188 String serviceType = "VIRTUAL USP";
189 GeneralUIUtils.findAndWaitByText(serviceType, 30);
191 assertDropdownPermittedItemsByValue(user.serviceTypes, Constants.CreateNewInstance.SERVICE_TYPE_OPTION_CLASS);
192 browseASDCPage.selectServiceTypeByName(serviceType);
194 Click.onFirstSelectOptionById(Constants.OwningEntity.OWNING_ENTITY_SELECT_TEST_ID);
196 browseASDCPage.clickConfirmButton();
197 assertSuccessfulServiceInstanceCreation();
199 browseASDCPage.clickCloseButton();
200 GeneralUIUtils.ultimateWait();
203 ViewEditPage viewEditPage = new ViewEditPage();
205 viewEditPage.selectNodeInstanceToAdd("VID-PCRF-05-15-17 0");
206 viewEditPage.generateAndSetInstanceName(Constants.ViewEdit.VNF_INSTANCE_NAME_PREFIX);
207 viewEditPage.selectProductFamily("a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb");
208 viewEditPage.selectLCPRegion("AAIAIC25");
209 viewEditPage.selectTenant("092eb9e8e4b7412e8787dd091bc58e86");
210 viewEditPage.setLegacyRegion("llkjhlkjhlkjh");
212 browseASDCPage.clickConfirmButton();
214 GeneralUIUtils.findAndWaitByText("Missing data", 5);
216 Click.onFirstSelectOptionById(Constants.OwningEntity.PLATFORM_SELECT_TEST_ID);
218 viewEditPage.clickConfirmButton();
219 assertSuccessfulVNFCreation();