diff --git a/uitest-resident/src/main/java/io/mosip/testrig/residentui/kernel/util/ConfigManager.java b/uitest-resident/src/main/java/io/mosip/testrig/residentui/kernel/util/ConfigManager.java index e24da534..38b9a8d5 100644 --- a/uitest-resident/src/main/java/io/mosip/testrig/residentui/kernel/util/ConfigManager.java +++ b/uitest-resident/src/main/java/io/mosip/testrig/residentui/kernel/util/ConfigManager.java @@ -814,6 +814,10 @@ private static Properties getproperty(String path) { return prop; } + public static String getimagename() { + propsKernel = getproperty(TestRunner.getResourcePath() + "/" + "/config/Kernel.properties"); + return propsKernel.getProperty("image"); + } public static String getAuthDemoServiceUrl() { return ConfigManager.getAuthDemoServiceBaseUrl() + ":" + ConfigManager.getAuthDemoServicePort(); } diff --git a/uitest-resident/src/main/java/io/mosip/testrig/residentui/testcase/LoginTest.java b/uitest-resident/src/main/java/io/mosip/testrig/residentui/testcase/LoginTest.java index 36d5521a..86e06ce1 100644 --- a/uitest-resident/src/main/java/io/mosip/testrig/residentui/testcase/LoginTest.java +++ b/uitest-resident/src/main/java/io/mosip/testrig/residentui/testcase/LoginTest.java @@ -25,7 +25,7 @@ public static void loginTest() throws Exception { Commons.enter( driver, By.id("Otp_mosip-vid"), TestRunner.perpetualVid); Commons.click( driver, By.id("get_otp")); if(!Commons.isDisplayed(driver, By.id("otp_verify_input"))) { - Commons.wait(60000); + Commons.wait(120000); Commons.click( driver, By.id("get_otp")); } otp = MockSMTPListener.getOtp(externalemail); diff --git a/uitest-resident/src/main/java/io/mosip/testrig/residentui/testcase/ShareMyData.java b/uitest-resident/src/main/java/io/mosip/testrig/residentui/testcase/ShareMyData.java index 99589140..1bf5a6f3 100644 --- a/uitest-resident/src/main/java/io/mosip/testrig/residentui/testcase/ShareMyData.java +++ b/uitest-resident/src/main/java/io/mosip/testrig/residentui/testcase/ShareMyData.java @@ -14,8 +14,12 @@ public void shareMyData() throws Exception { LoginTest.loginTest(); Commons.clickWebelement( driver, By.id("uinservices/sharewithpartner")); + try { + Commons.clickWebelement( driver, By.id("fullName")); + }catch(Exception e) { + Commons.clickWebelement( driver, By.id("name")); - Commons.clickWebelement( driver, By.id("fullName")); + } Commons.clickWebelement( driver, By.id("dateOfBirth")); Commons.clickWebelement( driver, By.id("UIN")); Commons.dropdown( driver, By.id("partnerDetails")); @@ -27,7 +31,12 @@ public void shareMyData() throws Exception { Commons.clickWebelement( driver, By.id("dismissBtn")); Commons.clickWebelement( driver, By.id("uinservices/sharewithpartner")); - Commons.clickWebelement( driver, By.id("fullName")); + try { + Commons.clickWebelement( driver, By.id("fullName")); + }catch(Exception e) { + Commons.clickWebelement( driver, By.id("name")); + + } Commons.clickWebelement( driver, By.id("dateOfBirth")); Commons.clickWebelement( driver, By.id("UIN")); Commons.clickWebelement( driver, By.id("shareBtn")); @@ -58,7 +67,12 @@ public void shareMyData() throws Exception { Commons.clickWebelement( driver, By.id("dismissBtn")); Commons.clickWebelement( driver, By.id("uinservices/sharewithpartner")); - Commons.clickWebelement( driver, By.id("fullName")); + try { + Commons.clickWebelement( driver, By.id("fullName")); + }catch(Exception e) { + Commons.clickWebelement( driver, By.id("name")); + + } Commons.clickWebelement( driver, By.id("dateOfBirth")); Commons.clickWebelement( driver, By.id("UIN")); Commons.clickWebelement( driver, By.id("perpetualVID")); diff --git a/uitest-resident/src/main/java/io/mosip/testrig/residentui/utility/Commons.java b/uitest-resident/src/main/java/io/mosip/testrig/residentui/utility/Commons.java index 9afee49b..be5ba2f8 100644 --- a/uitest-resident/src/main/java/io/mosip/testrig/residentui/utility/Commons.java +++ b/uitest-resident/src/main/java/io/mosip/testrig/residentui/utility/Commons.java @@ -6,6 +6,7 @@ import java.time.format.DateTimeFormatter; import java.util.NoSuchElementException; import java.util.Random; + import org.apache.log4j.Logger; import org.openqa.selenium.By; import org.openqa.selenium.JavascriptExecutor; @@ -16,6 +17,8 @@ import org.testng.Assert; import org.testng.Reporter; +import io.mosip.testrig.residentui.kernel.util.ConfigManager; + public class Commons extends BaseClass{ private static final Logger logger = Logger.getLogger(Commons.class); @@ -198,22 +201,30 @@ public static void wait(int wait) { public static void assertCheck(By by,String message) throws IOException { try { + if(!ConfigManager.getimagename().equals("0.9.0")) { wait(2000); WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(20)); wait.until(ExpectedConditions.presenceOfElementLocated(by)); boolean isDisplayed = Commons.isDisplayed(driver, by); Assert.assertTrue(isDisplayed,message); + } - } catch (AssertionError e) { + }catch (Exception te) { + Reporter.log("
"); + throw te; + + } catch (AssertionError e) { Reporter.log(""); throw e; } } - + public static void assertCheckString(String text,String message) throws IOException { try { + if(!ConfigManager.getimagename().equals("0.9.0")) { wait(2000); Assert.assertNotNull(text,message); + } } catch (AssertionError e) { Reporter.log(""); diff --git a/uitest-resident/src/main/resources/config/Kernel.properties b/uitest-resident/src/main/resources/config/Kernel.properties index 722ac332..fec85c14 100644 --- a/uitest-resident/src/main/resources/config/Kernel.properties +++ b/uitest-resident/src/main/resources/config/Kernel.properties @@ -265,4 +265,5 @@ aid=10001100800003920230505043751 postalcode=14080 headless=yes docker=yes -packetUpdateWait=2 \ No newline at end of file +packetUpdateWait=2 +image=develop \ No newline at end of file