summaryrefslogtreecommitdiffstats
path: root/vid-automation
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2019-12-10 09:30:48 +0200
committerEylon Malin <eylon.malin@intl.att.com>2019-12-10 09:30:48 +0200
commitb63178807f1897fa94945109e88e075b0c8cbfab (patch)
tree48250cc48b67179daffbad8aaaa73bb039202014 /vid-automation
parent01c79e9b209089ebf4f7e95e86ae17df49a5017a (diff)
fix and improve testClickPreviousInstantiationsInCreationDialog
Issue-ID: VID-724 Signed-off-by: Eylon Malin <eylon.malin@intl.att.com> Change-Id: I85d4d2735e89df09ef831de49cee819a4b03aa4a
Diffstat (limited to 'vid-automation')
-rw-r--r--vid-automation/src/main/java/vid/automation/test/sections/InstantiationStatusPage.java32
-rw-r--r--vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java31
2 files changed, 37 insertions, 26 deletions
diff --git a/vid-automation/src/main/java/vid/automation/test/sections/InstantiationStatusPage.java b/vid-automation/src/main/java/vid/automation/test/sections/InstantiationStatusPage.java
index e8b002cb1..4bd380841 100644
--- a/vid-automation/src/main/java/vid/automation/test/sections/InstantiationStatusPage.java
+++ b/vid-automation/src/main/java/vid/automation/test/sections/InstantiationStatusPage.java
@@ -1,5 +1,16 @@
package vid.automation.test.sections;
+import static java.util.stream.Collectors.toMap;
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.testng.Assert.assertEquals;
+
+import java.nio.charset.Charset;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
import org.apache.http.NameValuePair;
import org.apache.http.client.utils.URLEncodedUtils;
import org.onap.sdc.ci.tests.utilities.GeneralUIUtils;
@@ -10,20 +21,9 @@ import org.openqa.selenium.support.ui.WebDriverWait;
import vid.automation.test.Constants;
import vid.automation.test.infra.Click;
import vid.automation.test.infra.Get;
+import vid.automation.test.infra.Input;
import vid.automation.test.infra.Wait;
-import java.nio.charset.Charset;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Consumer;
-import java.util.stream.Collectors;
-
-import static java.util.stream.Collectors.toMap;
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.testng.Assert.assertEquals;
-
public abstract class InstantiationStatusPage extends VidBasePage {
public static final String refreshButtonId = "refresh-btn";
@@ -40,11 +40,9 @@ 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 void verifyInstantiationStatusFilterValue(String serviceModelId) {
+ final String filterValue = Input.getValueByTestId("instantiation-status-filter");
+ assertEquals(filterValue, serviceModelId);
}
public static WebElement assertInstantiationStatusRow(String spanIdSelector, Map<String, String> fieldsIdsAndExpected) {
diff --git a/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java b/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java
index 03006ade7..f6b883ac1 100644
--- a/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java
+++ b/vid-automation/src/main/java/vid/automation/test/test/BrowseASDCTest.java
@@ -14,6 +14,8 @@ import static vid.automation.test.infra.ModelInfo.aLaCarteForBrowseSdc;
import static vid.automation.test.infra.ModelInfo.aLaCarteServiceCreationTest;
import static vid.automation.test.infra.ModelInfo.instantiationTypeAlacarte_vidNotionsInstantiationUIByUUID;
import static vid.automation.test.infra.ModelInfo.macroForBrowseSdc;
+import static vid.automation.test.sections.VidBasePage.goOutFromIframe;
+import static vid.automation.test.sections.VidBasePage.goToIframe;
import com.google.common.collect.ImmutableList;
import java.util.List;
@@ -299,7 +301,10 @@ public class BrowseASDCTest extends CreateInstanceDialogBaseTest {
@DataProvider
public static Object[][] filterTexts() {
- return new Object[][]{{serviceName},{modelInvariantId},{serviceUuid}};
+ return new Object[][]{
+ {serviceName},
+ {modelInvariantId},
+ {serviceUuid}};
}
@Test(dataProvider = "filterTexts")
@@ -335,14 +340,22 @@ public class BrowseASDCTest extends CreateInstanceDialogBaseTest {
@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);
-
+ public void testClickPreviousInstantiationsInCreationDialog() {
+ try {
+ String serviceId = "2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd";
+ DeployModernUIMacroDialog deployMacroDialog = getDeployModernUIMacroDialog(serviceId);
+ deployMacroDialog.clickPreviousInstantiationButton();
+
+ //exit form deploy dialog
+ goOutFromIframe();
+ //go into Instantiation Status page
+ goToIframe();
+
+ InstantiationStatusPage.verifyInstantiationStatusFilterValue(serviceId);
+ }
+ finally {
+ goOutFromIframe();
+ }
}
private BrowseASDCPage registerSimulatorAndGoToBrowseSDC() {