Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tabishkhan7 committed Dec 18, 2019
2 parents 170bc19 + 899d70d commit 1c194f9
Show file tree
Hide file tree
Showing 34 changed files with 477 additions and 359 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1214,17 +1214,22 @@ protected static String postStrContentRequestWithCookie(String content, String u

protected static String getCookieRequestFilePath() {
return RunConfigUtil.getResourcePath()
+ "ida/TestData/Security/GetCookie/getCookieRequest.json".toString();
+ "ida/TestData/Security/GetCookie/"+RunConfigUtil.getRunEvironment()+".getCookieRequest.json".toString();
}

protected static String getCookieRequestFilePathForUinGenerator() {
return RunConfigUtil.getResourcePath()
+ "ida/TestData/Security/GetCookie/getCookieForUinGenerator.json".toString();
+ "ida/TestData/Security/GetCookie/"+RunConfigUtil.getRunEvironment()+".getCookieForUinGenerator.json".toString();
}

protected static String getCookieRequestFilePathForInternalAuth() {
return RunConfigUtil.getResourcePath()
+ "ida/TestData/Security/GetCookie/getCookieForInternalAuth.json".toString();
+ "ida/TestData/Security/GetCookie/"+RunConfigUtil.getRunEvironment()+".getCookieForInternalAuth.json".toString();
}

protected static String getCookieRequestFilePathForResidentAuth() {
return RunConfigUtil.getResourcePath()
+ "ida/TestData/Security/GetCookie/"+RunConfigUtil.getRunEvironment()+".residentServiceCredential.json".toString();
}

protected String patchRequestWithCookie(String filename, String url,String cookieName,String cookieValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class IdRepoUtil extends AuthTestsUtil {
public static boolean retrieveIdRepo(String uinNumber) {
String retrievePath = RunConfigUtil.objRunConfig.getIdRepoRetrieveDataPath().replace("$uin$", uinNumber);
String url = RunConfigUtil.objRunConfig.getIdRepoEndPointUrl() + retrievePath;
String cookieValue = getAuthorizationCookie(getCookieRequestFilePathForInternalAuth(),
String cookieValue = getAuthorizationCookie(getCookieRequestFilePathForResidentAuth(),
RunConfigUtil.objRunConfig.getIdRepoEndPointUrl() + RunConfigUtil.objRunConfig.getClientidsecretkey(),
AUTHORIZATHION_COOKIENAME);
if (!FileUtil.checkFileExistForIdRepo(uinNumber + ".json")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void setTestType() {
}

public void setCookie() {
cookieValue = getAuthorizationCookie(getCookieRequestFilePathForInternalAuth(),
cookieValue = getAuthorizationCookie(getCookieRequestFilePathForResidentAuth(),
RunConfigUtil.objRunConfig.getIdRepoEndPointUrl() + RunConfigUtil.objRunConfig.getClientidsecretkey(),
AUTHORIZATHION_COOKIENAME);
getCookieStartTime = Cookie.getCookieCurrentDateTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class InternalOtpAuthentication extends PrerequisteTests implements ITest
private int invocationCount = 0;
private String kubernetSeriveName="";
private static String cookieValue;
private static String residentCookieValue;
private static String getCookieStartTime;

/**
Expand All @@ -76,6 +77,12 @@ public void setCookie() {
AUTHORIZATHION_COOKIENAME);
getCookieStartTime = Cookie.getCookieCurrentDateTime();
}

public void getResidentAccess() {
residentCookieValue = getAuthorizationCookie(getCookieRequestFilePathForResidentAuth(),
RunConfigUtil.objRunConfig.getEndPointUrl() + RunConfigUtil.objRunConfig.getClientidsecretkey(),
AUTHORIZATHION_COOKIENAME);
}

/**
* Method set Test data path and its filename
Expand Down Expand Up @@ -179,6 +186,7 @@ public void setResultTestName(ITestResult result) {
@Test(dataProvider = "testcaselist")
public void idaOtpAuthenticationTest(TestParameters objTestParameters, String testScenario, String testcaseName) throws AuthenticationTestException {
setCookie();
getResidentAccess();
File testCaseName = objTestParameters.getTestCaseFile();
int testCaseNumber = Integer.parseInt(objTestParameters.getTestId());
displayLog(testCaseName, testCaseNumber);
Expand All @@ -193,7 +201,7 @@ public void idaOtpAuthenticationTest(TestParameters objTestParameters, String te
+ " *******");
if(!postRequestAndGenerateOuputFileForIntenalAuth(testCaseName.listFiles(),
RunConfigUtil.objRunConfig.getEndPointUrl() + RunConfigUtil.objRunConfig.getIdaInternalOtpPath(), "otp-generate", "output-1-actual-res",
AUTHORIZATHION_COOKIENAME, cookieValue, 200))
AUTHORIZATHION_COOKIENAME, residentCookieValue, 200))
throw new AuthenticationTestException("Failed at HTTP-POST otp-generate-request");
Map<String, List<OutputValidationDto>> ouputValid = OutputValidationUtil.doOutputValidation(
FileUtil.getFilePath(testCaseName, "output-1-actual").toString(),
Expand All @@ -218,7 +226,7 @@ public void idaOtpAuthenticationTest(TestParameters objTestParameters, String te
if (!getTestCaseName().contains("OTP_exceed_more_attemp")) {
if (!postRequestAndGenerateOuputFileForIntenalAuth(testCaseName.listFiles(),
RunConfigUtil.objRunConfig.getEndPointUrl() + RunConfigUtil.objRunConfig.getInternalAuthPath(),
"otp-auth-request", "output-2-actual-res", AUTHORIZATHION_COOKIENAME, cookieValue, 200))
"otp-auth-request", "output-2-actual-res", AUTHORIZATHION_COOKIENAME, residentCookieValue, 200))
throw new AuthenticationTestException("Failed at HTTP-POST otp-auth-request");
} else
for (int i = 0; i < 10; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void setTestType() {
}

public void setCookie() {
cookieValue = getAuthorizationCookie(getCookieRequestFilePathForInternalAuth(),
cookieValue = getAuthorizationCookie(getCookieRequestFilePathForResidentAuth(),
RunConfigUtil.objRunConfig.getEndPointUrl() + RunConfigUtil.objRunConfig.getClientidsecretkey(),
AUTHORIZATHION_COOKIENAME);
getCookieStartTime = Cookie.getCookieCurrentDateTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void setTestType() {
}

public void setCookie() {
cookieValue = getAuthorizationCookie(getCookieRequestFilePathForInternalAuth(),
cookieValue = getAuthorizationCookie(getCookieRequestFilePathForResidentAuth(),
RunConfigUtil.objRunConfig.getIdRepoEndPointUrl() + RunConfigUtil.objRunConfig.getClientidsecretkey(),
AUTHORIZATHION_COOKIENAME);
getCookieStartTime = Cookie.getCookieCurrentDateTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void setTestType() {
}

public void setCookie() {
cookieValue = getAuthorizationCookie(getCookieRequestFilePathForInternalAuth(),
cookieValue = getAuthorizationCookie(getCookieRequestFilePathForResidentAuth(),
RunConfigUtil.objRunConfig.getIdRepoEndPointUrl() + RunConfigUtil.objRunConfig.getClientidsecretkey(),
AUTHORIZATHION_COOKIENAME);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void setTestType() {
}

public void setCookie() {
cookieValue = getAuthorizationCookie(getCookieRequestFilePathForInternalAuth(),
cookieValue = getAuthorizationCookie(getCookieRequestFilePathForResidentAuth(),
RunConfigUtil.objRunConfig.getIdRepoEndPointUrl() + RunConfigUtil.objRunConfig.getClientidsecretkey(),
AUTHORIZATHION_COOKIENAME);
getCookieStartTime = Cookie.getCookieCurrentDateTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public static void suiteSetup() {
initialize();
logger.info("Done with BeforeSuite and test case setup! BEGINNING TEST EXECUTION!\n\n");

PreRegistrationLibrary pil=new PreRegistrationLibrary();
PreRegistrationLibrary pil=new PreRegistrationLibrary();
pil.PreRegistrationResourceIntialize();
new PreregistrationDAO().deleteAvailableSlot();
new PreregistrationDAO().makeAllRegistartionCenterActive();
Expand All @@ -168,11 +168,11 @@ public static void suiteSetup() {
* here we are assuming batch job will run in every 5 min thats why we are giving wait for 10 min
*/
logger.info("waiting for job run to start");
try {
/*try {
TimeUnit.MINUTES.sleep(8);
} catch (InterruptedException e) {
e.printStackTrace();
}
}*/
//authToken=pil.getToken();
/*htmlReporter=new ExtentHtmlReporter(System.getProperty("user.dir")+"/test-output/MyOwnReport.html");
extent=new ExtentReports();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,115 @@ testdata:
output.1.res.version: $version$
output.1.res.timestamp: $IGNORE$
output.1.res.id: mosip.id.create

IdRepository_AddIdentity_withNAInLocation_Smoke_Pos:
input.cbeff-bio-data:
BDB1BIR1BIR1: $BIO~fir~rightIndex~70Percentage$
Score1BIR1BIR1: 70
BDB1BIR2BIR1: $BIO~fir~leftIndex~70Percentage$
Score1BIR1BIR2: 70
BDB1BIR3BIR1: $BIO~fir~rightThumb~70Percentage$
Score1BIR1BIR3: 70
BDB1BIR4BIR1: $BIO~fir~leftThumb~70Percentage$
Score1BIR1BIR4: 70
BDB1BIR5BIR1: $BIO~fir~rightMiddle~70Percentage$
Score1BIR1BIR5: 70
BDB1BIR6BIR1: $BIO~fir~leftMiddle~70Percentage$
Score1BIR1BIR6: 70
BDB1BIR7BIR1: $BIO~fir~rightRing~70Percentage$
Score1BIR1BIR7: 70
BDB1BIR8BIR1: $BIO~fir~leftRing~70Percentage$
Score1BIR1BIR8: 70
BDB1BIR9BIR1: $BIO~fir~rightLittle~70Percentage$
Score1BIR1BIR9: 70
BDB1BIR10BIR1: $BIO~fir~leftLittle~70Percentage$
Score1BIR1BIR10: 70
BDB1BIR11BIR1: $BIO~iir~right~100Percentage$
Score1BIR1BIR11: 100
BDB1BIR12BIR1: $BIO~iir~left~100Percentage$
Score1BIR1BIR12: 100
BDB1BIR13BIR1: $BIO~fid~fid~100Percentage$
Score1BIR1BIR13: 100
input.create-request:
registrationId: 278476573600025+$YYYYMMddHHmmss$
UIN: $generate_UIN$
dateOfBirth: $TestData:dob_valid$
IDSchemaVersion: DOUBLE:1.0
individualBiometricsVersion: DOUBLE:1.0
languagefullName0: $TestData:english_lang_code_valid$
languagefullName2: $TestData:french_lang_code_valid$
languagefullName1: $TestData:arabic_lang_code_valid$
valuefullName2: $TRANSLATE~$input.create-request:valuefullName0$~en~fr$
valuefullName1: $TRANSLATE~$input.create-request:valuefullName0$~en~ar$
valuefullName0: $TRANSLATE~$TestData:name_valid$~en~en$
languageparentOrGuardianName0: $TestData:english_lang_code_valid$
languageparentOrGuardianName2: $TestData:french_lang_code_valid$
languageparentOrGuardianName1: $TestData:arabic_lang_code_valid$
valueparentOrGuardianName2: $TRANSLATE~$input.create-request:valueparentOrGuardianName0$~en~fr$
valueparentOrGuardianName1: $TRANSLATE~$input.create-request:valueparentOrGuardianName0$~en~ar$
valueparentOrGuardianName0: $TRANSLATE~$TestData:name_valid$~en~en$
languagegender2: $TestData:english_lang_code_valid$
languagegender1: $TestData:french_lang_code_valid$
languagegender0: $TestData:arabic_lang_code_valid$
valuegender2: $TestData:male_gender_english_valid$
valuegender1: $TestData:male_gender_french_valid$
valuegender0: $TestData:male_gender_arabic_valid$
languagelocalAdministrativeAuthority0: $TestData:english_lang_code_valid$
languagelocalAdministrativeAuthority2: $TestData:french_lang_code_valid$
languagelocalAdministrativeAuthority1: $TestData:arabic_lang_code_valid$
valuelocalAdministrativeAuthority2: NA
valuelocalAdministrativeAuthority1: NA
valuelocalAdministrativeAuthority0: NA
age: $TestData:age_valid$
residenceStatus: abc
languageaddressLine10: $TestData:english_lang_code_valid$
languageaddressLine12: $TestData:french_lang_code_valid$
languageaddressLine11: $TestData:arabic_lang_code_valid$
valueaddressLine12: $TRANSLATE~$input.create-request:valueaddressLine10$~en~fr$
valueaddressLine11: $TRANSLATE~$input.create-request:valueaddressLine10$~en~ar$
valueaddressLine10: $TRANSLATE~$TestData:addressLine1_valid$~en~en$
languageaddressLine20: $TestData:english_lang_code_valid$
languageaddressLine22: $TestData:french_lang_code_valid$
languageaddressLine21: $TestData:arabic_lang_code_valid$
valueaddressLine22: $TRANSLATE~$input.create-request:valueaddressLine20$~en~fr$
valueaddressLine21: $TRANSLATE~$input.create-request:valueaddressLine20$~en~ar$
valueaddressLine20: $TRANSLATE~$TestData:addressLine2_valid$~en~en$
languageaddressLine30: $TestData:english_lang_code_valid$
languageaddressLine32: $TestData:french_lang_code_valid$
languageaddressLine31: $TestData:arabic_lang_code_valid$
valueaddressLine32: $TRANSLATE~$input.create-request:valueaddressLine30$~en~fr$
valueaddressLine31: $TRANSLATE~$input.create-request:valueaddressLine30$~en~ar$
valueaddressLine30: $TRANSLATE~$TestData:addressLine3_valid$~en~en$
languageregion0: $TestData:english_lang_code_valid$
languageregion2: $TestData:french_lang_code_valid$
languageregion1: $TestData:arabic_lang_code_valid$
valueregion2: NA
valueregion1: NA
valueregion0: NA
languageprovince0: $TestData:english_lang_code_valid$
languageprovince2: $TestData:french_lang_code_valid$
languageprovince1: $TestData:arabic_lang_code_valid$
valueprovince2: NA
valueprovince1: NA
valueprovince0: NA
languagecity0: $TestData:english_lang_code_valid$
languagecity2: $TestData:french_lang_code_valid$
languagecity1: $TestData:arabic_lang_code_valid$
valuecity2: NA
valuecity1: NA
valuecity0: NA
timestamp: $TIMESTAMPZ$
phone: $TestData:phone_valid$
postalCode: $TestData:postalcode_valid$
email: $TestData:emailId_valid$
CNIENumber: $TestData:CNIENumber_valid$
categorydocuments0: individualBiometrics
valuedocuments0: $ENCODEFILE:cbeff-bio-data.xml$
output.output-1-expected-y-res:
output.1.res.status: ACTIVATED
output.1.res.version: $version$
output.1.res.timestamp: $IGNORE$
output.1.res.id: mosip.id.create

IdRepository_AddIdentity_withInvalidUIN:
input.create-request:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
#Mon Oct 21 15:29:45 IST 2019
27847657360002520191021152845=7058431856
27847657360002520191021152811=7127952613
27847657360002520191021152554=4830657849
27847657360002520191021152718=3806739718
27847657360002520191021152711=8431748936
27847657360002520191021152423=7305947683
27847657360002520191021152455=3894758037
27847657360002520191021152450=2190239716
27847657360002520191021152616=9149071385
27847657360002520191021152936=9308127617
27847657360002520191021152903=5694874027
27847657360002520191021152646=9031496519
27847657360002520191021152640=3569047130
27847657360002520191021152839=6912983175
27847657360002520191021152519=5938163245
27847657360002520191021152548=7982197204
27847657360002520191021152803=3241035869
27847657360002520191021152833=9328308195
27847657360002520191021152511=2875640913
27847657360002520191021152540=6950370512
27847657360002520191021152703=5329603580
27847657360002520191021152733=7105937236
27847657360002520191021152412=7230281387
27847657360002520191021152928=9410749614
27847657360002520191021152608=4083529168
27847657360002520191021152440=6938526182
27847657360002520191021152923=2475165871
27847657360002520191021152601=2375645036
27847657360002520191021152858=4203243896
27847657360002520191021152825=8708409342
27847657360002520191021152504=2187031945
27847657360002520191021152532=4673275143
27847657360002520191021152725=3897683093
27847657360002520191021152755=5120650152
27847657360002520191021152432=5275631986
27847657360002520191021152918=2670439512
27847657360002520191021152750=3542138652
27847657360002520191021152624=7962760734
27847657360002520191021152910=4921509536
27847657360002520191021152654=6157927047
27847657360002520191021152817=5375083978
#Fri Dec 06 11:57:08 IST 2019
27847657360002520191206115208=7968074290
27847657360002520191206115238=8609350695
27847657360002520191206115557=8397598618
27847657360002520191206115521=8916031469
27847657360002520191206115231=6329073157
27847657360002520191206115550=9061758031
27847657360002520191206115456=2039785170
27847657360002520191206115134=8690896351
27847657360002520191206115422=2470610597
27847657360002520191206115329=7508742094
27847657360002520191206115616=2986759146
27847657360002520191206115645=8237143953
27847657360002520191206115355=4981692437
27847657360002520191206115322=6471870369
27847657360002520191206115641=8598152395
27847657360002520191206115258=2452034631
27847657360002520191206115514=3650623985
27847657360002520191206115222=3167583793
27847657360002520191206115540=7487014395
27847657360002520191206115449=2394791487
27847657360002520191206115127=3017945847
27847657360002520191206115159=3209415481
27847657360002520191206115412=6417819306
27847657360002520191206115700=2570438018
27847657360002520191206115441=5643897815
27847657360002520191206115606=8102982735
27847657360002520191206115150=7536237019
27847657360002520191206115314=3671896039
27847657360002520191206115346=6850816384
27847657360002520191206115632=9835902436
27847657360002520191206115505=9283150452
27847657360002520191206115215=9102514813
27847657360002520191206115247=2859768352
27847657360002520191206115531=9532471481
27847657360002520191206115405=8957198216
27847657360002520191206115432=7401957693
27847657360002520191206115141=8935017681
27847657360002520191206115306=5395102604
27847657360002520191206115338=5631679610
27847657360002520191206115624=7031401850
27847657360002520191206115653=2189367410
Loading

0 comments on commit 1c194f9

Please sign in to comment.