Skip to content
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 @@ -3,14 +3,9 @@
import static org.testng.Assert.assertTrue;

import java.util.List;
import java.util.Map;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.annotations.Test;

import io.appium.java_client.HidesKeyboard;
import io.appium.java_client.android.AndroidDriver;
import regclient.BaseTest.AndroidBaseTest;
import regclient.api.ArcConfigManager;
import regclient.api.FetchUiSpec;
Expand All @@ -33,7 +28,6 @@
import regclient.page.ProfilePage;
import regclient.page.RegistrationTasksPage;
import regclient.page.SelectLanguagePage;
import regclient.page.SettingsPage;
import regclient.pages.arabic.AcknowledgementPageArabic;
import regclient.pages.arabic.ApplicantBiometricsPageArabic;
import regclient.pages.arabic.AuthenticationPageArabic;
Expand Down Expand Up @@ -436,18 +430,17 @@ public void adultBiometricCorrection() throws InterruptedException {

assertTrue(previewPage.isNewRegistrationTitleDisplayed(), "Verify if new Registration title is displayed");

// Below commentout method may be required in future
// assertTrue(previewPage.isApplicationIDPreviewPagePageDisplayed(),
// "Verify if application ID In PreviewPage is displayed");
assertTrue(previewPage.isApplicationIDPreviewPageDisplayed(),
"Verify if application ID In PreviewPage is displayed");

assertTrue(previewPage.isDemographicInformationInPreviewPageDisplayed(),
"Verify if Demographic Information In PreviewPage is displayed");
assertTrue(previewPage.isDocumentsInformationInPreviewPageDisplayed(),
"Verify if Documents Information In PreviewPage is displayed");
assertTrue(previewPage.isBiometricsInformationInPreviewPagePageDisplayed(),
assertTrue(previewPage.isBiometricsInformationInPreviewPageDisplayed(),
"Verify if Biometrics Information In PreviewPage is displayed");
String Aid = previewPage.getAID();
previewPage.clickOnContinueButton();

if ("eng".equalsIgnoreCase(language)) {
authenticationPage = new AuthenticationPageEnglish(driver);
} else if ("hin".equalsIgnoreCase(language)) {
Expand All @@ -463,8 +456,18 @@ public void adultBiometricCorrection() throws InterruptedException {
} else {
throw new IllegalStateException("Unsupported language in testdata.json: " + language);
}
assertTrue(authenticationPage.isAuthenticationPageDisplayed(),
"Verify if authentication details page is displayed");
boolean isAuthenticationPageDisplayed = false;

for (int i = 0; i < 3; i++) {
previewPage.clickOnContinueButton();

if (authenticationPage.isAuthenticationPageDisplayed()) {
isAuthenticationPageDisplayed = true;
break;
}
}

assertTrue(isAuthenticationPageDisplayed, "Authentication page not displayed after retries");
authenticationPage.enterUserName(KeycloakUserManager.moduleSpecificUser);
authenticationPage.enterPassword(ArcConfigManager.getIAMUsersPassword());
authenticationPage.clickOnAuthenticatenButton();
Expand Down Expand Up @@ -587,12 +590,18 @@ public void adultBiometricCorrection() throws InterruptedException {

assertTrue(manageApplicationsPage.isPacketApproved(Aid), "Verify if Filtre packet is approved ");
manageApplicationsPage.clickOnSearchCheckBox();

boolean uploadSuccess = false;
for (int i = 0; i < 3; i++) {
manageApplicationsPage.clickOnUploadButton();
Thread.sleep(2000);
if (!manageApplicationsPage.isNoNetworkFoundDisplayed())
uploadSuccess = manageApplicationsPage.isZeroApplicationDisplayed();
if (uploadSuccess) {
break;
}
}

assertTrue(uploadSuccess, "Zero Application not displayed after retries");
Comment thread
damodarguru marked this conversation as resolved.

manageApplicationsPage.clickOnBackButton();

// Return to mocksbi page
Expand All @@ -602,6 +611,10 @@ public void adultBiometricCorrection() throws InterruptedException {
mockSBIPage.switchBackToArcApp();
// biocorrection flow

FetchUiSpec.getUiSpec("bioCorrectionProcess");
FetchUiSpec.getBiometricDetails("individualBiometrics");
List<String> screenOrder1 = FetchUiSpec.getAllScreenOrder();

if ("eng".equalsIgnoreCase(language)) {
registrationTasksPage = new RegistrationTasksPageEnglish(driver);
} else if ("hin".equalsIgnoreCase(language)) {
Expand Down Expand Up @@ -654,7 +667,7 @@ public void adultBiometricCorrection() throws InterruptedException {

assertTrue(selectLanguagePage.isSubmitButtonEnabled(), "verify if the submit button enabled");
selectLanguagePage.clickOnSubmitButton();
for (String screen : screenOrder) {
for (String screen : screenOrder1) {
if (screen.equals("consentdet") || screen.equals("consent")) {
if ("eng".equalsIgnoreCase(language)) {
consentPage = new ConsentPageEnglish(driver);
Expand Down Expand Up @@ -715,7 +728,6 @@ public void adultBiometricCorrection() throws InterruptedException {

if (FetchUiSpec.eye.equals("yes")) {
biometricDetailsPage.clickOnIrisScan();

assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(),
"Verify if applicant biometric page is displayed");
applicantBiometricsPage.clickOnScanButton();
Expand All @@ -727,9 +739,6 @@ public void adultBiometricCorrection() throws InterruptedException {
}
// righthand
if (FetchUiSpec.rightHand.equals("yes")) {

biometricDetailsPage.clickOnRightHandScanIcon();

assertTrue(applicantBiometricsPage.isRightHandScanTitleDisplayed(),
"Verify if right hand scan is displayed");
applicantBiometricsPage.clickOnScanButton();
Expand All @@ -740,8 +749,6 @@ public void adultBiometricCorrection() throws InterruptedException {
}
// lefthand
if (FetchUiSpec.leftHand.equals("yes")) {
biometricDetailsPage.clickOnLeftHandScanIcon();

assertTrue(applicantBiometricsPage.isLeftHandScanTitleDisplayed(),
"Verify if left hand scan is displayed");
applicantBiometricsPage.clickOnScanButton();
Expand All @@ -752,8 +759,6 @@ public void adultBiometricCorrection() throws InterruptedException {
}
// thumb
if (FetchUiSpec.thumb.equals("yes")) {
biometricDetailsPage.clickOnThumbsScanIcon();

assertTrue(applicantBiometricsPage.isThumbsScanTitleDisplayed(),
"Verify if thumb hand scan is displayed");
applicantBiometricsPage.clickOnScanButton();
Expand All @@ -764,8 +769,6 @@ public void adultBiometricCorrection() throws InterruptedException {
}
// face
if (FetchUiSpec.face.equals("yes")) {
biometricDetailsPage.clickOnFaceScanIcon();

assertTrue(applicantBiometricsPage.isFaceScanTitleDisplayed(),
"Verify if applicant biometric page is displayed");
applicantBiometricsPage.clickOnScanButton();
Expand Down Expand Up @@ -814,11 +817,10 @@ public void adultBiometricCorrection() throws InterruptedException {
} else {
throw new IllegalStateException("Unsupported language in testdata.json: " + language);
}
boolean isAuthenticationPageDisplayed = false;

for (int i = 0; i < 3; i++) {
previewPage.clickOnContinueButton();
Thread.sleep(2000);

if (authenticationPage.isAuthenticationPageDisplayed()) {
isAuthenticationPageDisplayed = true;
break;
Expand Down Expand Up @@ -906,7 +908,7 @@ public void adultBiometricCorrection() throws InterruptedException {
boolean isBioCorrectionAuthenticationPageDisplayed = false;
for (int i = 0; i < 3; i++) {
pendingApproval.clickOnAuthenticateButton();
Thread.sleep(2000);

if (pendingApproval.isSupervisorAuthenticationTitleDisplayed()) {
isBioCorrectionAuthenticationPageDisplayed = true;
break;
Expand Down Expand Up @@ -948,12 +950,17 @@ public void adultBiometricCorrection() throws InterruptedException {

assertTrue(manageApplicationsPage.isPacketApproved(Aid), "Verify if Filtre packet is approved ");
manageApplicationsPage.clickOnSearchCheckBox();

for (int i = 0; i < 3; i++) {
manageApplicationsPage.clickOnUploadButton();
Thread.sleep(2000);
if (!manageApplicationsPage.isNoNetworkFoundDisplayed())
uploadSuccess = manageApplicationsPage.isZeroApplicationDisplayed();
if (uploadSuccess) {
break;
}
}

assertTrue(uploadSuccess, "Zero Application not displayed after retries");

manageApplicationsPage.clickOnBackButton();
registrationTasksPage.clickProfileButton();

Expand Down Expand Up @@ -1361,15 +1368,16 @@ public void minorBiometricCorrection() throws InterruptedException {
}

assertTrue(previewPage.isNewRegistrationTitleDisplayed(), "Verify if new Registration title is displayed");
assertTrue(previewPage.isApplicationIDPreviewPagePageDisplayed(),
assertTrue(previewPage.isApplicationIDPreviewPageDisplayed(),
"Verify if application ID In PreviewPage is displayed");
assertTrue(previewPage.isDemographicInformationInPreviewPageDisplayed(),
"Verify if Demographic Information In PreviewPage is displayed");
assertTrue(previewPage.isDocumentsInformationInPreviewPageDisplayed(),
"Verify if Documents Information In PreviewPage is displayed");
assertTrue(previewPage.isBiometricsInformationInPreviewPagePageDisplayed(),"Verify if Biometrics Information In PreviewPage is displayed");
assertTrue(previewPage.isBiometricsInformationInPreviewPageDisplayed(),
"Verify if Biometrics Information In PreviewPage is displayed");
String Aid = previewPage.getAID();
previewPage.clickOnContinueButton();

if ("eng".equalsIgnoreCase(language)) {
authenticationPage = new AuthenticationPageEnglish(driver);
} else if ("hin".equalsIgnoreCase(language)) {
Expand All @@ -1385,8 +1393,18 @@ public void minorBiometricCorrection() throws InterruptedException {
} else {
throw new IllegalStateException("Unsupported language in testdata.json: " + language);
}
assertTrue(authenticationPage.isAuthenticationPageDisplayed(),
"Verify if authentication details page is displayed");
boolean isAuthenticationPageDisplayed = false;

for (int i = 0; i < 3; i++) {
previewPage.clickOnContinueButton();

if (authenticationPage.isAuthenticationPageDisplayed()) {
isAuthenticationPageDisplayed = true;
break;
}
}

assertTrue(isAuthenticationPageDisplayed, "Authentication page not displayed after retries");
authenticationPage.enterUserName(KeycloakUserManager.moduleSpecificUser);
authenticationPage.enterPassword(ArcConfigManager.getIAMUsersPassword());
authenticationPage.clickOnAuthenticatenButton();
Expand Down Expand Up @@ -1466,7 +1484,7 @@ public void minorBiometricCorrection() throws InterruptedException {
boolean isPageDisplayed = false;
for (int i = 0; i < 3; i++) {
pendingApproval.clickOnAuthenticateButton();
Thread.sleep(2000);

if (pendingApproval.isSupervisorAuthenticationTitleDisplayed()) {
isPageDisplayed = true;
break;
Expand Down Expand Up @@ -1507,17 +1525,18 @@ public void minorBiometricCorrection() throws InterruptedException {

assertTrue(manageApplicationsPage.isPacketApproved(Aid), "Verify if Filtre packet is approved ");
manageApplicationsPage.clickOnSearchCheckBox();

boolean uploadSuccess = false;
for (int i = 0; i < 3; i++) {
manageApplicationsPage.clickOnUploadButton();
Thread.sleep(2000);
if (!manageApplicationsPage.isNoNetworkFoundDisplayed())
uploadSuccess = manageApplicationsPage.isZeroApplicationDisplayed();
if (uploadSuccess) {
break;
}
}
manageApplicationsPage.clickOnBackButton();

// Biometric correction packet process
// Reset biometric capabilities back to individual biometrics for correction
// flow
assertTrue(uploadSuccess, "Zero Application not displayed after retries");
manageApplicationsPage.clickOnBackButton();

assertTrue(registrationTasksPage.isOperationalTaskDisplayed(), "Verify if operation tasks page is loaded");

Expand Down Expand Up @@ -1629,49 +1648,36 @@ public void minorBiometricCorrection() throws InterruptedException {
}
// righthand
if (FetchUiSpec.rightHand.equals("yes")) {

biometricDetailsPage.clickOnRightHandScanIcon();

assertTrue(applicantBiometricsPage.isRightHandScanTitleDisplayed(),
"Verify if right hand scan is displayed");
applicantBiometricsPage.clickOnScanButton();

assertTrue(applicantBiometricsPage.isRightHandScan(), "Verify if right hand scan 1st attempt");
applicantBiometricsPage.closeScanCapturePopUp();
applicantBiometricsPage.clickOnNextButton();
}
// lefthand
if (FetchUiSpec.leftHand.equals("yes")) {
biometricDetailsPage.clickOnLeftHandScanIcon();

assertTrue(applicantBiometricsPage.isLeftHandScanTitleDisplayed(),
"Verify if left hand scan is displayed");
applicantBiometricsPage.clickOnScanButton();

assertTrue(applicantBiometricsPage.isLeftHandScan(), "Verify if Left hand scan 1st attempt");
applicantBiometricsPage.closeScanCapturePopUp();
applicantBiometricsPage.clickOnNextButton();
}
// thumb
if (FetchUiSpec.thumb.equals("yes")) {
biometricDetailsPage.clickOnThumbsScanIcon();

assertTrue(applicantBiometricsPage.isThumbsScanTitleDisplayed(),
"Verify if thumb hand scan is displayed");
applicantBiometricsPage.clickOnScanButton();

assertTrue(applicantBiometricsPage.isThumbsScan(), "Verify if thumbs scan 1st attempt");
applicantBiometricsPage.closeScanCapturePopUp();
applicantBiometricsPage.clickOnNextButton();
}
// face
if (FetchUiSpec.face.equals("yes")) {
biometricDetailsPage.clickOnFaceScanIcon();

assertTrue(applicantBiometricsPage.isFaceScanTitleDisplayed(),
"Verify if applicant biometric page is displayed");
applicantBiometricsPage.clickOnScanButton();

assertTrue(applicantBiometricsPage.isFaceScan(), "Verify if face scan 1st attempt");
applicantBiometricsPage.closeScanCapturePopUp();
applicantBiometricsPage.clickOnNextButton();
Expand Down Expand Up @@ -1717,11 +1723,9 @@ public void minorBiometricCorrection() throws InterruptedException {
} else {
throw new IllegalStateException("Unsupported language in testdata.json: " + language);
}
boolean isAuthenticationPageDisplayed = false;

for (int i = 0; i < 3; i++) {
previewPage.clickOnContinueButton();

if (authenticationPage.isAuthenticationPageDisplayed()) {
isAuthenticationPageDisplayed = true;
break;
Expand Down Expand Up @@ -1808,7 +1812,6 @@ public void minorBiometricCorrection() throws InterruptedException {
boolean isBioCorrectionAuthenticationPageDisplayed = false;
for (int i = 0; i < 3; i++) {
pendingApproval.clickOnAuthenticateButton();
Thread.sleep(2000);
if (pendingApproval.isSupervisorAuthenticationTitleDisplayed()) {
isBioCorrectionAuthenticationPageDisplayed = true;
break;
Expand Down Expand Up @@ -1850,12 +1853,17 @@ public void minorBiometricCorrection() throws InterruptedException {

assertTrue(manageApplicationsPage.isPacketApproved(Aid), "Verify if Filtre packet is approved ");
manageApplicationsPage.clickOnSearchCheckBox();

for (int i = 0; i < 3; i++) {
manageApplicationsPage.clickOnUploadButton();
Thread.sleep(2000);
if (!manageApplicationsPage.isNoNetworkFoundDisplayed())
uploadSuccess = manageApplicationsPage.isZeroApplicationDisplayed();
if (uploadSuccess) {
break;
}
}

assertTrue(uploadSuccess, "Zero Application not displayed after retries");

manageApplicationsPage.clickOnBackButton();
registrationTasksPage.clickProfileButton();

Expand All @@ -1880,5 +1888,4 @@ public void minorBiometricCorrection() throws InterruptedException {

}


}
Loading