Skip to content

Commit

Permalink
Merge pull request #761 from jayesh12234/develop
Browse files Browse the repository at this point in the history
MOSIP-35610
  • Loading branch information
aranaravi authored Sep 10, 2024
2 parents c75585b + 97a9bbd commit 80b4adc
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand All @@ -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"));
Expand Down Expand Up @@ -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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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("<p><img src='data:image/png;base64," + Screenshot.ClickScreenshot(driver) + "' width='900' height='450'/></p>");
throw te;

} catch (AssertionError e) {
Reporter.log("<p><img src='data:image/png;base64," + Screenshot.ClickScreenshot(driver) + "' width='900' height='450'/></p>");
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("<p><img src='data:image/png;base64," + Screenshot.ClickScreenshot(driver) + "' width='900' height='450'/></p>");
Expand Down
3 changes: 2 additions & 1 deletion uitest-resident/src/main/resources/config/Kernel.properties
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,5 @@ aid=10001100800003920230505043751
postalcode=14080
headless=yes
docker=yes
packetUpdateWait=2
packetUpdateWait=2
image=develop

0 comments on commit 80b4adc

Please sign in to comment.