Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-31083 #630

Merged
merged 6 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,22 @@ public class ConfigManager {
private static String S3_ACCOUNT = "s3-account";
private static String PUSH_TO_S3 = "push-reports-to-s3";
private static String ENABLE_DEBUG = "enableDebug";
private static String LOGIN_LANG = "loginlang";
private static String THREAD_COUNT = "threadCount";
private static String LANG_SELECT = "langselect";
private static String IdentityGenManual = "identityGenManual";
private static String Perpetualvid = "perpetualvid";
private static String Temporaryvid = "temporaryvid";
private static String UIN = "uin";
private static String Onetimevid = "onetimevid";
private static String Externalemail = "externalemail";
private static String Tempemail1 = "tempemail1";
private static String Tempemail = "tempemail";
private static String TempEID = "tempEID";
private static String Aid = "aid";
private static String Postalcode = "postalcode";
private static String Headless = "headless";
private static String Docker = "docker";
private static String preconfiguredOtp;


Expand All @@ -78,6 +92,11 @@ public class ConfigManager {
private static String AUDIT_DB_USER = "db-su-user";
private static String AUDIT_DB_PASS = "postgresql-password";
private static String AUDIT_DB_SCHEMA = "audit_db_schema";
private static String HierarchyLevel0 = "hierarchyLevel0";
private static String HierarchyLevel1 = "hierarchyLevel1";
private static String HierarchyLevel2 = "hierarchyLevel2";
private static String HierarchyLevel3 = "hierarchyLevel3";
private static String HierarchyLevel4 = "hierarchyLevel4";

private static String IDA_DB_USER = "db-su-user";
private static String IDA_DB_PASS = "postgresql-password";
Expand Down Expand Up @@ -125,6 +144,11 @@ public class ConfigManager {
private static String idrepo_client_secret;
private static String idrepo_client_id;
private static String idrepo_app_id;
private static String hierarchyLevel0;
private static String hierarchyLevel1;
private static String hierarchyLevel2;
private static String hierarchyLevel3;
private static String hierarchyLevel4;

private static String admin_client_secret;
private static String admin_client_id;
Expand Down Expand Up @@ -153,6 +177,20 @@ public class ConfigManager {
private static String s3_secret_key;
private static String push_reports_to_s3;
private static String enableDebug;
private static String loginlang;
private static String identityGenManual;
private static String perpetualvid;
private static String temporaryvid;
private static String uin;
private static String onetimevid;
private static String externalemail;
private static String tempemail1;
private static String tempemail;
private static String tempEID;
private static String aid;
private static String postalcode;
private static String headless;
private static String docker;
private static String threadCount;
private static String langselect;

Expand Down Expand Up @@ -351,15 +389,116 @@ public static void init() {
langselect =System.getenv(LANG_SELECT) == null ? propsKernel.getProperty(LANG_SELECT) : System.getenv(LANG_SELECT);
propsKernel.setProperty(LANG_SELECT, langselect);

loginlang =System.getenv(LOGIN_LANG) == null ? propsKernel.getProperty(LOGIN_LANG) : System.getenv(LOGIN_LANG);
propsKernel.setProperty(LOGIN_LANG, loginlang);

identityGenManual =System.getenv(IdentityGenManual) == null ? propsKernel.getProperty(IdentityGenManual) : System.getenv(IdentityGenManual);
propsKernel.setProperty(IdentityGenManual, identityGenManual);
perpetualvid =System.getenv(Perpetualvid) == null ? propsKernel.getProperty(Perpetualvid) : System.getenv(Perpetualvid);
propsKernel.setProperty(Perpetualvid, perpetualvid);
temporaryvid =System.getenv(Temporaryvid) == null ? propsKernel.getProperty(Temporaryvid) : System.getenv(Temporaryvid);
propsKernel.setProperty(Temporaryvid, temporaryvid);
uin =System.getenv(UIN) == null ? propsKernel.getProperty(UIN) : System.getenv(UIN);
propsKernel.setProperty(UIN, uin);
onetimevid =System.getenv(Onetimevid) == null ? propsKernel.getProperty(Onetimevid) : System.getenv(Onetimevid);
propsKernel.setProperty(Onetimevid, onetimevid);
externalemail =System.getenv(Externalemail) == null ? propsKernel.getProperty(Externalemail) : System.getenv(Externalemail);
propsKernel.setProperty(Externalemail, externalemail);
tempemail1 =System.getenv(Tempemail1) == null ? propsKernel.getProperty(Tempemail1) : System.getenv(Tempemail1);
propsKernel.setProperty(Tempemail1, tempemail1);
tempemail =System.getenv(Tempemail) == null ? propsKernel.getProperty(Tempemail) : System.getenv(Tempemail);
propsKernel.setProperty(Tempemail, tempemail);
tempEID =System.getenv(TempEID) == null ? propsKernel.getProperty(TempEID) : System.getenv(TempEID);
propsKernel.setProperty(TempEID, tempEID);
aid =System.getenv(Aid) == null ? propsKernel.getProperty(Aid) : System.getenv(Aid);
propsKernel.setProperty(Aid, aid);
postalcode =System.getenv(Postalcode) == null ? propsKernel.getProperty(Postalcode) : System.getenv(Postalcode);
propsKernel.setProperty(Postalcode, postalcode);
headless =System.getenv(Headless) == null ? propsKernel.getProperty(Headless) : System.getenv(Headless);
propsKernel.setProperty(Headless, headless);
docker =System.getenv(Docker) == null ? propsKernel.getProperty(Docker) : System.getenv(Docker);
propsKernel.setProperty(Docker, docker);

hierarchyLevel0 =System.getenv(HierarchyLevel0) == null ? propsKernel.getProperty(HierarchyLevel0) : System.getenv(HierarchyLevel0);
propsKernel.setProperty(HierarchyLevel0, hierarchyLevel0);

hierarchyLevel1 =System.getenv(HierarchyLevel1) == null ? propsKernel.getProperty(HierarchyLevel1) : System.getenv(HierarchyLevel1);
propsKernel.setProperty(HierarchyLevel1, hierarchyLevel1);

hierarchyLevel2 =System.getenv(HierarchyLevel2) == null ? propsKernel.getProperty(HierarchyLevel2) : System.getenv(HierarchyLevel2);
propsKernel.setProperty(HierarchyLevel2, hierarchyLevel2);

hierarchyLevel3 =System.getenv(HierarchyLevel3) == null ? propsKernel.getProperty(HierarchyLevel3) : System.getenv(HierarchyLevel3);
propsKernel.setProperty(HierarchyLevel3, hierarchyLevel3);

hierarchyLevel4 =System.getenv(HierarchyLevel4) == null ? propsKernel.getProperty(HierarchyLevel4) : System.getenv(HierarchyLevel4);
propsKernel.setProperty(HierarchyLevel4, hierarchyLevel4);



//enableDebug threadCount langselect

}

public static String gethierarchyLevel0() {
return hierarchyLevel0;
}
public static String gethierarchyLevel1() {
return hierarchyLevel1;
}
public static String gethierarchyLevel2() {
return hierarchyLevel2;
}
public static String gethierarchyLevel3() {
return hierarchyLevel3;
}
public static String gethierarchyLevel4() {
return hierarchyLevel4;
}
public static String getDocker() {
return docker;
}
public static String getHeadless() {
return headless;
}
public static String getPostalcode() {
return postalcode;
}
public static String getaid() {
return aid;
}
public static String gettempEID() {
return tempEID;
}
public static String gettempemail() {
return tempemail;
}
public static String gettempemail1() {
return tempemail1;
}
public static String getexternalemail() {
return externalemail;
}
public static String getonetimevid() {
return onetimevid;
}
public static String getuin() {
return uin;
}
public static String gettemporaryvid() {
return temporaryvid;
}
public static String getperpetualvid() {
return perpetualvid;
}
public static String getidentityGenManual() {
return identityGenManual;
}
public static String getAuthDemoServicePort() {
return authDemoServicePort;
}
public static String getloginlang() {
return loginlang;
}

public static String getAuthDemoServiceBaseUrl() {
return authDemoServiceBaseUrl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class BookinganAppointment extends ResidentBaseClass {

@Test
public void bookinganAppointment () throws Exception {
String externalemail=JsonUtil.JsonObjParsing(Commons.getTestData(),"externalemail");
String externalemail="";



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.openqa.selenium.By;
import org.testng.annotations.Test;


import io.mosip.testrig.residentui.kernel.util.ConfigManager;
import io.mosip.testrig.residentui.utility.Commons;
import io.mosip.testrig.residentui.utility.JsonUtil;
import io.mosip.testrig.residentui.utility.ResidentBaseClass;
Expand All @@ -16,12 +16,12 @@ public class GetInformation extends ResidentBaseClass {

@Test(groups = "GI")
public void getInformation() throws Exception {
String hierarchyLevel0 = JsonUtil.JsonObjArrayListParsing2(Commons.getTestData(), "hierarchyLevel0"); //Country
String hierarchyLevel1 = JsonUtil.JsonObjArrayListParsing2(Commons.getTestData(), "hierarchyLevel1"); //Region
String hierarchyLevel2 = JsonUtil.JsonObjArrayListParsing2(Commons.getTestData(), "hierarchyLevel2");//Province
String hierarchyLevel3 = JsonUtil.JsonObjArrayListParsing2(Commons.getTestData(), "hierarchyLevel3");//City
String hierarchyLevel4 = JsonUtil.JsonObjArrayListParsing2(Commons.getTestData(), "hierarchyLevel4");//Zone
String postalcode = JsonUtil.JsonObjParsing(Commons.getTestData(), "postalcode");
String hierarchyLevel0 = JsonUtil.JsonObjArrayListParsing2( "hierarchyLevel0"); //Country
String hierarchyLevel1 = JsonUtil.JsonObjArrayListParsing2("hierarchyLevel1"); //Region
String hierarchyLevel2 = JsonUtil.JsonObjArrayListParsing2( "hierarchyLevel2");//Province
String hierarchyLevel3 = JsonUtil.JsonObjArrayListParsing2( "hierarchyLevel3");//City
String hierarchyLevel4 = JsonUtil.JsonObjArrayListParsing2("hierarchyLevel4");//Zone
String postalcode = ConfigManager.getPostalcode();

test = extent.createTest("GetInformation test", "verify Login");
Thread.sleep(2000);
Expand Down Expand Up @@ -79,7 +79,7 @@ public void getInformation() throws Exception {
}

public void GetInformationWithInvalidcountry() throws Exception {
String postalcode = JsonUtil.JsonObjParsing(Commons.getTestData(), "postalcode");
String postalcode =ConfigManager.getPostalcode();
test = extent.createTest("Get Information With Invalid country", "verify country");
Thread.sleep(2000);
Commons.click(test, driver, By.id("getInformation"));
Expand All @@ -91,7 +91,7 @@ public void GetInformationWithInvalidcountry() throws Exception {
}

public void GetInformationWithInvalidProvince() throws Exception {
String postalcode = JsonUtil.JsonObjParsing(Commons.getTestData(), "postalcode");
String postalcode = ConfigManager.getPostalcode();
test = extent.createTest("Get Information With Invalid Province", "verify Province");
Thread.sleep(2000);
Commons.click(test, driver, By.id("getInformation"));
Expand All @@ -103,7 +103,7 @@ public void GetInformationWithInvalidProvince() throws Exception {
}

public void GetInformationWithInvalidRegion() throws Exception {
String postalcode = JsonUtil.JsonObjParsing(Commons.getTestData(), "postalcode");
String postalcode = ConfigManager.getPostalcode();
test = extent.createTest("Get Information With Invalid Region", "verify Region");
Thread.sleep(2000);
Commons.click(test, driver, By.id("getInformation"));
Expand All @@ -115,7 +115,7 @@ public void GetInformationWithInvalidRegion() throws Exception {
}

public void GetInformationWithInvalidCity() throws Exception {
String postalcode = JsonUtil.JsonObjParsing(Commons.getTestData(), "postalcode");
String postalcode = ConfigManager.getPostalcode();
test = extent.createTest("GetI nformation With InvalidCity", "verify City");
Thread.sleep(2000);
Commons.click(test, driver, By.id("getInformation"));
Expand All @@ -127,7 +127,7 @@ public void GetInformationWithInvalidCity() throws Exception {
}

public void GetInformationWithInvalidZone() throws Exception {
String postalcode = JsonUtil.JsonObjParsing(Commons.getTestData(), "postalcode");
String postalcode = ConfigManager.getPostalcode();
test = extent.createTest("Get Information With Invalid Zone", "verify Zone");
Thread.sleep(2000);
Commons.click(test, driver, By.id("getInformation"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,21 @@

import com.aventstack.extentreports.Status;

import io.mosip.testrig.residentui.kernel.util.ConfigManager;
import io.mosip.testrig.residentui.utility.Commons;
import io.mosip.testrig.residentui.utility.JsonUtil;
import io.mosip.testrig.residentui.utility.MockSMTPListener;
import io.mosip.testrig.residentui.utility.ResidentBaseClass;
import io.mosip.testrig.residentui.utility.TestRunner;

@Test(groups = "GMU")
@Test(groups = "GMU",dependsOnGroups="UMD")
public class GetMyUIN extends ResidentBaseClass{

String vid =TestRunner.perpetualVid;
// @Test(groups = "GMU")
public void getMyUIN() throws Exception {

String tempemail = JsonUtil.JsonObjParsing(Commons.getTestData(), "tempemail");
String tempemail = ConfigManager.gettempemail();
test = extent.createTest("getMyUIN", "verify Login");
Commons.click(test, driver, By.id("getMyUIN"));
Commons.enter(test, driver, By.id("aidValue"), vid);//
Expand Down Expand Up @@ -48,7 +49,7 @@ public void getMyUINWithoutAID() throws InterruptedException, IOException {


public void getMyUINWithInvalidOtp() throws Exception {
String tempemail=JsonUtil.JsonObjParsing(Commons.getTestData(),"tempemail");
String tempemail = ConfigManager.gettempemail();

test=extent.createTest("get My UIN With Invalid Otp", "verify Login");
Commons.click(test, driver, By.id("getMyUIN"));
Expand All @@ -67,7 +68,7 @@ public void getMyUINWithInvalidOtp() throws Exception {
}

public void getMyUINWithExpiredOtp() throws Exception {
String tempemail=JsonUtil.JsonObjParsing(Commons.getTestData(),"tempemail");
String tempemail = ConfigManager.gettempemail();

test=extent.createTest("get My UIN With Expired Otp", "verify Login");
Commons.click(test, driver, By.id("getMyUIN"));//id
Expand All @@ -78,7 +79,7 @@ public void getMyUINWithExpiredOtp() throws Exception {
// driver.switchTo().parentFrame();
Commons.click(test,driver, By.id("getUinSendOtpBtn"));
String otp = MockSMTPListener.getOtp(tempemail);
Thread.sleep(180020);
Thread.sleep(2000);
Commons.enter(test,driver, By.id("otp-input"), otp);
Commons.click(test,driver, By.xpath("//button[@id='getUinsubmitBtn']"));
Commons.click(test,driver, By.id("dismissBtn"));
Expand Down
Loading
Loading