Show previous instantiations button in new service modal e2e test 95/99295/3
authorSara Weiss <sara.weiss@intl.att.com>
Sun, 8 Dec 2019 12:47:42 +0000 (14:47 +0200)
committerSara Weiss <sara.weiss@intl.att.com>
Mon, 9 Dec 2019 11:41:51 +0000 (13:41 +0200)
Issue-ID: VID-724
Signed-off-by: Sara Weiss <sara.weiss@intl.att.com>
Change-Id: I0afa4fe8907c4e03630e15042188b794e4acfcc4

vid-automation/src/main/java/vid/automation/test/infra/Features.java
vid-automation/src/main/java/vid/automation/test/sections/InstantiationStatusPage.java
vid-automation/src/main/java/vid/automation/test/sections/deploy/DeployModernUIBase.java
vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java
vid-webpack-master/cypress/integration/iFrames/instantiationStatus.e2e.ts
vid-webpack-master/src/app/instantiationStatus/instantiationStatus.component.html

index cdf30e2..289151b 100644 (file)
@@ -54,6 +54,7 @@ public enum Features implements Feature {
     FLAG_2002_VNF_PLATFORM_MULTI_SELECT,
     FLAG_2002_VFM_UPGRADE_ADDITIONAL_OPTIONS,
     FLAG_2002_IDENTIFY_INVARIANT_MACRO_UUID_BY_BACKEND,
+    FLAG_2004_TEMP_BUTTON_TO_INSTANTIATION_STATUS_FILTER,
     ;
 
     public boolean isActive() {
index 1bb095f..e8b002c 100644 (file)
@@ -40,6 +40,13 @@ public abstract class InstantiationStatusPage extends VidBasePage {
         return wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.xpath("//*[table]//tbody/tr"))).size();
     }
 
+    public static void verifyUrlMatchInstantiationStatusWithFilterSearchParam(String serviceModelId) {
+
+        Map<String, String> paramsMap = extractQueryParamsFromCurrentURL("instantiationStatus?");
+        assertEquals(paramsMap.get("filterText"), serviceModelId);
+
+    }
+
     public static WebElement assertInstantiationStatusRow(String spanIdSelector, Map<String, String> fieldsIdsAndExpected) {
         try {
             WebElement newTrRow = getInstantiationStatusRow(spanIdSelector);
index 6b2c1ec..747f4eb 100644 (file)
@@ -51,4 +51,9 @@ public abstract class DeployModernUIBase extends DeployDialogBase {
     public void clickProjectSelect() {
         GeneralUIUtils.clickOnElementByTestId(Constants.OwningEntity.PROJECT_SELECT_TEST_ID);
     }
+
+    public void clickPreviousInstantiationButton() {
+        GeneralUIUtils.clickOnElementByTestIdWithoutWait("ShowPreviousInstancesButton");
+    }
+
 }
index 1bbf0e3..03006ad 100644 (file)
@@ -6,6 +6,7 @@ import static org.testng.Assert.assertFalse;
 import static vid.automation.test.infra.Features.FLAG_1908_COLLECTION_RESOURCE_NEW_INSTANTIATION_UI;
 import static vid.automation.test.infra.Features.FLAG_2002_ANY_ALACARTE_BESIDES_EXCLUDED_NEW_INSTANTIATION_UI;
 import static vid.automation.test.infra.Features.FLAG_2002_IDENTIFY_INVARIANT_MACRO_UUID_BY_BACKEND;
+import static vid.automation.test.infra.Features.FLAG_2004_TEMP_BUTTON_TO_INSTANTIATION_STATUS_FILTER;
 import static vid.automation.test.infra.Features.FLAG_5G_IN_NEW_INSTANTIATION_UI;
 import static vid.automation.test.infra.Features.FLAG_NETWORK_TO_ASYNC_INSTANTIATION;
 import static vid.automation.test.infra.Features.FLAG_SHOW_ORCHESTRATION_TYPE;
@@ -45,6 +46,7 @@ import vid.automation.test.infra.SelectOption;
 import vid.automation.test.model.Service;
 import vid.automation.test.model.User;
 import vid.automation.test.sections.BrowseASDCPage;
+import vid.automation.test.sections.InstantiationStatusPage;
 import vid.automation.test.sections.SideMenu;
 import vid.automation.test.sections.ViewEditPage;
 import vid.automation.test.sections.deploy.DeployDialogBase;
@@ -314,14 +316,33 @@ public class BrowseASDCTest extends CreateInstanceDialogBaseTest {
 
     @Test
     private void testCategoryParamsDropdownsExistsInCreationDialog() throws Exception {
+        String serviceId = "2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd";
+
+        DeployModernUIMacroDialog deployMacroDialog = getDeployModernUIMacroDialog(serviceId);
+        deployMacroDialog.assertDialog();
+        deployMacroDialog.clickProjectSelect();
+        deployMacroDialog.clickOwningEntitySelect();
+    }
+
+    private DeployModernUIMacroDialog getDeployModernUIMacroDialog(String serviceId) {
         BrowseASDCPage browseASDCPage = registerSimulatorAndGoToBrowseSDC();
-        Service service = servicesService.getService("2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd");
+        Service service = servicesService.getService(serviceId);
         browseASDCPage.clickDeployServiceButtonByServiceUUID(service.uuid);
         DeployModernUIMacroDialog deployMacroDialog = new DeployModernUIMacroDialog();
         deployMacroDialog.waitForDialogToLoad();
-        deployMacroDialog.assertDialog();
-        deployMacroDialog.clickProjectSelect();
-        deployMacroDialog.clickOwningEntitySelect();
+        return deployMacroDialog;
+    }
+
+    @Test
+    @FeatureTogglingTest(FLAG_2004_TEMP_BUTTON_TO_INSTANTIATION_STATUS_FILTER)
+    private void testClickPreviousInstantiationsInCreationDialog() throws Exception {
+
+        String serviceId = "2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd";
+        DeployModernUIMacroDialog deployMacroDialog = getDeployModernUIMacroDialog(serviceId);
+        deployMacroDialog.clickPreviousInstantiationButton();
+
+        InstantiationStatusPage.verifyUrlMatchInstantiationStatusWithFilterSearchParam(serviceId);
+
     }
 
     private BrowseASDCPage registerSimulatorAndGoToBrowseSDC() {
index 9610d68..c510391 100644 (file)
@@ -61,13 +61,13 @@ describe('Instantiation status', function () {
 
   it('should filter rows by filter text', function () {
     cy.openIframe('app/ui/#/instantiationStatus');
-    cy.getElementByDataTestsId("instantiationStatusFilter").type("ComplexService");
+    cy.getElementByDataTestsId("instantiation-status-filter").type("ComplexService");
     cy.get('table#instantiation-status tbody tr').should('have.length', 2);
   });
 
   it('should filter rows by url filter text', function () {
     cy.openIframe('app/ui/#/instantiationStatus?filterText=ComplexService');
-    cy.getElementByDataTestsId("instantiationStatusFilter").should('have.value','ComplexService');
+    cy.getElementByDataTestsId("instantiation-status-filter").should('have.value','ComplexService');
     cy.get('table#instantiation-status tbody tr').should('have.length', 2);
   });
 
index 8e9e536..16b8c01 100644 (file)
@@ -18,7 +18,7 @@
         </div>
         <div class="instantiationStatusFilter" *ngIf=isInstantiationStatusFilterFlagOn()>
           <input
-            [attr.data-tests-id]="'instantiationStatusFilter'"
+            [attr.data-tests-id]="'instantiation-status-filter'"
             class="form-control input-text"
             [placeholder]="'filter'"
             [(ngModel)]="filterText">