From d572dc5d1c25a8a23463ded22e37cd69c56c5cc3 Mon Sep 17 00:00:00 2001 From: damodarguru Date: Wed, 25 Feb 2026 16:10:27 +0530 Subject: [PATCH 01/14] MOSIP-44485:ARC - Export packet to local device Signed-off-by: damodarguru --- .../androidTestCases/ExportPacket.java | 584 ++++++++++++++++++ .../regclient/androidTestCases/LostUin.java | 28 +- .../androidTestCases/ResetPassword.java | 8 +- ... UpdateMyUinUpdateDemographicDetails.java} | 0 .../regclient/api/KernelAuthentication.java | 15 + .../main/java/regclient/page/ExportPage.java | 198 ++++++ .../java/regclient/page/KeycloakPage.java | 3 - .../ApplicantBiometricsPageEnglish.java | 10 +- .../english/BiometricDetailsPageEnglish.java | 14 +- ...sh.java => DocumentUploadPageEnglish.java} | 0 .../ManageApplicationsPageEnglish.java | 10 +- .../pages/english/PreviewPageEnglish.java | 17 +- .../pages/english/SettingsPageEnglish.java | 2 +- ...da.java => DocumentUploadPageKannada.java} | 0 ...amil.java => DocumentUploadPageTamil.java} | 0 .../main/java/regclient/utils/TestRunner.java | 14 +- .../main/resources/config/Kernel.properties | 4 + ui-test/src/main/resources/testdata.json | 2 +- 18 files changed, 865 insertions(+), 44 deletions(-) create mode 100644 ui-test/src/main/java/regclient/androidTestCases/ExportPacket.java rename ui-test/src/main/java/regclient/androidTestCases/{UpdateMyUINUpdateDemographicDetails.java => UpdateMyUinUpdateDemographicDetails.java} (100%) create mode 100644 ui-test/src/main/java/regclient/page/ExportPage.java rename ui-test/src/main/java/regclient/pages/english/{DocumentuploadPageEnglish.java => DocumentUploadPageEnglish.java} (100%) rename ui-test/src/main/java/regclient/pages/kannada/{DocumentuploadPageKannada.java => DocumentUploadPageKannada.java} (100%) rename ui-test/src/main/java/regclient/pages/tamil/{DocumentuploadPageTamil.java => DocumentUploadPageTamil.java} (100%) diff --git a/ui-test/src/main/java/regclient/androidTestCases/ExportPacket.java b/ui-test/src/main/java/regclient/androidTestCases/ExportPacket.java new file mode 100644 index 000000000..2ff3baa19 --- /dev/null +++ b/ui-test/src/main/java/regclient/androidTestCases/ExportPacket.java @@ -0,0 +1,584 @@ +package regclient.androidTestCases; + +import static org.testng.Assert.assertTrue; + +import java.util.List; + +import org.testng.annotations.Test; + +import regclient.BaseTest.AndroidBaseTest; +import regclient.api.ArcConfigManager; +import regclient.api.FetchUiSpec; +import regclient.api.KeycloakUserManager; +import regclient.page.AcknowledgementPage; +import regclient.page.ApplicantBiometricsPage; +import regclient.page.AuthenticationPage; +import regclient.page.BiometricDetailsPage; +import regclient.page.ConsentPage; +import regclient.page.DemographicDetailsPage; +import regclient.page.DocumentUploadPage; +import regclient.page.ExportPage; +import regclient.page.LoginPage; +import regclient.page.ManageApplicationsPage; +import regclient.page.OperationalTaskPage; +import regclient.page.PendingApproval; +import regclient.page.PreviewPage; +import regclient.page.ProfilePage; +import regclient.page.RegistrationTasksPage; +import regclient.page.SelectLanguagePage; +import regclient.page.UpdateUINPage; +import regclient.pages.arabic.AcknowledgementPageArabic; +import regclient.pages.arabic.ApplicantBiometricsPageArabic; +import regclient.pages.arabic.AuthenticationPageArabic; +import regclient.pages.arabic.BiometricDetailsPageArabic; +import regclient.pages.arabic.ConsentPageArabic; +import regclient.pages.arabic.DemographicDetailsPageArabic; +import regclient.pages.arabic.DocumentUploadPageArabic; +import regclient.pages.arabic.LoginPageArabic; +import regclient.pages.arabic.ManageApplicationsPageArabic; +import regclient.pages.arabic.OperationalTaskPageArabic; +import regclient.pages.arabic.PendingApprovalArabic; +import regclient.pages.arabic.PreviewPageArabic; +import regclient.pages.arabic.ProfilePageArabic; +import regclient.pages.arabic.RegistrationTasksPageArabic; +import regclient.pages.arabic.SelectLanguagePageArabic; +import regclient.pages.arabic.UpdateUINPageArabic; +import regclient.pages.english.AcknowledgementPageEnglish; +import regclient.pages.english.ApplicantBiometricsPageEnglish; +import regclient.pages.english.AuthenticationPageEnglish; +import regclient.pages.english.BiometricDetailsPageEnglish; +import regclient.pages.english.ConsentPageEnglish; +import regclient.pages.english.DemographicDetailsPageEnglish; +import regclient.pages.english.DocumentUploadPageEnglish; +import regclient.pages.english.LoginPageEnglish; +import regclient.pages.english.ManageApplicationsPageEnglish; +import regclient.pages.english.OperationalTaskPageEnglish; +import regclient.pages.english.PendingApprovalEnglish; +import regclient.pages.english.PreviewPageEnglish; +import regclient.pages.english.ProfilePageEnglish; +import regclient.pages.english.RegistrationTasksPageEnglish; +import regclient.pages.english.SelectLanguagePageEnglish; +import regclient.pages.english.UpdateUINPageEnglish; +import regclient.pages.french.AcknowledgementPageFrench; +import regclient.pages.french.ApplicantBiometricsPageFrench; +import regclient.pages.french.AuthenticationPageFrench; +import regclient.pages.french.BiometricDetailsPageFrench; +import regclient.pages.french.ConsentPageFrench; +import regclient.pages.french.DemographicDetailsPageFrench; +import regclient.pages.french.DocumentUploadPageFrench; +import regclient.pages.french.LoginPageFrench; +import regclient.pages.french.ManageApplicationsPageFrench; +import regclient.pages.french.OperationalTaskPageFrench; +import regclient.pages.french.PendingApprovalFrench; +import regclient.pages.french.PreviewPageFrench; +import regclient.pages.french.ProfilePageFrench; +import regclient.pages.french.RegistrationTasksPageFrench; +import regclient.pages.french.SelectLanguagePageFrench; +import regclient.pages.french.UpdateUINPageFrench; +import regclient.pages.hindi.AcknowledgementPageHindi; +import regclient.pages.hindi.ApplicantBiometricsPageHindi; +import regclient.pages.hindi.AuthenticationPageHindi; +import regclient.pages.hindi.BiometricDetailsPageHindi; +import regclient.pages.hindi.ConsentPageHindi; +import regclient.pages.hindi.DemographicDetailsPageHindi; +import regclient.pages.hindi.DocumentUploadPageHindi; +import regclient.pages.hindi.LoginPageHindi; +import regclient.pages.hindi.ManageApplicationsPageHindi; +import regclient.pages.hindi.OperationalTaskPageHindi; +import regclient.pages.hindi.PendingApprovalHindi; +import regclient.pages.hindi.PreviewPageHindi; +import regclient.pages.hindi.ProfilePageHindi; +import regclient.pages.hindi.RegistrationTasksPageHindi; +import regclient.pages.hindi.SelectLanguagePageHindi; +import regclient.pages.hindi.UpdateUINPageHindi; +import regclient.pages.kannada.AcknowledgementPageKannada; +import regclient.pages.kannada.ApplicantBiometricsPageKannada; +import regclient.pages.kannada.AuthenticationPageKannada; +import regclient.pages.kannada.BiometricDetailsPageKannada; +import regclient.pages.kannada.ConsentPageKannada; +import regclient.pages.kannada.DemographicDetailsPageKannada; +import regclient.pages.kannada.LoginPageKannada; +import regclient.pages.kannada.ManageApplicationsPageKannada; +import regclient.pages.kannada.OperationalTaskPageKannada; +import regclient.pages.kannada.PendingApprovalKannada; +import regclient.pages.kannada.PreviewPageKannada; +import regclient.pages.kannada.ProfilePageKannada; +import regclient.pages.kannada.RegistrationTasksPageKannada; +import regclient.pages.kannada.SelectLanguagePageKannada; +import regclient.pages.tamil.AcknowledgementPageTamil; +import regclient.pages.tamil.ApplicantBiometricsPageTamil; +import regclient.pages.tamil.AuthenticationPageTamil; +import regclient.pages.tamil.BiometricDetailsPageTamil; +import regclient.pages.tamil.ConsentPageTamil; +import regclient.pages.tamil.DemographicDetailsPageTamil; +import regclient.pages.tamil.LoginPageTamil; +import regclient.pages.tamil.ManageApplicationsPageTamil; +import regclient.pages.tamil.OperationalTaskPageTamil; +import regclient.pages.tamil.PendingApprovalTamil; +import regclient.pages.tamil.PreviewPageTamil; +import regclient.pages.tamil.ProfilePageTamil; +import regclient.pages.tamil.RegistrationTasksPageTamil; +import regclient.pages.tamil.SelectLanguagePageTamil; +import regclient.utils.TestDataReader; + +public class ExportPacket extends AndroidBaseTest { + @Test(priority = 0, description = "Verify exporting of created packet") + public void exportPacket() throws InterruptedException { + FetchUiSpec.getUiSpec("newProcess"); + FetchUiSpec.getBiometricDetails("individualBiometrics"); + List screenOrder = FetchUiSpec.getAllScreenOrder(); + LoginPage loginPage = null; + RegistrationTasksPage registrationTasksPage = null; + SelectLanguagePage selectLanguagePage = null; + ConsentPage consentPage = null; + DemographicDetailsPage demographicPage = null; + DocumentUploadPage documentuploadPage = null; + BiometricDetailsPage biometricDetailsPage = null; + ApplicantBiometricsPage applicantBiometricsPage = null; + PreviewPage previewPage = null; + AuthenticationPage authenticationPage = null; + AcknowledgementPage acknowledgementPage = null; + OperationalTaskPage operationalTaskPage = null; + PendingApproval pendingApproval = null; + ManageApplicationsPage manageApplicationsPage = null; + ProfilePage profilePage = null; + ExportPage exportPage = null; + + final String language = TestDataReader.readData("language"); + + if ("eng".equalsIgnoreCase(language)) { + loginPage = new LoginPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + loginPage = new LoginPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + loginPage = new LoginPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + loginPage = new LoginPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + loginPage = new LoginPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + loginPage = new LoginPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + loginPage.selectLanguage(); + + assertTrue(loginPage.isWelcomeMessageInSelectedLanguageDisplayed(), + "verify if the welcome msg in selected language displayed"); + loginPage.enterUserName(KeycloakUserManager.moduleSpecificUser); + loginPage.clickOnNextButton(); + + loginPage.enterPassword(ArcConfigManager.getIAMUsersPassword()); + loginPage.clickOnloginButton(); + + if ("eng".equalsIgnoreCase(language)) { + registrationTasksPage = new RegistrationTasksPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + registrationTasksPage = new RegistrationTasksPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + registrationTasksPage = new RegistrationTasksPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + registrationTasksPage = new RegistrationTasksPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + registrationTasksPage = new RegistrationTasksPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + registrationTasksPage = new RegistrationTasksPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + registrationTasksPage.handleLocationPermission(); + assertTrue(registrationTasksPage.isRegistrationTasksPageLoaded(), + "Verify if registration tasks page is loaded"); + registrationTasksPage.clickOnLostUinButton(); + + if ("eng".equalsIgnoreCase(language)) { + selectLanguagePage = new SelectLanguagePageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + selectLanguagePage = new SelectLanguagePageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + selectLanguagePage = new SelectLanguagePageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + selectLanguagePage = new SelectLanguagePageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + selectLanguagePage = new SelectLanguagePageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + selectLanguagePage = new SelectLanguagePageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(selectLanguagePage.isSelectLanguagePageLoaded(), "Verify if select language page is loaded"); + selectLanguagePage.clickOnSubmitButtonWithoutSelectingLanguage(); + + assertTrue(selectLanguagePage.isSelectLanguagePageLoaded(), + "Verify if user should not be allow to navigate to next screen."); + selectLanguagePage.selectSecondLanguage(); + + assertTrue(selectLanguagePage.isNotificationLanguageEnglishDisplayed(), + "verify if the notification language display in english"); + selectLanguagePage.selectNotificationlanguage(TestDataReader.readData("notificationLanguage")); + + assertTrue(selectLanguagePage.isSubmitButtonEnabled(), "verify if the submit button enabled"); + selectLanguagePage.clickOnSubmitButton(); + for (String screen : screenOrder) { + if (screen.equals("consentdet") || screen.equals("consent")) { + if ("eng".equalsIgnoreCase(language)) { + consentPage = new ConsentPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + consentPage = new ConsentPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + consentPage = new ConsentPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + consentPage = new ConsentPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + consentPage = new ConsentPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + consentPage = new ConsentPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(consentPage.isPageDisplayed("consentdet"), "Verify if Consent page is loaded"); +// assertTrue(consentPage.isCheckBoxReadable(), "Verify if the check box in readable"); + + assertTrue(consentPage.isInformedButtonEnabled(), "Verify if informed button enabled"); + consentPage.clickOnInformedButton(); + + } else if (screen.equals("DemographicDetails")) { + + if ("eng".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(demographicPage.isPageDisplayed("DemographicDetails"), + "Verify if demographic details page is displayed"); + + demographicPage.clickOnContinueButton(); + + } else if (screen.equals("BiometricDetails")) { + if ("eng".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + if ("eng".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + biometricDetailsPage.clickOnContinueButton(); + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); +// May be required in future +// biometricDetailsPage.handleBiometricDetails(); + + if (FetchUiSpec.eye.equals("yes")) { + biometricDetailsPage.clickOnIrisScan(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isIrisScan(), "Verify if iris scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + + applicantBiometricsPage.clickOnScanButton(); + assertTrue(applicantBiometricsPage.isIrisScan(), "Verify if iris scan 2nd attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + + applicantBiometricsPage.clickOnScanButton(); + assertTrue(applicantBiometricsPage.isIrisScan(), "Verify if iris scan 3rd attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + + biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); + } + // righthand + if (FetchUiSpec.rightHand.equals("yes")) { + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + applicantBiometricsPage = biometricDetailsPage.clickOnRightHandScanIcon(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isRightHandScan(), "Verify if right hand scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); + } + // lefthand + if (FetchUiSpec.leftHand.equals("yes")) { + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + applicantBiometricsPage = biometricDetailsPage.clickOnLeftHandScanIcon(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isLeftHandScan(), "Verify if Left hand scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); + } + // thumb + if (FetchUiSpec.thumb.equals("yes")) { + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + applicantBiometricsPage = biometricDetailsPage.clickOnThumbsScanIcon(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isThumbsScan(), "Verify if thumbs scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); + } + // face + if (FetchUiSpec.face.equals("yes")) { + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + applicantBiometricsPage = biometricDetailsPage.clickOnFaceScanIcon(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isFaceScan(), "Verify if face scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + applicantBiometricsPage.clickOnBackButton(); + } + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + biometricDetailsPage.clickOnContinueButton(); + } + } + if ("eng".equalsIgnoreCase(language)) { + previewPage = new PreviewPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + previewPage = new PreviewPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + previewPage = new PreviewPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + previewPage = new PreviewPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + previewPage = new PreviewPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + previewPage = new PreviewPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + + assertTrue(previewPage.isLostUinTitleDisplayed(), "Verify if lost uin title is displayed"); + assertTrue(previewPage.isApplicationIDPreviewPagePageDisplayed(), + "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"); + String Aid = previewPage.getAID(); + previewPage.clickOnContinueButton(); + if ("eng".equalsIgnoreCase(language)) { + authenticationPage = new AuthenticationPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + authenticationPage = new AuthenticationPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + authenticationPage = new AuthenticationPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + authenticationPage = new AuthenticationPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + authenticationPage = new AuthenticationPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + authenticationPage = new AuthenticationPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(authenticationPage.isAuthenticationPageDisplayed(), + "Verify if authentication details page is displayed"); + authenticationPage.enterUserName(KeycloakUserManager.moduleSpecificUser); + authenticationPage.enterPassword(ArcConfigManager.getIAMUsersPassword()); + authenticationPage.clickOnAuthenticatenButton(); + if ("eng".equalsIgnoreCase(language)) { + acknowledgementPage = new AcknowledgementPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + acknowledgementPage = new AcknowledgementPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + acknowledgementPage = new AcknowledgementPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + acknowledgementPage = new AcknowledgementPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + acknowledgementPage = new AcknowledgementPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + acknowledgementPage = new AcknowledgementPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(acknowledgementPage.isAcknowledgementPageDisplayed(), + "Verify if acknowledgement details page is displayed"); + + // assertTrue(acknowledgementPage.isQrCodeImageDisplayed(),"Verify if qr code + // image is displayed"); + acknowledgementPage.clickOnGoToHomeButton(); + + assertTrue(registrationTasksPage.isRegistrationTasksPageLoaded(), + "Verify if registration tasks page is loaded"); + registrationTasksPage.clickOnOperationalTasksTitle(); + if ("eng".equalsIgnoreCase(language)) { + operationalTaskPage = new OperationalTaskPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + operationalTaskPage = new OperationalTaskPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + operationalTaskPage = new OperationalTaskPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + operationalTaskPage = new OperationalTaskPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + operationalTaskPage = new OperationalTaskPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + operationalTaskPage = new OperationalTaskPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(operationalTaskPage.isOperationalTaskPageLoaded(), "Verify if operational Task Page is loaded"); + assertTrue(operationalTaskPage.isPendingApprovalTitleDisplayed(), "Verify if pending approval tite displayed"); + operationalTaskPage.clickPendingApprovalTitle(); + + if ("eng".equalsIgnoreCase(language)) { + pendingApproval = new PendingApprovalEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + pendingApproval = new PendingApprovalHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + pendingApproval = new PendingApprovalFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + pendingApproval = new PendingApprovalKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + pendingApproval = new PendingApprovalTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + pendingApproval = new PendingApprovalArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(pendingApproval.isPendingApprovalTitleDisplayed(), "Verify if pending approval page displayed"); + pendingApproval.clickOnAID(Aid); + + assertTrue(pendingApproval.isApprovalButtonDisplayed(), "Verify if approval button displayed"); + pendingApproval.clickOnApproveButton(); + pendingApproval.clickOnClosePopUpButton(); + + assertTrue(pendingApproval.isPendingApprovalTitleDisplayed(), + "Verify if pending approval page displayed after approving packet"); + pendingApproval.clickOnCheckBox(); + + assertTrue(pendingApproval.isAuthenticateButtonEnabled(), + "Verify if authenticate button is enable after selecting packet"); + pendingApproval.clickOnAuthenticateButton(); + + assertTrue(pendingApproval.isSupervisorAuthenticationTitleDisplayed(), + "Verify if Supervisor Authentication page displayed"); + + pendingApproval.enterUserName(KeycloakUserManager.moduleSpecificUser); + + pendingApproval.enterPassword(ArcConfigManager.getIAMUsersPassword()); + pendingApproval.clickOnSubmitButton(); + pendingApproval.clickOnBackButton(); + assertTrue(operationalTaskPage.isApplicationUploadTitleDisplayed(), + "Verify if application upload tite displayed"); + + operationalTaskPage.clickApplicationUploadTitle(); + if ("eng".equalsIgnoreCase(language)) { + manageApplicationsPage = new ManageApplicationsPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + manageApplicationsPage = new ManageApplicationsPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + manageApplicationsPage = new ManageApplicationsPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + manageApplicationsPage = new ManageApplicationsPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + manageApplicationsPage = new ManageApplicationsPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + manageApplicationsPage = new ManageApplicationsPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(manageApplicationsPage.isManageApplicationPageDisplayed(), + "Verify if manage Applications Page displayed"); + manageApplicationsPage.enterAID(Aid); + + assertTrue(manageApplicationsPage.isSearchAIDDisplayed(Aid), "Verify if Search Aid should displayed"); + manageApplicationsPage.selectApprovedValueDropdown(); + + assertTrue(manageApplicationsPage.isPacketApproved(Aid), "Verify if Filtre packet is approved "); + + assertTrue(manageApplicationsPage.isManageApplicationPageDisplayed(), + "Verify if manage Applications Page displayed"); + manageApplicationsPage.enterAID(Aid); + + assertTrue(manageApplicationsPage.isSearchAIDDisplayed(Aid), "Verify if Search Aid should displayed"); + + manageApplicationsPage.clickOnSearchCheckBox(); + manageApplicationsPage.clickOnExportButton(); + + exportPage = new ExportPage(driver); + exportPage.handleAccessConsentIfPresent(); + + exportPage.exportPacketIntoFolderIfReady("ExportPacket"); + + manageApplicationsPage.clickOnBackButton(); + + assertTrue(registrationTasksPage.isProfileTitleDisplayed(), "Verify if profile title display on homepage"); + registrationTasksPage.clickProfileButton(); + + if ("eng".equalsIgnoreCase(language)) { + profilePage = new ProfilePageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + profilePage = new ProfilePageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + profilePage = new ProfilePageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + profilePage = new ProfilePageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + profilePage = new ProfilePageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + profilePage = new ProfilePageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + + profilePage.clickOnLogoutButton(); + assertTrue(loginPage.isLoginPageLoaded(), "verify if login page is displayeded in Selected language"); + + } + +} diff --git a/ui-test/src/main/java/regclient/androidTestCases/LostUin.java b/ui-test/src/main/java/regclient/androidTestCases/LostUin.java index e54ec1279..63e04d51f 100644 --- a/ui-test/src/main/java/regclient/androidTestCases/LostUin.java +++ b/ui-test/src/main/java/regclient/androidTestCases/LostUin.java @@ -32,7 +32,6 @@ import regclient.pages.arabic.BiometricDetailsPageArabic; import regclient.pages.arabic.ConsentPageArabic; import regclient.pages.arabic.DemographicDetailsPageArabic; -import regclient.pages.arabic.DocumentUploadPageArabic; import regclient.pages.arabic.LoginPageArabic; import regclient.pages.arabic.ManageApplicationsPageArabic; import regclient.pages.arabic.OperationalTaskPageArabic; @@ -47,7 +46,6 @@ import regclient.pages.english.BiometricDetailsPageEnglish; import regclient.pages.english.ConsentPageEnglish; import regclient.pages.english.DemographicDetailsPageEnglish; -import regclient.pages.english.DocumentUploadPageEnglish; import regclient.pages.english.LoginPageEnglish; import regclient.pages.english.ManageApplicationsPageEnglish; import regclient.pages.english.OperationalTaskPageEnglish; @@ -62,7 +60,6 @@ import regclient.pages.french.BiometricDetailsPageFrench; import regclient.pages.french.ConsentPageFrench; import regclient.pages.french.DemographicDetailsPageFrench; -import regclient.pages.french.DocumentUploadPageFrench; import regclient.pages.french.LoginPageFrench; import regclient.pages.french.ManageApplicationsPageFrench; import regclient.pages.french.OperationalTaskPageFrench; @@ -77,7 +74,6 @@ import regclient.pages.hindi.BiometricDetailsPageHindi; import regclient.pages.hindi.ConsentPageHindi; import regclient.pages.hindi.DemographicDetailsPageHindi; -import regclient.pages.hindi.DocumentUploadPageHindi; import regclient.pages.hindi.LoginPageHindi; import regclient.pages.hindi.ManageApplicationsPageHindi; import regclient.pages.hindi.OperationalTaskPageHindi; @@ -92,7 +88,6 @@ import regclient.pages.kannada.BiometricDetailsPageKannada; import regclient.pages.kannada.ConsentPageKannada; import regclient.pages.kannada.DemographicDetailsPageKannada; -import regclient.pages.kannada.DocumentUploadPageKannada; import regclient.pages.kannada.LoginPageKannada; import regclient.pages.kannada.ManageApplicationsPageKannada; import regclient.pages.kannada.OperationalTaskPageKannada; @@ -107,7 +102,6 @@ import regclient.pages.tamil.BiometricDetailsPageTamil; import regclient.pages.tamil.ConsentPageTamil; import regclient.pages.tamil.DemographicDetailsPageTamil; -import regclient.pages.tamil.DocumentUploadPageTamil; import regclient.pages.tamil.LoginPageTamil; import regclient.pages.tamil.ManageApplicationsPageTamil; import regclient.pages.tamil.OperationalTaskPageTamil; @@ -122,7 +116,7 @@ public class LostUin extends AndroidBaseTest { @Test(priority = 0, description = "Verify lost UIN") public void lostUinAdult() { - + FetchUiSpec.getUiSpec("newProcess"); FetchUiSpec.getBiometricDetails("individualBiometrics"); List screenOrder = FetchUiSpec.getAllScreenOrder(); @@ -131,7 +125,6 @@ public void lostUinAdult() { SelectLanguagePage selectLanguagePage = null; ConsentPage consentPage = null; DemographicDetailsPage demographicPage = null; - DocumentUploadPage documentuploadPage = null; BiometricDetailsPage biometricDetailsPage = null; ApplicantBiometricsPage applicantBiometricsPage = null; PreviewPage previewPage = null; @@ -298,7 +291,7 @@ public void lostUinAdult() { biometricDetailsPage.clickOnContinueButton(); assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), "Verify if biometric details page is displayed"); - +// May be required in future // biometricDetailsPage.handleBiometricDetails(); if (FetchUiSpec.eye.equals("yes")) { @@ -367,7 +360,7 @@ public void lostUinAdult() { if (FetchUiSpec.face.equals("yes")) { assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), "Verify if biometric details page is displayed"); - biometricDetailsPage.clickOnFaceScanIcon(); + applicantBiometricsPage = biometricDetailsPage.clickOnFaceScanIcon(); assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), "Verify if applicant biometric page is displayed"); @@ -549,10 +542,19 @@ public void lostUinAdult() { assertTrue(manageApplicationsPage.isSearchAIDDisplayed(Aid), "Verify if Search Aid should displayed"); manageApplicationsPage.clickOnSearchCheckBox(); - manageApplicationsPage.clickOnUploadButton(); + + boolean uploadSuccess = false; + + for (int i = 0; i < 3; i++) { + manageApplicationsPage.clickOnUploadButton(); + + if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) { + uploadSuccess = true; + break; + } + } - // assertTrue(manageApplicationsPage.isPacketUploadDone(Aid), "Verify if packet - // upload is done"); + assertTrue(uploadSuccess, "Upload failed after retries: No Network Found still displayed"); manageApplicationsPage.clickOnBackButton(); assertTrue(registrationTasksPage.isProfileTitleDisplayed(), "Verify if profile title display on homepage"); diff --git a/ui-test/src/main/java/regclient/androidTestCases/ResetPassword.java b/ui-test/src/main/java/regclient/androidTestCases/ResetPassword.java index 112678250..2eb879c35 100644 --- a/ui-test/src/main/java/regclient/androidTestCases/ResetPassword.java +++ b/ui-test/src/main/java/regclient/androidTestCases/ResetPassword.java @@ -36,7 +36,7 @@ public class ResetPassword extends AndroidBaseTest { @Test(priority = 0, description = "Verify reset password") public void resetPassword() throws IOException { - + LoginPage loginPage = null; RegistrationTasksPage registrationTasksPage = null; ProfilePage profilePage = null; @@ -107,6 +107,9 @@ public void resetPassword() throws IOException { throw new IllegalStateException("Unsupported language in testdata.json: " + language); } profilePage.clickOnLogoutButton(); + + profilePage.clickOnLogoutButton(); + BasePage.waitTime(5); assertTrue(loginPage.isLoginPageLoaded(), "verify if login page is displayeded in Selected language"); loginPage.enterUserName(KeycloakUserManager.onlyOperatorRoleUser); loginPage.clickOnNextButton(); @@ -220,7 +223,7 @@ public void resetPassword() throws IOException { @Test(priority = 1, description = "Reset to default password", dependsOnMethods = "resetPassword") public void resetToDefaultPassword() throws IOException { - + LoginPage loginPage = null; RegistrationTasksPage registrationTasksPage = null; ProfilePage profilePage = null; @@ -335,7 +338,6 @@ public void resetToDefaultPassword() throws IOException { keycloakPage.clickOnSignoutButton(); keycloakPage.resumeArcApplication(); - profilePage.clickOnLogoutButton(); } } diff --git a/ui-test/src/main/java/regclient/androidTestCases/UpdateMyUINUpdateDemographicDetails.java b/ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinUpdateDemographicDetails.java similarity index 100% rename from ui-test/src/main/java/regclient/androidTestCases/UpdateMyUINUpdateDemographicDetails.java rename to ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinUpdateDemographicDetails.java diff --git a/ui-test/src/main/java/regclient/api/KernelAuthentication.java b/ui-test/src/main/java/regclient/api/KernelAuthentication.java index 94aa5199d..2f1de204f 100644 --- a/ui-test/src/main/java/regclient/api/KernelAuthentication.java +++ b/ui-test/src/main/java/regclient/api/KernelAuthentication.java @@ -65,6 +65,21 @@ public String getAuthForIDREPO() { cookie = reponse.getCookie("Authorization"); return cookie; } + + @SuppressWarnings("unchecked") + public String getAuthForRegproc() { + JSONObject actualrequest = getRequestJson(authRequest); + + JSONObject request = new JSONObject(); + request.put("appId", ArcConfigManager.getRegprocAppId()); + request.put("clientId", ArcConfigManager.getRegprocClientId()); + request.put("secretKey", ArcConfigManager.getRegprocClientSecret()); + actualrequest.put("request", request); + + Response reponse = appl.postWithJson(props.get("authclientidsecretkeyURL"), actualrequest); + cookie = reponse.getCookie("Authorization"); + return cookie; + } @SuppressWarnings("unchecked") public String getAuthForAdmin() { diff --git a/ui-test/src/main/java/regclient/page/ExportPage.java b/ui-test/src/main/java/regclient/page/ExportPage.java new file mode 100644 index 000000000..1a95029e7 --- /dev/null +++ b/ui-test/src/main/java/regclient/page/ExportPage.java @@ -0,0 +1,198 @@ +package regclient.page; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import io.appium.java_client.AppiumDriver; +import io.appium.java_client.MobileBy; +import io.appium.java_client.pagefactory.AndroidFindBy; + +public class ExportPage extends BasePage { + + @FindBy(id = "com.android.permissioncontroller:id/permission_message") + private WebElement accessConsent; + + @FindBy(id = "com.android.permissioncontroller:id/permission_allow_button") + private WebElement accessAllowButton; + + @FindBy(id = "com.android.permissioncontroller:id/permission_deny_button") + private WebElement accessDenyButton; + + @AndroidFindBy(accessibility = "New folder") + private WebElement newFolderIcon; + + @AndroidFindBy(id = "com.google.android.documentsui:id/action_button") + private WebElement createNewFolderBtn; + + @AndroidFindBy(xpath = "//android.widget.EditText[@resource-id='android:id/text1']") + private WebElement newfolderTextBox; + + @AndroidFindBy(id = "com.google.android.documentsui:id/alertTitle") + private WebElement newfolderPopup; + + @AndroidFindBy(id = "android:id/button1") + private WebElement okButton; + + @AndroidFindBy(id = "android:id/button1") + private WebElement useThisFolderButton; + + @AndroidFindBy(id = "com.google.android.documentsui:id/alertTitle") + private WebElement accessFolderAlertPopup; + + @AndroidFindBy(id = "android:id/button1") + private WebElement allowFolderButton; + + @FindBy(xpath = "//android.widget.TextView[@resource-id='android:id/title' and @text='Documents']") + private WebElement documentsFolder; + + @FindBy(xpath = "//android.widget.TextView[@resource-id='android:id/title' and @text='packets']") + private WebElement packetsFolder; + + @FindBy(xpath = "//android.widget.TextView[@resource-id='android:id/title' and @text='PACKET_MANAGER_ACCOUNT']") + private WebElement packetManagerAccountFolder; + + @FindBy(xpath = "(//android.widget.TextView[@text='PACKET_MANAGER_ACCOUNT'])[2]") + private WebElement packetManagerTitle; + + public ExportPage(AppiumDriver driver) { + super(driver); + } + + private static final Logger logger = LoggerFactory.getLogger(ExportPage.class); + + public void handleAccessConsentIfPresent() { + + try { + if (isElementDisplayed(accessConsent)) { + clickOnElement(accessAllowButton); + logger.info("Access consent displayed and clicked."); + } else { + logger.info("Access consent not displayed. Skipping."); + } + } catch (Exception e) { + logger.info("Access consent not present. Continuing flow."); + } + } + + public void clickNewFolderButton() { + try { + if (isElementDisplayed(newFolderIcon)) { + clickOnElement(newFolderIcon); + logger.info("Clicked New Folder icon."); + } else if (isElementDisplayed(createNewFolderBtn)) { + clickOnElement(createNewFolderBtn); + logger.info("Clicked CREATE NEW FOLDER button."); + } else { + logger.info("Neither New Folder icon nor CREATE NEW FOLDER button displayed."); + } + } catch (Exception e) { + logger.info("Error while clicking New Folder: " + e.getMessage()); + } + } + + public boolean isNewFolderPopupDisplayed() { + return isElementDisplayed(newfolderPopup); + } + + public void enterFolderName(String foldername) { + clickAndsendKeysToTextBox(newfolderTextBox, foldername); + } + + public void clickOnOkButton() { + clickOnElement(okButton); + driver.navigate().back(); + } + + public void selectFolderByName(String folderName) { + By folderLocator = MobileBy.AndroidUIAutomator( + "new UiSelector().className(\"android.widget.TextView\")" + ".text(\"" + folderName + "\")"); + click(folderLocator); + } + + public void clickOnUseThisFolderButton() { + clickOnElement(useThisFolderButton); + } + + public void handleAllowFolderConsentIfPresent() { + try { + if (isElementDisplayed(accessFolderAlertPopup)) { + clickOnElement(allowFolderButton); + logger.info("Access consent displayed and clicked."); + } else { + logger.info("Access consent not displayed. Skipping."); + } + } catch (Exception e) { + logger.info("Access consent not present. Continuing flow."); + } + } + + public boolean isPacketManagerTitleDisplayed() { + if (isElementDisplayed(packetManagerTitle)) { + logger.info("Already inside PACKET_MANAGER_ACCOUNT screen."); + return true; + } + try { + + if (!isElementDisplayed(documentsFolder)) { + scrollToText("Documents"); + } + clickOnElement(documentsFolder); + + if (!isElementDisplayed(packetsFolder)) { + scrollToText("packets"); + } + clickOnElement(packetsFolder); + + if (!isElementDisplayed(packetManagerAccountFolder)) { + scrollToText("PACKET_MANAGER_ACCOUNT"); + } + clickOnElement(packetManagerAccountFolder); + + } catch (Exception e) { + logger.info("Navigation failed: " + e.getMessage()); + return false; + } + return isElementDisplayed(packetManagerTitle); + } + + private void scrollToText(String text) { + driver.findElement(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true))" + + ".scrollIntoView(new UiSelector().text(\"" + text + "\"))")); + } + + public void exportPacketIntoFolder(String folderName) { + if (isFolderDisplayed(folderName)) { + logger.info(folderName + " folder already exists. Using it."); + clickOnUseThisFolderButton(); + handleAllowFolderConsentIfPresent(); + } else { + logger.info(folderName + " folder not found. Creating new folder."); + clickNewFolderButton(); + if (!isNewFolderPopupDisplayed()) { + throw new RuntimeException("New Folder popup not displayed"); + } + enterFolderName(folderName); + clickOnOkButton(); + selectFolderByName(folderName); + clickOnUseThisFolderButton(); + handleAllowFolderConsentIfPresent(); + } + } + + public boolean isFolderDisplayed(String folderName) { + By folderLocator = By.xpath("//android.widget.TextView[@text='" + folderName + "']"); + return isElementDisplayed(folderLocator); + } + + public void exportPacketIntoFolderIfReady(String folderName) { + if (!isPacketManagerTitleDisplayed()) { + throw new IllegalStateException("Packet Manager page is not displayed. Aborting export."); + } + logger.info("Packet Manager page verified."); + exportPacketIntoFolder(folderName); + } + +} diff --git a/ui-test/src/main/java/regclient/page/KeycloakPage.java b/ui-test/src/main/java/regclient/page/KeycloakPage.java index 242f90d6c..885176bff 100644 --- a/ui-test/src/main/java/regclient/page/KeycloakPage.java +++ b/ui-test/src/main/java/regclient/page/KeycloakPage.java @@ -2,7 +2,6 @@ package regclient.page; import java.time.Duration; -import java.util.Set; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; @@ -11,8 +10,6 @@ import org.openqa.selenium.support.ui.WebDriverWait; import io.appium.java_client.AppiumDriver; -import io.appium.java_client.MobileBy; -import io.appium.java_client.pagefactory.AndroidFindBy; import io.appium.java_client.remote.SupportsContextSwitching; public class KeycloakPage extends BasePage { diff --git a/ui-test/src/main/java/regclient/pages/english/ApplicantBiometricsPageEnglish.java b/ui-test/src/main/java/regclient/pages/english/ApplicantBiometricsPageEnglish.java index 15686bee4..aabfe5564 100644 --- a/ui-test/src/main/java/regclient/pages/english/ApplicantBiometricsPageEnglish.java +++ b/ui-test/src/main/java/regclient/pages/english/ApplicantBiometricsPageEnglish.java @@ -108,12 +108,12 @@ public void enterCommentsInTextBox(String comments) { } clickAndsendKeysToTextBox(commentsTextBox, comments); } - + public void clickOnScanButton() { - if (!isElementDisplayedOnScreen(scanButton)) { - swipeOrScroll(); - } - clickOnElement(scanButton); + WebElement scanBtn = driver.findElement(MobileBy + .AndroidUIAutomator("new UiScrollable(new UiSelector().className(\"android.widget.ScrollView\"))" + + ".scrollIntoView(new UiSelector().description(\"Scan\"))")); + clickOnElement(scanBtn); } public void clickOnExceptionTypePermanentButton() { diff --git a/ui-test/src/main/java/regclient/pages/english/BiometricDetailsPageEnglish.java b/ui-test/src/main/java/regclient/pages/english/BiometricDetailsPageEnglish.java index a0dc00d7e..ccc479091 100644 --- a/ui-test/src/main/java/regclient/pages/english/BiometricDetailsPageEnglish.java +++ b/ui-test/src/main/java/regclient/pages/english/BiometricDetailsPageEnglish.java @@ -98,20 +98,32 @@ public ApplicantBiometricsPage clickOnRightHandScanIcon() { } public ApplicantBiometricsPage clickOnLeftHandScanIcon() { + + WebElement leftHandScanIcon = driver.findElement(MobileBy + .AndroidUIAutomator("new UiScrollable(new UiSelector().className(\"android.widget.ScrollView\"))" + + ".scrollIntoView(new UiSelector().description(\"Left Hand Scan\"))")); + clickOnElement(leftHandScanIcon); return new ApplicantBiometricsPageEnglish(driver); } public ApplicantBiometricsPage clickOnThumbsScanIcon() { + WebElement thumbsScanIcon = driver.findElement(MobileBy + .AndroidUIAutomator("new UiScrollable(new UiSelector().className(\"android.widget.ScrollView\"))" + + ".scrollIntoView(new UiSelector().description(\"Thumbs Scan\"))")); clickOnElement(thumbsScanIcon); return new ApplicantBiometricsPageEnglish(driver); } public ApplicantBiometricsPage clickOnFaceScanIcon() { + WebElement faceScanIcon = driver.findElement(MobileBy + .AndroidUIAutomator("new UiScrollable(new UiSelector().className(\"android.widget.ScrollView\"))" + + ".scrollIntoView(new UiSelector().description(\"Face Scan\"))")); clickOnElement(faceScanIcon); - return new ApplicantBiometricsPageEnglish(driver); + return new ApplicantBiometricsPageEnglish(driver); } + public ApplicantBiometricsPage clickOnExceptionScanIcon() { clickOnElement(exceptionScanIcon); return new ApplicantBiometricsPageEnglish(driver); diff --git a/ui-test/src/main/java/regclient/pages/english/DocumentuploadPageEnglish.java b/ui-test/src/main/java/regclient/pages/english/DocumentUploadPageEnglish.java similarity index 100% rename from ui-test/src/main/java/regclient/pages/english/DocumentuploadPageEnglish.java rename to ui-test/src/main/java/regclient/pages/english/DocumentUploadPageEnglish.java diff --git a/ui-test/src/main/java/regclient/pages/english/ManageApplicationsPageEnglish.java b/ui-test/src/main/java/regclient/pages/english/ManageApplicationsPageEnglish.java index dd964ce6c..3df6f8b33 100644 --- a/ui-test/src/main/java/regclient/pages/english/ManageApplicationsPageEnglish.java +++ b/ui-test/src/main/java/regclient/pages/english/ManageApplicationsPageEnglish.java @@ -84,10 +84,9 @@ public class ManageApplicationsPageEnglish extends ManageApplicationsPage { @AndroidFindBy(accessibility = "Displaying 1 Applications") private WebElement displayOneApplication; - @AndroidFindBy(xpath = - "(//android.widget.TextView[@content-desc='Manage Applications']" + - "/ancestor::android.view.View)[1]//android.widget.Button") - private WebElement backButton; + @AndroidFindBy(xpath = "(//android.widget.TextView[@content-desc='Manage Applications']" + + "/ancestor::android.view.View)[1]//android.widget.Button") + private WebElement backButton; public ManageApplicationsPageEnglish(AppiumDriver driver) { super(driver); @@ -211,7 +210,6 @@ public void selectSyncedOptionDropdown() { public void selectUploadedOptionDropdown() { clickOnElement(clientStatusDropdown); clickOnElement(uploadedOption); - } public boolean isReceivedDropdownOptionDisplayed() { @@ -233,7 +231,7 @@ public boolean isDeletionDropdownOptionDisplayed() { public void clickOnBackButton() { driver.navigate().back(); } - + public void clickOnExportButton() { clickOnElement(exportButton); waitTime(10); diff --git a/ui-test/src/main/java/regclient/pages/english/PreviewPageEnglish.java b/ui-test/src/main/java/regclient/pages/english/PreviewPageEnglish.java index c0db0b94f..ab794513d 100644 --- a/ui-test/src/main/java/regclient/pages/english/PreviewPageEnglish.java +++ b/ui-test/src/main/java/regclient/pages/english/PreviewPageEnglish.java @@ -49,7 +49,7 @@ public class PreviewPageEnglish extends PreviewPage { @AndroidFindBy(accessibility = "Lost UIN") private WebElement lostUinTitle; - + @AndroidFindBy(accessibility = "Biometric correction") private WebElement biometricCorrectionTitle; @@ -104,12 +104,17 @@ public boolean updateUINTitleDisplayed() { "new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().descriptionContains(\"" + FetchUiSpec.getTitleUsingId("UPDATE") + "\"))"))); } - - @SuppressWarnings("deprecation") + public boolean isBiometricCorrectionTitleDisplayed() { - return isElementDisplayed(findElementWithRetry(MobileBy.AndroidUIAutomator( - "new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().descriptionContains(\"" - + FetchUiSpec.getTitleUsingId("BIO") + "\"))"))); + try { + driver.findElement(MobileBy.AndroidUIAutomator( + "new UiScrollable(new UiSelector().scrollable(true))" + + ".scrollIntoView(new UiSelector().description(\"Biometric correction\"))" + )); + return true; + } catch (Exception e) { + return false; + } } public boolean isApplicationIDPreviewPagePageDisplayed() { diff --git a/ui-test/src/main/java/regclient/pages/english/SettingsPageEnglish.java b/ui-test/src/main/java/regclient/pages/english/SettingsPageEnglish.java index b592cdf25..c4498efc3 100644 --- a/ui-test/src/main/java/regclient/pages/english/SettingsPageEnglish.java +++ b/ui-test/src/main/java/regclient/pages/english/SettingsPageEnglish.java @@ -82,7 +82,7 @@ public class SettingsPageEnglish extends SettingsPage { @AndroidFindBy(accessibility = "Device Settings") private WebElement deviceSettingsPage; - @AndroidFindBy(accessibility = "Scan Now") + @AndroidFindBy(accessibility = "Scan") private WebElement scanNowButton; @AndroidFindBy(accessibility = "ID: e88198714e67562c\nName: io.mosip.mock.sbi.face\nStatus: Ready") diff --git a/ui-test/src/main/java/regclient/pages/kannada/DocumentuploadPageKannada.java b/ui-test/src/main/java/regclient/pages/kannada/DocumentUploadPageKannada.java similarity index 100% rename from ui-test/src/main/java/regclient/pages/kannada/DocumentuploadPageKannada.java rename to ui-test/src/main/java/regclient/pages/kannada/DocumentUploadPageKannada.java diff --git a/ui-test/src/main/java/regclient/pages/tamil/DocumentuploadPageTamil.java b/ui-test/src/main/java/regclient/pages/tamil/DocumentUploadPageTamil.java similarity index 100% rename from ui-test/src/main/java/regclient/pages/tamil/DocumentuploadPageTamil.java rename to ui-test/src/main/java/regclient/pages/tamil/DocumentUploadPageTamil.java diff --git a/ui-test/src/main/java/regclient/utils/TestRunner.java b/ui-test/src/main/java/regclient/utils/TestRunner.java index 73791fc94..c69c8398c 100644 --- a/ui-test/src/main/java/regclient/utils/TestRunner.java +++ b/ui-test/src/main/java/regclient/utils/TestRunner.java @@ -65,6 +65,7 @@ public static void main(String[] args) { XmlClass autoLogout = new XmlClass("regclient.androidTestCases.AutoLogout"); XmlClass biometricCorrection = new XmlClass("regclient.androidTestCases.BiometricCorrection"); XmlClass preRegFetchingPacket = new XmlClass("regclient.androidTestCases.PreRegFetchingPacket"); + XmlClass exportPacket = new XmlClass("regclient.androidTestCases.ExportPacket"); List classes = new ArrayList<>(); String[] Scenarionames = ArcConfigManager.gettestcases().split(","); @@ -82,7 +83,7 @@ public static void main(String[] args) { if (Scenarioname.equalsIgnoreCase("newRegistrationAdult")) classes.add(newRegistrationAdult); - + if (Scenarioname.equalsIgnoreCase("newRegistrationAdultException")) classes.add(newRegistrationAdultException); @@ -115,19 +116,22 @@ public static void main(String[] args) { if (Scenarioname.equalsIgnoreCase("settings")) classes.add(settings); - + if (Scenarioname.equalsIgnoreCase("resetPassword")) classes.add(resetPassword); - + if (Scenarioname.equalsIgnoreCase("autoLogout")) classes.add(autoLogout); - + if (Scenarioname.equalsIgnoreCase("biometricCorrection")) classes.add(biometricCorrection); - + if (Scenarioname.equalsIgnoreCase("preRegFetchingPacket")) classes.add(preRegFetchingPacket); + if (Scenarioname.equalsIgnoreCase("exportPacket")) + classes.add(exportPacket); + } XmlTest test = new XmlTest(suite); test.setName("MyTest"); diff --git a/ui-test/src/main/resources/config/Kernel.properties b/ui-test/src/main/resources/config/Kernel.properties index d7f28cfbe..1e5cbeab8 100644 --- a/ui-test/src/main/resources/config/Kernel.properties +++ b/ui-test/src/main/resources/config/Kernel.properties @@ -33,6 +33,10 @@ policytest_userName=111998 mosip_idrepo_app_id=idrepo mosip_idrepo_client_id=mosip-idrepo-client mosip_idrepo_client_secret= +#Regproc +mosip_regprocclient_app_id=regproc +mosip_regproc_client_id=mosip-regproc-client +mosip_regproc_client_secret= #admin mosip_admin_app_id=admin admin_password=mosip123 diff --git a/ui-test/src/main/resources/testdata.json b/ui-test/src/main/resources/testdata.json index d544bae09..0e2477e7d 100644 --- a/ui-test/src/main/resources/testdata.json +++ b/ui-test/src/main/resources/testdata.json @@ -5,7 +5,7 @@ "language": "eng", "defaultlanguage": "eng", "notificationLanguage": "eng", - "orientation": "portrait", + "orientation": "portrait", "RID": "10001142850000120251130090022", "id": "com.motorola.camera3:id/capture_bar_shutter_button", "fingerprint_threshold": "45" From fd64cf794b2aa02eb0e4bf9836111e2204aa61e9 Mon Sep 17 00:00:00 2001 From: damodarguru Date: Wed, 25 Feb 2026 16:20:51 +0530 Subject: [PATCH 02/14] MOSIP-44485:ARC - Export packet to local device Signed-off-by: damodarguru --- ui-test/pom.xml | 2 +- ui-test/testng.xml | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ui-test/pom.xml b/ui-test/pom.xml index 29c0b24cf..5efbacc65 100644 --- a/ui-test/pom.xml +++ b/ui-test/pom.xml @@ -4,7 +4,7 @@ 4.0.0 io.mosip.regclient uitest-regclient - 1.0.0 + 1.0.1 jar uitest-regclient Parent project of MOSIP regclient mobile automation diff --git a/ui-test/testng.xml b/ui-test/testng.xml index b52e3f21f..12626c0bb 100644 --- a/ui-test/testng.xml +++ b/ui-test/testng.xml @@ -90,6 +90,11 @@ + + + + + From 86dfbb367a3dacdd3dca45e64572acb432d9fe34 Mon Sep 17 00:00:00 2001 From: damodarguru Date: Wed, 25 Feb 2026 16:44:51 +0530 Subject: [PATCH 03/14] MOSIP-44485:ARC - Export packet to local device Signed-off-by: damodarguru --- .../main/java/regclient/page/ExportPage.java | 4 +- .../english/DocumentUploadPageEnglish.java | 2 +- .../kannada/DocumentUploadPageKannada.java | 184 +++++++++++------- .../pages/tamil/DocumentUploadPageTamil.java | 179 +++++++++++------ 4 files changed, 239 insertions(+), 130 deletions(-) diff --git a/ui-test/src/main/java/regclient/page/ExportPage.java b/ui-test/src/main/java/regclient/page/ExportPage.java index 1a95029e7..a3beacd6d 100644 --- a/ui-test/src/main/java/regclient/page/ExportPage.java +++ b/ui-test/src/main/java/regclient/page/ExportPage.java @@ -164,7 +164,7 @@ private void scrollToText(String text) { } public void exportPacketIntoFolder(String folderName) { - if (isFolderDisplayed(folderName)) { + if (isFolderTitleDisplayed(folderName)) { logger.info(folderName + " folder already exists. Using it."); clickOnUseThisFolderButton(); handleAllowFolderConsentIfPresent(); @@ -182,7 +182,7 @@ public void exportPacketIntoFolder(String folderName) { } } - public boolean isFolderDisplayed(String folderName) { + public boolean isFolderTitleDisplayed(String folderName) { By folderLocator = By.xpath("//android.widget.TextView[@text='" + folderName + "']"); return isElementDisplayed(folderLocator); } diff --git a/ui-test/src/main/java/regclient/pages/english/DocumentUploadPageEnglish.java b/ui-test/src/main/java/regclient/pages/english/DocumentUploadPageEnglish.java index d55e50c2f..267188e45 100644 --- a/ui-test/src/main/java/regclient/pages/english/DocumentUploadPageEnglish.java +++ b/ui-test/src/main/java/regclient/pages/english/DocumentUploadPageEnglish.java @@ -172,7 +172,7 @@ public void uploadDoccuments(String age, String type) { cameraPage.clickOkButton(); waitTime(1); applyOrientation(); - assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); assertTrue(isDoccumentUploadPageDisplayed(), diff --git a/ui-test/src/main/java/regclient/pages/kannada/DocumentUploadPageKannada.java b/ui-test/src/main/java/regclient/pages/kannada/DocumentUploadPageKannada.java index 6a7051899..6bbd5b2a6 100644 --- a/ui-test/src/main/java/regclient/pages/kannada/DocumentUploadPageKannada.java +++ b/ui-test/src/main/java/regclient/pages/kannada/DocumentUploadPageKannada.java @@ -17,8 +17,7 @@ import regclient.pages.english.BiometricDetailsPageEnglish; import regclient.pages.english.DocumentUploadPageEnglish; - -public class DocumentUploadPageKannada extends DocumentUploadPage{ +public class DocumentUploadPageKannada extends DocumentUploadPage { @AndroidFindBy(accessibility = "ಸ್ಕ್ರಿಮ್") private WebElement PopUpCloseButton; @@ -34,7 +33,7 @@ public class DocumentUploadPageKannada extends DocumentUploadPage{ @AndroidFindBy(xpath = "//android.widget.ImageView") private WebElement captureImage; - + @AndroidFindBy(accessibility = "ಉಳಿಸಿ") private WebElement saveButton; @@ -47,18 +46,20 @@ public class DocumentUploadPageKannada extends DocumentUploadPage{ public DocumentUploadPageKannada(AppiumDriver driver) { super(driver); } - - public BiometricDetailsPage clickOnContinueButton() { + + public BiometricDetailsPage clickOnContinueButton() { clickOnElement(continueButton); return new BiometricDetailsPageKannada(driver); } @SuppressWarnings("deprecation") public boolean isDoccumentUploadPageDisplayed() { - return isElementDisplayed(findElementWithRetry(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().descriptionContains(\"" + FetchUiSpec.getScreenTitle("Documents") + "\"))"))); + return isElementDisplayed(findElementWithRetry(MobileBy.AndroidUIAutomator( + "new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().descriptionContains(\"" + + FetchUiSpec.getScreenTitle("Documents") + "\"))"))); } - public DocumentUploadPage clickOnSaveButton() { + public DocumentUploadPage clickOnSaveButton() { clickOnElement(saveButton); return new DocumentUploadPageKannada(driver); } @@ -72,108 +73,161 @@ public void cropCaptureImage() { cropCaptureImage(imageleftCorner); } - public void uploadDoccuments(String age,String type) { - List idList=FetchUiSpec.getAllIds("Documents"); - for(String id : idList) { - if(FetchUiSpec.getRequiredTypeUsingId(id)) { - if(type.equalsIgnoreCase("ReferenceNumber")) { - clickAndsendKeysToTextBox(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.EditText")),"1234567890"); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); - if(!isElementDisplayedOnScreen(PopUpCloseButton)) { + public void uploadDoccuments(String age, String type) { + List idList = FetchUiSpec.getAllIds("Documents"); + for (String id : idList) { + if (FetchUiSpec.getRequiredTypeUsingId(id)) { + if (type.equalsIgnoreCase("ReferenceNumber")) { + clickAndsendKeysToTextBox( + findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.EditText")), + "1234567890"); + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage=new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(),"Verify if doccumentupload page is displayed after upload of "+FetchUiSpec.getValueUsingId(id)); - }else { - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); - if(!isElementDisplayedOnScreen(PopUpCloseButton)) { + assertTrue(isDoccumentUploadPageDisplayed(), + "Verify if doccumentupload page is displayed after upload of " + + FetchUiSpec.getValueUsingId(id)); + } else { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage=new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(),"Verify if doccumentupload page is displayed after upload of "+FetchUiSpec.getValueUsingId(id)); + assertTrue(isDoccumentUploadPageDisplayed(), + "Verify if doccumentupload page is displayed after upload of " + + FetchUiSpec.getValueUsingId(id)); } - }if(id.equals("proofOfRelationship")) { - if(age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); - if(!isElementDisplayedOnScreen(PopUpCloseButton)) { + } + if (id.equals("proofOfRelationship")) { + if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage=new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(),"Verify if doccumentupload page is displayed after upload of "+FetchUiSpec.getValueUsingId(id)); + assertTrue(isDoccumentUploadPageDisplayed(), + "Verify if doccumentupload page is displayed after upload of " + + FetchUiSpec.getValueUsingId(id)); } } } } - public void uploadDoccumentsUpdate(String age,String type) { - List idList=FetchUiSpec.getAllIds("Documents"); - for(String id : idList) { - if(type.equals("all") && !id.equals("proofOfException") && !id.equals("proofOfRelationship")) { - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); - if(!isElementDisplayedOnScreen(PopUpCloseButton)) { + + public void uploadDoccumentsUpdate(String age, String type) { + List idList = FetchUiSpec.getAllIds("Documents"); + for (String id : idList) { + if (type.equals("all") && !id.equals("proofOfException") && !id.equals("proofOfRelationship")) { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage=new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - }if(id.equals("proofOfRelationship")) { - if(age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); - if(!isElementDisplayedOnScreen(PopUpCloseButton)) { + } + if (id.equals("proofOfRelationship")) { + if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage=new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); } diff --git a/ui-test/src/main/java/regclient/pages/tamil/DocumentUploadPageTamil.java b/ui-test/src/main/java/regclient/pages/tamil/DocumentUploadPageTamil.java index fbdadbbf3..f9358e8ee 100644 --- a/ui-test/src/main/java/regclient/pages/tamil/DocumentUploadPageTamil.java +++ b/ui-test/src/main/java/regclient/pages/tamil/DocumentUploadPageTamil.java @@ -33,7 +33,7 @@ public class DocumentUploadPageTamil extends DocumentUploadPage { @AndroidFindBy(xpath = "//android.widget.ImageView") private WebElement captureImage; - + @AndroidFindBy(accessibility = "சேமிக்கவும்") private WebElement saveButton; @@ -47,17 +47,19 @@ public DocumentUploadPageTamil(AppiumDriver driver) { super(driver); } - public BiometricDetailsPage clickOnContinueButton() { + public BiometricDetailsPage clickOnContinueButton() { clickOnElement(continueButton); return new BiometricDetailsPageTamil(driver); } @SuppressWarnings("deprecation") public boolean isDoccumentUploadPageDisplayed() { - return isElementDisplayed(findElementWithRetry(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().descriptionContains(\"" + FetchUiSpec.getScreenTitle("Documents") + "\"))"))); + return isElementDisplayed(findElementWithRetry(MobileBy.AndroidUIAutomator( + "new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().descriptionContains(\"" + + FetchUiSpec.getScreenTitle("Documents") + "\"))"))); } - public DocumentUploadPage clickOnSaveButton() { + public DocumentUploadPage clickOnSaveButton() { clickOnElement(saveButton); return new DocumentUploadPageTamil(driver); } @@ -71,108 +73,161 @@ public void cropCaptureImage() { cropCaptureImage(imageleftCorner); } - public void uploadDoccuments(String age,String type) { - List idList=FetchUiSpec.getAllIds("Documents"); - for(String id : idList) { - if(FetchUiSpec.getRequiredTypeUsingId(id)) { - if(type.equalsIgnoreCase("ReferenceNumber")) { - clickAndsendKeysToTextBox(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.EditText")),"1234567890"); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); - if(!isElementDisplayedOnScreen(PopUpCloseButton)) { + public void uploadDoccuments(String age, String type) { + List idList = FetchUiSpec.getAllIds("Documents"); + for (String id : idList) { + if (FetchUiSpec.getRequiredTypeUsingId(id)) { + if (type.equalsIgnoreCase("ReferenceNumber")) { + clickAndsendKeysToTextBox( + findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.EditText")), + "1234567890"); + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage=new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(),"Verify if doccumentupload page is displayed after upload of "+FetchUiSpec.getValueUsingId(id)); - }else { - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); - if(!isElementDisplayedOnScreen(PopUpCloseButton)) { + assertTrue(isDoccumentUploadPageDisplayed(), + "Verify if doccumentupload page is displayed after upload of " + + FetchUiSpec.getValueUsingId(id)); + } else { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage=new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(),"Verify if doccumentupload page is displayed after upload of "+FetchUiSpec.getValueUsingId(id)); + assertTrue(isDoccumentUploadPageDisplayed(), + "Verify if doccumentupload page is displayed after upload of " + + FetchUiSpec.getValueUsingId(id)); } - }if(id.equals("proofOfRelationship")) { - if(age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); - if(!isElementDisplayedOnScreen(PopUpCloseButton)) { + } + if (id.equals("proofOfRelationship")) { + if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage=new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(),"Verify if doccumentupload page is displayed after upload of "+FetchUiSpec.getValueUsingId(id)); + assertTrue(isDoccumentUploadPageDisplayed(), + "Verify if doccumentupload page is displayed after upload of " + + FetchUiSpec.getValueUsingId(id)); } } } } - public void uploadDoccumentsUpdate(String age,String type) { - List idList=FetchUiSpec.getAllIds("Documents"); - for(String id : idList) { - if(type.equals("all") && !id.equals("proofOfException") && !id.equals("proofOfRelationship")) { - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); - if(!isElementDisplayedOnScreen(PopUpCloseButton)) { + + public void uploadDoccumentsUpdate(String age, String type) { + List idList = FetchUiSpec.getAllIds("Documents"); + for (String id : idList) { + if (type.equals("all") && !id.equals("proofOfException") && !id.equals("proofOfRelationship")) { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage=new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - }if(id.equals("proofOfRelationship")) { - if(age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); - if(!isElementDisplayedOnScreen(PopUpCloseButton)) { + } + if (id.equals("proofOfRelationship")) { + if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage=new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); } From 1405569f28dc274e98d2c918e71639ea2c4a7733 Mon Sep 17 00:00:00 2001 From: damodarguru Date: Wed, 25 Feb 2026 17:29:28 +0530 Subject: [PATCH 04/14] MOSIP-44485:ARC - Export packet to local device Signed-off-by: damodarguru --- ui-test/src/main/java/regclient/page/ExportPage.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ui-test/src/main/java/regclient/page/ExportPage.java b/ui-test/src/main/java/regclient/page/ExportPage.java index a3beacd6d..90b814480 100644 --- a/ui-test/src/main/java/regclient/page/ExportPage.java +++ b/ui-test/src/main/java/regclient/page/ExportPage.java @@ -103,12 +103,13 @@ public void enterFolderName(String foldername) { public void clickOnOkButton() { clickOnElement(okButton); - driver.navigate().back(); } public void selectFolderByName(String folderName) { + String safeName = folderName.replace("\"", "\\\""); By folderLocator = MobileBy.AndroidUIAutomator( - "new UiSelector().className(\"android.widget.TextView\")" + ".text(\"" + folderName + "\")"); + "new UiSelector()" + ".className(\"android.widget.TextView\")" + ".text(\"" + safeName + "\")"); + click(folderLocator); } @@ -120,12 +121,12 @@ public void handleAllowFolderConsentIfPresent() { try { if (isElementDisplayed(accessFolderAlertPopup)) { clickOnElement(allowFolderButton); - logger.info("Access consent displayed and clicked."); + logger.info("Allow folder consent displayed and clicked."); } else { - logger.info("Access consent not displayed. Skipping."); + logger.info("Allow folder consent not displayed. Skipping."); } } catch (Exception e) { - logger.info("Access consent not present. Continuing flow."); + logger.info("Allow folder consent not present. Continuing flow."); } } @@ -176,7 +177,6 @@ public void exportPacketIntoFolder(String folderName) { } enterFolderName(folderName); clickOnOkButton(); - selectFolderByName(folderName); clickOnUseThisFolderButton(); handleAllowFolderConsentIfPresent(); } From 37f327eb7380378d8e78bb3c3afbaaa5c78e127b Mon Sep 17 00:00:00 2001 From: damodarguru Date: Tue, 3 Mar 2026 18:35:50 +0530 Subject: [PATCH 05/14] MOSIP:44534-ARC: Refactored report and added Known Issue support in Emailable Report. Signed-off-by: damodarguru --- .../regclient/BaseTest/AndroidBaseTest.java | 31 +- .../androidTestCases/ExportPacket.java | 11 +- .../NewRegistrationAdult.java | 728 --------------- ...strationAdultUploadMultipleDoccuments.java | 857 ++++++++++++++++++ .../java/regclient/api/AdminTestUtil.java | 53 +- .../main/java/regclient/page/ExportPage.java | 146 ++- .../english/OperationalTaskPageEnglish.java | 2 +- .../pages/english/PreviewPageEnglish.java | 20 +- .../kannada/DocumentuploadPageKannada.java | 239 +++++ .../pages/tamil/DocumentuploadPageTamil.java | 238 +++++ .../java/regclient/utils/EmailableReport.java | 691 +++++++------- .../java/regclient/utils/KnownIssues.java | 39 + .../main/java/regclient/utils/TestRunner.java | 61 ++ .../src/main/resources/config/knownIssues.txt | 3 + ui-test/testng.xml | 28 +- 15 files changed, 2013 insertions(+), 1134 deletions(-) create mode 100644 ui-test/src/main/java/regclient/androidTestCases/NewRegistrationAdultUploadMultipleDoccuments.java create mode 100644 ui-test/src/main/java/regclient/pages/kannada/DocumentuploadPageKannada.java create mode 100644 ui-test/src/main/java/regclient/pages/tamil/DocumentuploadPageTamil.java create mode 100644 ui-test/src/main/java/regclient/utils/KnownIssues.java create mode 100644 ui-test/src/main/resources/config/knownIssues.txt diff --git a/ui-test/src/main/java/regclient/BaseTest/AndroidBaseTest.java b/ui-test/src/main/java/regclient/BaseTest/AndroidBaseTest.java index dc55515fc..41bb0ed97 100644 --- a/ui-test/src/main/java/regclient/BaseTest/AndroidBaseTest.java +++ b/ui-test/src/main/java/regclient/BaseTest/AndroidBaseTest.java @@ -5,29 +5,48 @@ import org.openqa.selenium.ScreenOrientation; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.ITestResult; +import org.testng.SkipException; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; +import io.appium.java_client.android.AndroidDriver; import io.appium.java_client.remote.SupportsRotation; import regclient.driver.DriverManager; import regclient.page.BasePage; import regclient.utils.TestDataReader; +import regclient.utils.TestRunner; public class AndroidBaseTest extends BaseTest { - protected BasePage basePage; - + protected BasePage basePage; + @BeforeMethod(alwaysRun = true) - public void setup() { + public void setup(ITestResult result) { + + String testId = result.getMethod().getDescription(); + + if (testId == null || testId.trim().isEmpty()) { + testId = result.getMethod().getMethodName(); + } + + testId = testId.trim().toLowerCase(); + + if (TestRunner.knownIssues.containsKey(testId)) { + String bugId = TestRunner.knownIssues.get(testId); + throw new SkipException("Skipping due to Known Issue: " + bugId); + } + + // 🔥 2. Only if NOT skipped → start driver try { DriverManager.startAppiumServer(); this.driver = DriverManager.getDriver(); } catch (Exception e) { - throw new RuntimeException(); + throw new RuntimeException(e); } + basePage = new BasePage(driver); - basePage.applyOrientation(); + basePage.applyOrientation(); } - + @AfterMethod(alwaysRun = true) public void teardown(ITestResult result) { driver.quit(); diff --git a/ui-test/src/main/java/regclient/androidTestCases/ExportPacket.java b/ui-test/src/main/java/regclient/androidTestCases/ExportPacket.java index 2ff3baa19..8ecfd1c3f 100644 --- a/ui-test/src/main/java/regclient/androidTestCases/ExportPacket.java +++ b/ui-test/src/main/java/regclient/androidTestCases/ExportPacket.java @@ -312,15 +312,6 @@ public void exportPacket() throws InterruptedException { assertTrue(applicantBiometricsPage.isIrisScan(), "Verify if iris scan 1st attempt"); applicantBiometricsPage.closeScanCapturePopUp(); - - applicantBiometricsPage.clickOnScanButton(); - assertTrue(applicantBiometricsPage.isIrisScan(), "Verify if iris scan 2nd attempt"); - applicantBiometricsPage.closeScanCapturePopUp(); - - applicantBiometricsPage.clickOnScanButton(); - assertTrue(applicantBiometricsPage.isIrisScan(), "Verify if iris scan 3rd attempt"); - applicantBiometricsPage.closeScanCapturePopUp(); - biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); } // righthand @@ -553,7 +544,7 @@ public void exportPacket() throws InterruptedException { exportPage = new ExportPage(driver); exportPage.handleAccessConsentIfPresent(); - exportPage.exportPacketIntoFolderIfReady("ExportPacket"); + exportPage.exportToFolder("ExportPacket"); manageApplicationsPage.clickOnBackButton(); diff --git a/ui-test/src/main/java/regclient/androidTestCases/NewRegistrationAdult.java b/ui-test/src/main/java/regclient/androidTestCases/NewRegistrationAdult.java index ca1196a9e..2018688d5 100644 --- a/ui-test/src/main/java/regclient/androidTestCases/NewRegistrationAdult.java +++ b/ui-test/src/main/java/regclient/androidTestCases/NewRegistrationAdult.java @@ -636,732 +636,4 @@ public void newRegistrationAdult() throws InterruptedException { } - @Test(priority = 1, description = "Verify adult new registration") - public void newRegistrationAdultUploadMultipleDoccuments() throws InterruptedException { - FetchUiSpec.getUiSpec("newProcess"); - FetchUiSpec.getBiometricDetails("individualBiometrics"); - List screenOrder = FetchUiSpec.getAllScreenOrder(); - LoginPage loginPage = null; - RegistrationTasksPage registrationTasksPage = null; - SelectLanguagePage selectLanguagePage = null; - ConsentPage consentPage = null; - DemographicDetailsPage demographicPage = null; - DocumentUploadPage documentUploadPage = null; - BiometricDetailsPage biometricDetailsPage = null; - ApplicantBiometricsPage applicantBiometricsPage = null; - PreviewPage previewPage = null; - AuthenticationPage authenticationPage = null; - AcknowledgementPage acknowledgementPage = null; - OperationalTaskPage operationalTaskPage = null; - PendingApproval pendingApproval = null; - ManageApplicationsPage manageApplicationsPage = null; - ProfilePage profilePage = null; - IntroducerBiometricPage introducerBiometricPage = null; - - final String language = TestDataReader.readData("language"); - - if ("eng".equalsIgnoreCase(language)) { - loginPage = new LoginPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - loginPage = new LoginPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - loginPage = new LoginPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - loginPage = new LoginPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - loginPage = new LoginPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - loginPage = new LoginPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - - loginPage.selectLanguage(); - - assertTrue(loginPage.isWelcomeMessageInSelectedLanguageDisplayed(), - "verify if the welcome msg in selected language displayed"); - loginPage.enterUserName(KeycloakUserManager.moduleSpecificUser); - loginPage.clickOnNextButton(); - - loginPage.enterPassword(ArcConfigManager.getIAMUsersPassword()); - loginPage.clickOnloginButton(); - - if ("eng".equalsIgnoreCase(language)) { - registrationTasksPage = new RegistrationTasksPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - registrationTasksPage = new RegistrationTasksPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - registrationTasksPage = new RegistrationTasksPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - registrationTasksPage = new RegistrationTasksPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - registrationTasksPage = new RegistrationTasksPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - registrationTasksPage = new RegistrationTasksPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - - assertTrue(registrationTasksPage.isRegistrationTasksPageLoaded(), - "Verify if registration tasks page is loaded"); - - registrationTasksPage.clickOnNewRegistrationButton(); - - if ("eng".equalsIgnoreCase(language)) { - selectLanguagePage = new SelectLanguagePageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - selectLanguagePage = new SelectLanguagePageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - selectLanguagePage = new SelectLanguagePageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - selectLanguagePage = new SelectLanguagePageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - selectLanguagePage = new SelectLanguagePageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - selectLanguagePage = new SelectLanguagePageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - assertTrue(selectLanguagePage.isSelectLanguagePageLoaded(), "Verify if select language page is loaded"); - selectLanguagePage.clickOnSubmitButtonWithoutSelectingLanguage(); - - assertTrue(selectLanguagePage.isSelectLanguagePageLoaded(), - "Verify if user should not be allow to navigate to next screen."); - selectLanguagePage.selectSecondLanguage(); - - assertTrue(selectLanguagePage.isNotificationLanguageEnglishDisplayed(), - "verify if the notification language display in english"); - selectLanguagePage.selectNotificationlanguage(TestDataReader.readData("notificationLanguage")); - - assertTrue(selectLanguagePage.isSubmitButtonEnabled(), "verify if the submit button enabled"); - selectLanguagePage.clickOnSubmitButton(); - for (String screen : screenOrder) { - if (screen.equals("consentdet") || screen.equals("consent")) { - if ("eng".equalsIgnoreCase(language)) { - consentPage = new ConsentPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - consentPage = new ConsentPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - consentPage = new ConsentPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - consentPage = new ConsentPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - consentPage = new ConsentPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - consentPage = new ConsentPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - assertTrue(consentPage.isPageDisplayed("consentdet"), "Verify if Consent page is loaded"); - assertTrue(consentPage.isCheckBoxReadable(), "Verify if the check box in readable"); - - assertTrue(consentPage.isInformedButtonEnabled(), "Verify if informed button enabled"); - consentPage.clickOnInformedButton(); - } else if (screen.equals("DemographicDetails")) { - - if ("eng".equalsIgnoreCase(language)) { - demographicPage = new DemographicDetailsPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - demographicPage = new DemographicDetailsPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - demographicPage = new DemographicDetailsPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - demographicPage = new DemographicDetailsPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - demographicPage = new DemographicDetailsPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - demographicPage = new DemographicDetailsPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - assertTrue(demographicPage.isPageDisplayed("DemographicDetails"), - "Verify if demographic details page is displayed"); - - demographicPage.fillDemographicDetailsPage("adult"); - - demographicPage.clickOnContinueButton(); - } else if (screen.equals("Documents")) { - if ("eng".equalsIgnoreCase(language)) { - documentUploadPage = new DocumentUploadPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - documentUploadPage = new DocumentUploadPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - documentUploadPage = new DocumentUploadPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - documentUploadPage = new DocumentUploadPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - documentUploadPage = new DocumentUploadPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - documentUploadPage = new DocumentUploadPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - assertTrue(documentUploadPage.isDoccumentUploadPageDisplayed(), - "Verify if doccumentupload page is displayed"); - documentUploadPage.uploadDoccuments("adult", "ReferenceNumber"); - documentUploadPage.clickOnContinueButton(); - - } else if (screen.equals("BiometricDetails")) { - if ("eng".equalsIgnoreCase(language)) { - biometricDetailsPage = new BiometricDetailsPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - biometricDetailsPage = new BiometricDetailsPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - biometricDetailsPage = new BiometricDetailsPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - biometricDetailsPage = new BiometricDetailsPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - biometricDetailsPage = new BiometricDetailsPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - biometricDetailsPage = new BiometricDetailsPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - if ("eng".equalsIgnoreCase(language)) { - applicantBiometricsPage = new ApplicantBiometricsPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - applicantBiometricsPage = new ApplicantBiometricsPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - applicantBiometricsPage = new ApplicantBiometricsPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - applicantBiometricsPage = new ApplicantBiometricsPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - applicantBiometricsPage = new ApplicantBiometricsPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - applicantBiometricsPage = new ApplicantBiometricsPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), - "Verify if biometric details page is displayed"); - if (FetchUiSpec.eye.equals("yes")) { - biometricDetailsPage.clickOnIrisScan(); - - assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), - "Verify if applicant biometric page is displayed"); - applicantBiometricsPage.clickOnScanButton(); - - assertTrue(applicantBiometricsPage.isIrisScan(), "Verify if iris scan 1st attempt"); - applicantBiometricsPage.closeScanCapturePopUp(); - - applicantBiometricsPage.clickOnScanButton(); - assertTrue(applicantBiometricsPage.isIrisScan(), "Verify if iris scan 2nd attempt"); - applicantBiometricsPage.closeScanCapturePopUp(); - - applicantBiometricsPage.clickOnScanButton(); - assertTrue(applicantBiometricsPage.isIrisScan(), "Verify if iris scan 3rd attempt"); - applicantBiometricsPage.closeScanCapturePopUp(); - - biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); - } - // righthand - if (FetchUiSpec.rightHand.equals("yes")) { - assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), - "Verify if biometric details page is displayed"); - applicantBiometricsPage = biometricDetailsPage.clickOnRightHandScanIcon(); - - assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), - "Verify if applicant biometric page is displayed"); - applicantBiometricsPage.clickOnScanButton(); - - assertTrue(applicantBiometricsPage.isRightHandScan(), "Verify if right hand scan 1st attempt"); - applicantBiometricsPage.closeScanCapturePopUp(); - biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); - } - // lefthand - if (FetchUiSpec.leftHand.equals("yes")) { - assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), - "Verify if biometric details page is displayed"); - applicantBiometricsPage = biometricDetailsPage.clickOnLeftHandScanIcon(); - - assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), - "Verify if applicant biometric page is displayed"); - applicantBiometricsPage.clickOnScanButton(); - - assertTrue(applicantBiometricsPage.isLeftHandScan(), "Verify if Left hand scan 1st attempt"); - applicantBiometricsPage.closeScanCapturePopUp(); - biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); - } - // thumb - if (FetchUiSpec.thumb.equals("yes")) { - assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), - "Verify if biometric details page is displayed"); - applicantBiometricsPage = biometricDetailsPage.clickOnThumbsScanIcon(); - - assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), - "Verify if applicant biometric page is displayed"); - applicantBiometricsPage.clickOnScanButton(); - - assertTrue(applicantBiometricsPage.isThumbsScan(), "Verify if thumbs scan 1st attempt"); - applicantBiometricsPage.closeScanCapturePopUp(); - biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); - } - // face - if (FetchUiSpec.face.equals("yes")) { - assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), - "Verify if biometric details page is displayed"); - biometricDetailsPage.clickOnFaceScanIcon(); - - assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), - "Verify if applicant biometric page is displayed"); - applicantBiometricsPage.clickOnScanButton(); - - assertTrue(applicantBiometricsPage.isFaceScan(), "Verify if face scan 1st attempt"); - applicantBiometricsPage.closeScanCapturePopUp(); - applicantBiometricsPage.clickOnBackButton(); - } - assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), - "Verify if biometric details page is displayed"); - biometricDetailsPage.clickOnContinueButton(); - } - } - if ("eng".equalsIgnoreCase(language)) { - previewPage = new PreviewPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - previewPage = new PreviewPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - previewPage = new PreviewPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - previewPage = new PreviewPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - previewPage = new PreviewPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - previewPage = new PreviewPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - - assertTrue(previewPage.isNewRegistrationTitleDisplayed(), "Verify if new Registration title is displayed"); - assertTrue(previewPage.isBothIrisImageDisplayed(), "Verify if both iris image In PreviewPage is displayed"); - assertTrue(previewPage.isDemographicInformationInPreviewPageDisplayed(), - "Verify if Demographic Information In PreviewPage is displayed"); - assertTrue(previewPage.isBiometricsInformationInPreviewPagePageDisplayed(), - "Verify if Biometrics Information In PreviewPage is displayed"); - assertTrue(previewPage.isDocumentsInformationInPreviewPageDisplayed(), - "Verify if Documents Information In PreviewPage is displayed"); - previewPage.clickOnDemographicDetailsTitle(); - - for (String screen : screenOrder) { - if (screen.equals("DemographicDetails")) { - if ("eng".equalsIgnoreCase(language)) { - demographicPage = new DemographicDetailsPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - demographicPage = new DemographicDetailsPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - demographicPage = new DemographicDetailsPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - demographicPage = new DemographicDetailsPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - demographicPage = new DemographicDetailsPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - demographicPage = new DemographicDetailsPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - demographicPage.fillDemographicDetailsPage("minor"); - - demographicPage.clickOnContinueButton(); - } else if (screen.equals("Documents")) { - if ("eng".equalsIgnoreCase(language)) { - documentUploadPage = new DocumentUploadPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - documentUploadPage = new DocumentUploadPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - documentUploadPage = new DocumentUploadPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - documentUploadPage = new DocumentUploadPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - documentUploadPage = new DocumentUploadPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - documentUploadPage = new DocumentUploadPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - documentUploadPage.uploadDoccuments("minor", "withoutReferenceNumber"); - - documentUploadPage.uploadDoccuments("minor", "withoutReferenceNumber"); - - documentUploadPage.clickOnContinueButton(); - } else if (screen.equals("BiometricDetails")) { - if ("eng".equalsIgnoreCase(language)) { - biometricDetailsPage = new BiometricDetailsPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - biometricDetailsPage = new BiometricDetailsPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - biometricDetailsPage = new BiometricDetailsPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - biometricDetailsPage = new BiometricDetailsPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - biometricDetailsPage = new BiometricDetailsPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - biometricDetailsPage = new BiometricDetailsPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - - if ("eng".equalsIgnoreCase(language)) { - applicantBiometricsPage = new ApplicantBiometricsPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - applicantBiometricsPage = new ApplicantBiometricsPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - applicantBiometricsPage = new ApplicantBiometricsPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - applicantBiometricsPage = new ApplicantBiometricsPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - applicantBiometricsPage = new ApplicantBiometricsPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - applicantBiometricsPage = new ApplicantBiometricsPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - if (FetchUiSpec.eye.equals("yes")) { - biometricDetailsPage.clickOnIrisScan(); - - assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), - "Verify if applicant biometric page is displayed"); - applicantBiometricsPage.clickOnScanButton(); - - assertTrue(applicantBiometricsPage.isIrisScan(), "Verify if iris scan 1st attempt"); - applicantBiometricsPage.closeScanCapturePopUp(); - biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); - } - // righthand - if (FetchUiSpec.rightHand.equals("yes")) { - assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), - "Verify if biometric details page is displayed"); - applicantBiometricsPage = biometricDetailsPage.clickOnRightHandScanIcon(); - - assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), - "Verify if applicant biometric page is displayed"); - applicantBiometricsPage.clickOnScanButton(); - - assertTrue(applicantBiometricsPage.isRightHandScan(), "Verify if right hand scan 1st attempt"); - applicantBiometricsPage.closeScanCapturePopUp(); - biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); - } - // lefthand - if (FetchUiSpec.leftHand.equals("yes")) { - assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), - "Verify if biometric details page is displayed"); - applicantBiometricsPage = biometricDetailsPage.clickOnLeftHandScanIcon(); - - assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), - "Verify if applicant biometric page is displayed"); - applicantBiometricsPage.clickOnScanButton(); - - assertTrue(applicantBiometricsPage.isLeftHandScan(), "Verify if Left hand scan 1st attempt"); - applicantBiometricsPage.closeScanCapturePopUp(); - biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); - } - // thumb - if (FetchUiSpec.thumb.equals("yes")) { - assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), - "Verify if biometric details page is displayed"); - applicantBiometricsPage = biometricDetailsPage.clickOnThumbsScanIcon(); - - assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), - "Verify if applicant biometric page is displayed"); - applicantBiometricsPage.clickOnScanButton(); - - assertTrue(applicantBiometricsPage.isThumbsScan(), "Verify if thumbs scan 1st attempt"); - applicantBiometricsPage.closeScanCapturePopUp(); - biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); - } - // face - if (FetchUiSpec.face.equals("yes")) { - assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), - "Verify if biometric details page is displayed"); - biometricDetailsPage.clickOnFaceScanIcon(); - - assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), - "Verify if applicant biometric page is displayed"); - applicantBiometricsPage.clickOnScanButton(); - - assertTrue(applicantBiometricsPage.isFaceScan(), "Verify if face scan 1st attempt"); - applicantBiometricsPage.closeScanCapturePopUp(); - applicantBiometricsPage.clickOnBackButton(); - } - - assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), - "Verify if biometric details page is displayed"); - if ("eng".equalsIgnoreCase(language)) { - introducerBiometricPage = new IntroducerBiometricPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - introducerBiometricPage = new IntroducerBiometricPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - introducerBiometricPage = new IntroducerBiometricPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - introducerBiometricPage = new IntroducerBiometricPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - introducerBiometricPage = new IntroducerBiometricPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - introducerBiometricPage = new IntroducerBiometricPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - FetchUiSpec.eye = "no"; - FetchUiSpec.rightHand = "no"; - FetchUiSpec.leftHand = "no"; - FetchUiSpec.thumb = "no"; - FetchUiSpec.face = "no"; - FetchUiSpec.getBiometricDetails("introducerBiometrics"); - if (FetchUiSpec.eye.equals("yes")) { - biometricDetailsPage.clickOnIntroducerIrisScan(); - - introducerBiometricPage.clickOnScanButton(); - - assertTrue(introducerBiometricPage.isIrisScan(), "Verify if iris scan 1st attempt"); - introducerBiometricPage.closeScanCapturePopUp(); - introducerBiometricPage.clickOnNextButton(); - } - // righthand - if (FetchUiSpec.rightHand.equals("yes")) { - assertTrue(introducerBiometricPage.isRightHandScanTitleDisplayed(), - "Verify if right hand scan is displayed"); - introducerBiometricPage.clickOnScanButton(); - - assertTrue(introducerBiometricPage.isRightHandScan(), "Verify if right hand scan 1st attempt"); - introducerBiometricPage.closeScanCapturePopUp(); - introducerBiometricPage.clickOnNextButton(); - } - // lefthand - if (FetchUiSpec.leftHand.equals("yes")) { - assertTrue(introducerBiometricPage.isLeftHandScanTitleDisplayed(), - "Verify if applicant left hand scan title is displayed"); - introducerBiometricPage.clickOnScanButton(); - - assertTrue(introducerBiometricPage.isLeftHandScan(), "Verify if Left hand scan 1st attempt"); - introducerBiometricPage.closeScanCapturePopUp(); - introducerBiometricPage.clickOnNextButton(); - } - // thumb - if (FetchUiSpec.thumb.equals("yes")) { - assertTrue(introducerBiometricPage.isThumbsScanTitleDisplayed(), - "Verify if thumbs scan page is displayed"); - introducerBiometricPage.clickOnScanButton(); - - assertTrue(introducerBiometricPage.isThumbsScan(), "Verify if thumbs scan 1st attempt"); - introducerBiometricPage.closeScanCapturePopUp(); - introducerBiometricPage.clickOnNextButton(); - } - // face - if (FetchUiSpec.face.equals("yes")) { - assertTrue(introducerBiometricPage.isFaceScanTitleDisplayed(), - "Verify if face scan page is displayed"); - introducerBiometricPage.clickOnScanButton(); - - assertTrue(introducerBiometricPage.isFaceScan(), "Verify if face scan 1st attempt"); - introducerBiometricPage.closeScanCapturePopUp(); - biometricDetailsPage = introducerBiometricPage.clickOnNextButton(); - } - - biometricDetailsPage.clickOnContinueButton(); - } - } - if ("eng".equalsIgnoreCase(language)) { - previewPage = new PreviewPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - previewPage = new PreviewPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - previewPage = new PreviewPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - previewPage = new PreviewPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - previewPage = new PreviewPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - previewPage = new PreviewPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - assertTrue(previewPage.isNewRegistrationTitleDisplayed(), "Verify if new Registration title is displayed"); - assertTrue(previewPage.isApplicationIDPreviewPagePageDisplayed(), - "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"); - - String Aid = previewPage.getAID(); - - if ("eng".equalsIgnoreCase(language)) { - authenticationPage = new AuthenticationPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - authenticationPage = new AuthenticationPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - authenticationPage = new AuthenticationPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - authenticationPage = new AuthenticationPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - authenticationPage = new AuthenticationPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - authenticationPage = new AuthenticationPageArabic(driver); - } 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; - } - } - - assertTrue(isAuthenticationPageDisplayed, "Authentication page not displayed after retries"); - - authenticationPage.enterUserName(KeycloakUserManager.moduleSpecificUser); - authenticationPage.enterPassword(ArcConfigManager.getIAMUsersPassword()); - authenticationPage.clickOnAuthenticatenButton(); - if ("eng".equalsIgnoreCase(language)) { - acknowledgementPage = new AcknowledgementPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - acknowledgementPage = new AcknowledgementPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - acknowledgementPage = new AcknowledgementPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - acknowledgementPage = new AcknowledgementPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - acknowledgementPage = new AcknowledgementPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - acknowledgementPage = new AcknowledgementPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - assertTrue(acknowledgementPage.isAcknowledgementPageDisplayed(), - "Verify if acknowledgement details page is displayed"); - - acknowledgementPage.clickOnGoToHomeButton(); - - assertTrue(registrationTasksPage.isRegistrationTasksPageLoaded(), - "Verify if registration tasks page is loaded after click on cancel button"); - registrationTasksPage.clickOnOperationalTasksTitle(); - if ("eng".equalsIgnoreCase(language)) { - operationalTaskPage = new OperationalTaskPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - operationalTaskPage = new OperationalTaskPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - operationalTaskPage = new OperationalTaskPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - operationalTaskPage = new OperationalTaskPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - operationalTaskPage = new OperationalTaskPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - operationalTaskPage = new OperationalTaskPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - assertTrue(operationalTaskPage.isOperationalTaskPageLoaded(), "Verify if operational Task Page is loaded"); - assertTrue(operationalTaskPage.isPendingApprovalTitleDisplayed(), "Verify if pending approval tite displayed"); - operationalTaskPage.clickPendingApprovalTitle(); - - if ("eng".equalsIgnoreCase(language)) { - pendingApproval = new PendingApprovalEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - pendingApproval = new PendingApprovalHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - pendingApproval = new PendingApprovalFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - pendingApproval = new PendingApprovalKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - pendingApproval = new PendingApprovalTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - pendingApproval = new PendingApprovalArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - pendingApproval.enterAID(Aid); - - pendingApproval.clickOnAID(Aid); - - pendingApproval.clickOnApproveButton(); - pendingApproval.clickOnClosePopUpButton(); - - pendingApproval.clickOnCheckBox(); - - assertTrue(pendingApproval.isAuthenticateButtonEnabled(), - "Verify if authenticate button is enable after selecting packet"); - - boolean isPageDisplayed = false; - - for (int i = 0; i < 3; i++) { - pendingApproval.clickOnAuthenticateButton(); - - if (pendingApproval.isSupervisorAuthenticationTitleDisplayed()) { - isPageDisplayed = true; - break; - } - } - - assertTrue(isPageDisplayed, "Supervisor Authentication page not displayed after retries"); - - pendingApproval.enterUserName(KeycloakUserManager.moduleSpecificUser); - pendingApproval.enterPassword(ArcConfigManager.getIAMUsersPassword()); - pendingApproval.clickOnSubmitButton(); - - pendingApproval.clickOnBackButton(); - - operationalTaskPage.clickApplicationUploadTitle(); - if ("eng".equalsIgnoreCase(language)) { - manageApplicationsPage = new ManageApplicationsPageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - manageApplicationsPage = new ManageApplicationsPageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - manageApplicationsPage = new ManageApplicationsPageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - manageApplicationsPage = new ManageApplicationsPageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - manageApplicationsPage = new ManageApplicationsPageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - manageApplicationsPage = new ManageApplicationsPageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - assertTrue(manageApplicationsPage.isManageApplicationPageDisplayed(), - "Verify if manage Applications Page displayed"); - manageApplicationsPage.enterAID(Aid); - - assertTrue(manageApplicationsPage.isSearchAIDDisplayed(Aid), "Verify if Search Aid should displayed"); - manageApplicationsPage.clickOnSearchCheckBox(); - boolean uploadSuccess = false; - - for (int i = 0; i < 3; i++) { - manageApplicationsPage.clickOnUploadButton(); - - if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) { - uploadSuccess = true; - break; - } - } - - assertTrue(uploadSuccess, "Upload failed after retries: No Network Found still displayed"); - - manageApplicationsPage.clickOnBackButton(); - - registrationTasksPage.clickProfileButton(); - - if ("eng".equalsIgnoreCase(language)) { - profilePage = new ProfilePageEnglish(driver); - } else if ("hin".equalsIgnoreCase(language)) { - profilePage = new ProfilePageHindi(driver); - } else if ("fra".equalsIgnoreCase(language)) { - profilePage = new ProfilePageFrench(driver); - } else if ("kan".equalsIgnoreCase(language)) { - profilePage = new ProfilePageKannada(driver); - } else if ("tam".equalsIgnoreCase(language)) { - profilePage = new ProfilePageTamil(driver); - } else if ("ara".equalsIgnoreCase(language)) { - profilePage = new ProfilePageArabic(driver); - } else { - throw new IllegalStateException("Unsupported language in testdata.json: " + language); - } - profilePage.clickOnLogoutButton(); - assertTrue(loginPage.isLoginPageLoaded(), "verify if login page is displayeded in Selected language"); - - } - } diff --git a/ui-test/src/main/java/regclient/androidTestCases/NewRegistrationAdultUploadMultipleDoccuments.java b/ui-test/src/main/java/regclient/androidTestCases/NewRegistrationAdultUploadMultipleDoccuments.java new file mode 100644 index 000000000..d074ebfa5 --- /dev/null +++ b/ui-test/src/main/java/regclient/androidTestCases/NewRegistrationAdultUploadMultipleDoccuments.java @@ -0,0 +1,857 @@ +package regclient.androidTestCases; + +import static org.testng.Assert.assertTrue; + +import java.util.List; + +import org.testng.annotations.Test; + +import regclient.BaseTest.AndroidBaseTest; +import regclient.api.ArcConfigManager; +import regclient.api.FetchUiSpec; +import regclient.api.KeycloakUserManager; +import regclient.page.AcknowledgementPage; +import regclient.page.ApplicantBiometricsPage; +import regclient.page.AuthenticationPage; +import regclient.page.BiometricDetailsPage; +import regclient.page.ConsentPage; +import regclient.page.DemographicDetailsPage; +import regclient.page.DocumentUploadPage; +import regclient.page.IntroducerBiometricPage; +import regclient.page.LoginPage; +import regclient.page.ManageApplicationsPage; +import regclient.page.OperationalTaskPage; +import regclient.page.PendingApproval; +import regclient.page.PreviewPage; +import regclient.page.ProfilePage; +import regclient.page.RegistrationTasksPage; +import regclient.page.SelectLanguagePage; +import regclient.pages.arabic.AcknowledgementPageArabic; +import regclient.pages.arabic.ApplicantBiometricsPageArabic; +import regclient.pages.arabic.AuthenticationPageArabic; +import regclient.pages.arabic.BiometricDetailsPageArabic; +import regclient.pages.arabic.ConsentPageArabic; +import regclient.pages.arabic.DemographicDetailsPageArabic; +import regclient.pages.arabic.DocumentUploadPageArabic; +import regclient.pages.arabic.IntroducerBiometricPageArabic; +import regclient.pages.arabic.LoginPageArabic; +import regclient.pages.arabic.ManageApplicationsPageArabic; +import regclient.pages.arabic.OperationalTaskPageArabic; +import regclient.pages.arabic.PendingApprovalArabic; +import regclient.pages.arabic.PreviewPageArabic; +import regclient.pages.arabic.ProfilePageArabic; +import regclient.pages.arabic.RegistrationTasksPageArabic; +import regclient.pages.arabic.SelectLanguagePageArabic; +import regclient.pages.english.AcknowledgementPageEnglish; +import regclient.pages.english.ApplicantBiometricsPageEnglish; +import regclient.pages.english.AuthenticationPageEnglish; +import regclient.pages.english.BiometricDetailsPageEnglish; +import regclient.pages.english.ConsentPageEnglish; +import regclient.pages.english.DemographicDetailsPageEnglish; +import regclient.pages.english.DocumentUploadPageEnglish; +import regclient.pages.english.IntroducerBiometricPageEnglish; +import regclient.pages.english.LoginPageEnglish; +import regclient.pages.english.ManageApplicationsPageEnglish; +import regclient.pages.english.OperationalTaskPageEnglish; +import regclient.pages.english.PendingApprovalEnglish; +import regclient.pages.english.PreviewPageEnglish; +import regclient.pages.english.ProfilePageEnglish; +import regclient.pages.english.RegistrationTasksPageEnglish; +import regclient.pages.english.SelectLanguagePageEnglish; +import regclient.pages.french.AcknowledgementPageFrench; +import regclient.pages.french.ApplicantBiometricsPageFrench; +import regclient.pages.french.AuthenticationPageFrench; +import regclient.pages.french.BiometricDetailsPageFrench; +import regclient.pages.french.ConsentPageFrench; +import regclient.pages.french.DemographicDetailsPageFrench; +import regclient.pages.french.DocumentUploadPageFrench; +import regclient.pages.french.IntroducerBiometricPageFrench; +import regclient.pages.french.LoginPageFrench; +import regclient.pages.french.ManageApplicationsPageFrench; +import regclient.pages.french.OperationalTaskPageFrench; +import regclient.pages.french.PendingApprovalFrench; +import regclient.pages.french.PreviewPageFrench; +import regclient.pages.french.ProfilePageFrench; +import regclient.pages.french.RegistrationTasksPageFrench; +import regclient.pages.french.SelectLanguagePageFrench; +import regclient.pages.hindi.AcknowledgementPageHindi; +import regclient.pages.hindi.ApplicantBiometricsPageHindi; +import regclient.pages.hindi.AuthenticationPageHindi; +import regclient.pages.hindi.BiometricDetailsPageHindi; +import regclient.pages.hindi.ConsentPageHindi; +import regclient.pages.hindi.DemographicDetailsPageHindi; +import regclient.pages.hindi.DocumentUploadPageHindi; +import regclient.pages.hindi.IntroducerBiometricPageHindi; +import regclient.pages.hindi.LoginPageHindi; +import regclient.pages.hindi.ManageApplicationsPageHindi; +import regclient.pages.hindi.OperationalTaskPageHindi; +import regclient.pages.hindi.PendingApprovalHindi; +import regclient.pages.hindi.PreviewPageHindi; +import regclient.pages.hindi.ProfilePageHindi; +import regclient.pages.hindi.RegistrationTasksPageHindi; +import regclient.pages.hindi.SelectLanguagePageHindi; +import regclient.pages.kannada.AcknowledgementPageKannada; +import regclient.pages.kannada.ApplicantBiometricsPageKannada; +import regclient.pages.kannada.AuthenticationPageKannada; +import regclient.pages.kannada.BiometricDetailsPageKannada; +import regclient.pages.kannada.ConsentPageKannada; +import regclient.pages.kannada.DemographicDetailsPageKannada; +import regclient.pages.kannada.DocumentUploadPageKannada; +import regclient.pages.kannada.IntroducerBiometricPageKannada; +import regclient.pages.kannada.LoginPageKannada; +import regclient.pages.kannada.ManageApplicationsPageKannada; +import regclient.pages.kannada.OperationalTaskPageKannada; +import regclient.pages.kannada.PendingApprovalKannada; +import regclient.pages.kannada.PreviewPageKannada; +import regclient.pages.kannada.ProfilePageKannada; +import regclient.pages.kannada.RegistrationTasksPageKannada; +import regclient.pages.kannada.SelectLanguagePageKannada; +import regclient.pages.tamil.AcknowledgementPageTamil; +import regclient.pages.tamil.ApplicantBiometricsPageTamil; +import regclient.pages.tamil.AuthenticationPageTamil; +import regclient.pages.tamil.BiometricDetailsPageTamil; +import regclient.pages.tamil.ConsentPageTamil; +import regclient.pages.tamil.DemographicDetailsPageTamil; +import regclient.pages.tamil.DocumentUploadPageTamil; +import regclient.pages.tamil.IntroducerBiometricPageTamil; +import regclient.pages.tamil.LoginPageTamil; +import regclient.pages.tamil.ManageApplicationsPageTamil; +import regclient.pages.tamil.OperationalTaskPageTamil; +import regclient.pages.tamil.PendingApprovalTamil; +import regclient.pages.tamil.PreviewPageTamil; +import regclient.pages.tamil.ProfilePageTamil; +import regclient.pages.tamil.RegistrationTasksPageTamil; +import regclient.pages.tamil.SelectLanguagePageTamil; +import regclient.utils.TestDataReader; + +public class NewRegistrationAdultUploadMultipleDoccuments extends AndroidBaseTest{ + @Test(priority = 0, description = "Verify adult new registration using multiple Documents") + public void newRegistrationAdultUploadMultipleDoccuments() throws InterruptedException { + FetchUiSpec.getUiSpec("newProcess"); + FetchUiSpec.getBiometricDetails("individualBiometrics"); + List screenOrder = FetchUiSpec.getAllScreenOrder(); + LoginPage loginPage = null; + RegistrationTasksPage registrationTasksPage = null; + SelectLanguagePage selectLanguagePage = null; + ConsentPage consentPage = null; + DemographicDetailsPage demographicPage = null; + DocumentUploadPage documentUploadPage = null; + BiometricDetailsPage biometricDetailsPage = null; + ApplicantBiometricsPage applicantBiometricsPage = null; + PreviewPage previewPage = null; + AuthenticationPage authenticationPage = null; + AcknowledgementPage acknowledgementPage = null; + OperationalTaskPage operationalTaskPage = null; + PendingApproval pendingApproval = null; + ManageApplicationsPage manageApplicationsPage = null; + ProfilePage profilePage = null; + IntroducerBiometricPage introducerBiometricPage = null; + + final String language = TestDataReader.readData("language"); + + if ("eng".equalsIgnoreCase(language)) { + loginPage = new LoginPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + loginPage = new LoginPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + loginPage = new LoginPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + loginPage = new LoginPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + loginPage = new LoginPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + loginPage = new LoginPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + + loginPage.selectLanguage(); + + assertTrue(loginPage.isWelcomeMessageInSelectedLanguageDisplayed(), + "verify if the welcome msg in selected language displayed"); + loginPage.enterUserName(KeycloakUserManager.moduleSpecificUser); + loginPage.clickOnNextButton(); + + loginPage.enterPassword(ArcConfigManager.getIAMUsersPassword()); + loginPage.clickOnloginButton(); + + if ("eng".equalsIgnoreCase(language)) { + registrationTasksPage = new RegistrationTasksPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + registrationTasksPage = new RegistrationTasksPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + registrationTasksPage = new RegistrationTasksPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + registrationTasksPage = new RegistrationTasksPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + registrationTasksPage = new RegistrationTasksPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + registrationTasksPage = new RegistrationTasksPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + + assertTrue(registrationTasksPage.isRegistrationTasksPageLoaded(), + "Verify if registration tasks page is loaded"); + + registrationTasksPage.clickOnNewRegistrationButton(); + + if ("eng".equalsIgnoreCase(language)) { + selectLanguagePage = new SelectLanguagePageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + selectLanguagePage = new SelectLanguagePageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + selectLanguagePage = new SelectLanguagePageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + selectLanguagePage = new SelectLanguagePageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + selectLanguagePage = new SelectLanguagePageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + selectLanguagePage = new SelectLanguagePageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(selectLanguagePage.isSelectLanguagePageLoaded(), "Verify if select language page is loaded"); + selectLanguagePage.clickOnSubmitButtonWithoutSelectingLanguage(); + + assertTrue(selectLanguagePage.isSelectLanguagePageLoaded(), + "Verify if user should not be allow to navigate to next screen."); + selectLanguagePage.selectSecondLanguage(); + + assertTrue(selectLanguagePage.isNotificationLanguageEnglishDisplayed(), + "verify if the notification language display in english"); + selectLanguagePage.selectNotificationlanguage(TestDataReader.readData("notificationLanguage")); + + assertTrue(selectLanguagePage.isSubmitButtonEnabled(), "verify if the submit button enabled"); + selectLanguagePage.clickOnSubmitButton(); + for (String screen : screenOrder) { + if (screen.equals("consentdet") || screen.equals("consent")) { + if ("eng".equalsIgnoreCase(language)) { + consentPage = new ConsentPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + consentPage = new ConsentPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + consentPage = new ConsentPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + consentPage = new ConsentPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + consentPage = new ConsentPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + consentPage = new ConsentPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(consentPage.isPageDisplayed("consentdet"), "Verify if Consent page is loaded"); + assertTrue(consentPage.isCheckBoxReadable(), "Verify if the check box in readable"); + + assertTrue(consentPage.isInformedButtonEnabled(), "Verify if informed button enabled"); + consentPage.clickOnInformedButton(); + } else if (screen.equals("DemographicDetails")) { + + if ("eng".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(demographicPage.isPageDisplayed("DemographicDetails"), + "Verify if demographic details page is displayed"); + + demographicPage.fillDemographicDetailsPage("adult"); + + demographicPage.clickOnContinueButton(); + } else if (screen.equals("Documents")) { + if ("eng".equalsIgnoreCase(language)) { + documentUploadPage = new DocumentUploadPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + documentUploadPage = new DocumentUploadPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + documentUploadPage = new DocumentUploadPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + documentUploadPage = new DocumentUploadPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + documentUploadPage = new DocumentUploadPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + documentUploadPage = new DocumentUploadPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(documentUploadPage.isDoccumentUploadPageDisplayed(), + "Verify if doccumentupload page is displayed"); + documentUploadPage.uploadDoccuments("adult", "ReferenceNumber"); + documentUploadPage.clickOnContinueButton(); + + } else if (screen.equals("BiometricDetails")) { + if ("eng".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + if ("eng".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + if (FetchUiSpec.eye.equals("yes")) { + biometricDetailsPage.clickOnIrisScan(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isIrisScan(), "Verify if iris scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + + applicantBiometricsPage.clickOnScanButton(); + assertTrue(applicantBiometricsPage.isIrisScan(), "Verify if iris scan 2nd attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + + applicantBiometricsPage.clickOnScanButton(); + assertTrue(applicantBiometricsPage.isIrisScan(), "Verify if iris scan 3rd attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + + biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); + } + // righthand + if (FetchUiSpec.rightHand.equals("yes")) { + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + applicantBiometricsPage = biometricDetailsPage.clickOnRightHandScanIcon(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isRightHandScan(), "Verify if right hand scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); + } + // lefthand + if (FetchUiSpec.leftHand.equals("yes")) { + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + applicantBiometricsPage = biometricDetailsPage.clickOnLeftHandScanIcon(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isLeftHandScan(), "Verify if Left hand scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); + } + // thumb + if (FetchUiSpec.thumb.equals("yes")) { + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + applicantBiometricsPage = biometricDetailsPage.clickOnThumbsScanIcon(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isThumbsScan(), "Verify if thumbs scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); + } + // face + if (FetchUiSpec.face.equals("yes")) { + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + biometricDetailsPage.clickOnFaceScanIcon(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isFaceScan(), "Verify if face scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + applicantBiometricsPage.clickOnBackButton(); + } + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + biometricDetailsPage.clickOnContinueButton(); + } + } + if ("eng".equalsIgnoreCase(language)) { + previewPage = new PreviewPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + previewPage = new PreviewPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + previewPage = new PreviewPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + previewPage = new PreviewPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + previewPage = new PreviewPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + previewPage = new PreviewPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + + assertTrue(previewPage.isNewRegistrationTitleDisplayed(), "Verify if new Registration title is displayed"); + assertTrue(previewPage.isBothIrisImageDisplayed(), "Verify if both iris image In PreviewPage is displayed"); + assertTrue(previewPage.isDemographicInformationInPreviewPageDisplayed(), + "Verify if Demographic Information In PreviewPage is displayed"); + assertTrue(previewPage.isBiometricsInformationInPreviewPagePageDisplayed(), + "Verify if Biometrics Information In PreviewPage is displayed"); + assertTrue(previewPage.isDocumentsInformationInPreviewPageDisplayed(), + "Verify if Documents Information In PreviewPage is displayed"); + previewPage.clickOnDemographicDetailsTitle(); + + for (String screen : screenOrder) { + if (screen.equals("DemographicDetails")) { + if ("eng".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + demographicPage = new DemographicDetailsPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + demographicPage.fillDemographicDetailsPage("minor"); + + demographicPage.clickOnContinueButton(); + } else if (screen.equals("Documents")) { + if ("eng".equalsIgnoreCase(language)) { + documentUploadPage = new DocumentUploadPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + documentUploadPage = new DocumentUploadPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + documentUploadPage = new DocumentUploadPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + documentUploadPage = new DocumentUploadPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + documentUploadPage = new DocumentUploadPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + documentUploadPage = new DocumentUploadPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + documentUploadPage.uploadDoccuments("minor", "withoutReferenceNumber"); + + documentUploadPage.uploadDoccuments("minor", "withoutReferenceNumber"); + + documentUploadPage.clickOnContinueButton(); + } else if (screen.equals("BiometricDetails")) { + if ("eng".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + biometricDetailsPage = new BiometricDetailsPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + + if ("eng".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + applicantBiometricsPage = new ApplicantBiometricsPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + if (FetchUiSpec.eye.equals("yes")) { + biometricDetailsPage.clickOnIrisScan(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isIrisScan(), "Verify if iris scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); + } + // righthand + if (FetchUiSpec.rightHand.equals("yes")) { + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + applicantBiometricsPage = biometricDetailsPage.clickOnRightHandScanIcon(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isRightHandScan(), "Verify if right hand scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); + } + // lefthand + if (FetchUiSpec.leftHand.equals("yes")) { + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + applicantBiometricsPage = biometricDetailsPage.clickOnLeftHandScanIcon(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isLeftHandScan(), "Verify if Left hand scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); + } + // thumb + if (FetchUiSpec.thumb.equals("yes")) { + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + applicantBiometricsPage = biometricDetailsPage.clickOnThumbsScanIcon(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isThumbsScan(), "Verify if thumbs scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + biometricDetailsPage = applicantBiometricsPage.clickOnBackButton(); + } + // face + if (FetchUiSpec.face.equals("yes")) { + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + biometricDetailsPage.clickOnFaceScanIcon(); + + assertTrue(applicantBiometricsPage.isApplicantBiometricsPageDisplayed(), + "Verify if applicant biometric page is displayed"); + applicantBiometricsPage.clickOnScanButton(); + + assertTrue(applicantBiometricsPage.isFaceScan(), "Verify if face scan 1st attempt"); + applicantBiometricsPage.closeScanCapturePopUp(); + applicantBiometricsPage.clickOnBackButton(); + } + + assertTrue(biometricDetailsPage.isBiometricDetailsPageDisplayed(), + "Verify if biometric details page is displayed"); + if ("eng".equalsIgnoreCase(language)) { + introducerBiometricPage = new IntroducerBiometricPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + introducerBiometricPage = new IntroducerBiometricPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + introducerBiometricPage = new IntroducerBiometricPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + introducerBiometricPage = new IntroducerBiometricPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + introducerBiometricPage = new IntroducerBiometricPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + introducerBiometricPage = new IntroducerBiometricPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + FetchUiSpec.eye = "no"; + FetchUiSpec.rightHand = "no"; + FetchUiSpec.leftHand = "no"; + FetchUiSpec.thumb = "no"; + FetchUiSpec.face = "no"; + FetchUiSpec.getBiometricDetails("introducerBiometrics"); + if (FetchUiSpec.eye.equals("yes")) { + biometricDetailsPage.clickOnIntroducerIrisScan(); + + introducerBiometricPage.clickOnScanButton(); + + assertTrue(introducerBiometricPage.isIrisScan(), "Verify if iris scan 1st attempt"); + introducerBiometricPage.closeScanCapturePopUp(); + introducerBiometricPage.clickOnNextButton(); + } + // righthand + if (FetchUiSpec.rightHand.equals("yes")) { + assertTrue(introducerBiometricPage.isRightHandScanTitleDisplayed(), + "Verify if right hand scan is displayed"); + introducerBiometricPage.clickOnScanButton(); + + assertTrue(introducerBiometricPage.isRightHandScan(), "Verify if right hand scan 1st attempt"); + introducerBiometricPage.closeScanCapturePopUp(); + introducerBiometricPage.clickOnNextButton(); + } + // lefthand + if (FetchUiSpec.leftHand.equals("yes")) { + assertTrue(introducerBiometricPage.isLeftHandScanTitleDisplayed(), + "Verify if applicant left hand scan title is displayed"); + introducerBiometricPage.clickOnScanButton(); + + assertTrue(introducerBiometricPage.isLeftHandScan(), "Verify if Left hand scan 1st attempt"); + introducerBiometricPage.closeScanCapturePopUp(); + introducerBiometricPage.clickOnNextButton(); + } + // thumb + if (FetchUiSpec.thumb.equals("yes")) { + assertTrue(introducerBiometricPage.isThumbsScanTitleDisplayed(), + "Verify if thumbs scan page is displayed"); + introducerBiometricPage.clickOnScanButton(); + + assertTrue(introducerBiometricPage.isThumbsScan(), "Verify if thumbs scan 1st attempt"); + introducerBiometricPage.closeScanCapturePopUp(); + introducerBiometricPage.clickOnNextButton(); + } + // face + if (FetchUiSpec.face.equals("yes")) { + assertTrue(introducerBiometricPage.isFaceScanTitleDisplayed(), + "Verify if face scan page is displayed"); + introducerBiometricPage.clickOnScanButton(); + + assertTrue(introducerBiometricPage.isFaceScan(), "Verify if face scan 1st attempt"); + introducerBiometricPage.closeScanCapturePopUp(); + biometricDetailsPage = introducerBiometricPage.clickOnNextButton(); + } + + biometricDetailsPage.clickOnContinueButton(); + } + } + if ("eng".equalsIgnoreCase(language)) { + previewPage = new PreviewPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + previewPage = new PreviewPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + previewPage = new PreviewPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + previewPage = new PreviewPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + previewPage = new PreviewPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + previewPage = new PreviewPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(previewPage.isNewRegistrationTitleDisplayed(), "Verify if new Registration title is displayed"); + assertTrue(previewPage.isApplicationIDPreviewPagePageDisplayed(), + "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"); + + String Aid = previewPage.getAID(); + + if ("eng".equalsIgnoreCase(language)) { + authenticationPage = new AuthenticationPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + authenticationPage = new AuthenticationPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + authenticationPage = new AuthenticationPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + authenticationPage = new AuthenticationPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + authenticationPage = new AuthenticationPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + authenticationPage = new AuthenticationPageArabic(driver); + } 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; + } + } + + assertTrue(isAuthenticationPageDisplayed, "Authentication page not displayed after retries"); + + authenticationPage.enterUserName(KeycloakUserManager.moduleSpecificUser); + authenticationPage.enterPassword(ArcConfigManager.getIAMUsersPassword()); + authenticationPage.clickOnAuthenticatenButton(); + if ("eng".equalsIgnoreCase(language)) { + acknowledgementPage = new AcknowledgementPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + acknowledgementPage = new AcknowledgementPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + acknowledgementPage = new AcknowledgementPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + acknowledgementPage = new AcknowledgementPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + acknowledgementPage = new AcknowledgementPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + acknowledgementPage = new AcknowledgementPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(acknowledgementPage.isAcknowledgementPageDisplayed(), + "Verify if acknowledgement details page is displayed"); + + acknowledgementPage.clickOnGoToHomeButton(); + + assertTrue(registrationTasksPage.isRegistrationTasksPageLoaded(), + "Verify if registration tasks page is loaded after click on cancel button"); + registrationTasksPage.clickOnOperationalTasksTitle(); + if ("eng".equalsIgnoreCase(language)) { + operationalTaskPage = new OperationalTaskPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + operationalTaskPage = new OperationalTaskPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + operationalTaskPage = new OperationalTaskPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + operationalTaskPage = new OperationalTaskPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + operationalTaskPage = new OperationalTaskPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + operationalTaskPage = new OperationalTaskPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(operationalTaskPage.isOperationalTaskPageLoaded(), "Verify if operational Task Page is loaded"); + assertTrue(operationalTaskPage.isPendingApprovalTitleDisplayed(), "Verify if pending approval tite displayed"); + operationalTaskPage.clickPendingApprovalTitle(); + + if ("eng".equalsIgnoreCase(language)) { + pendingApproval = new PendingApprovalEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + pendingApproval = new PendingApprovalHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + pendingApproval = new PendingApprovalFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + pendingApproval = new PendingApprovalKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + pendingApproval = new PendingApprovalTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + pendingApproval = new PendingApprovalArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + pendingApproval.enterAID(Aid); + + pendingApproval.clickOnAID(Aid); + + pendingApproval.clickOnApproveButton(); + pendingApproval.clickOnClosePopUpButton(); + + pendingApproval.clickOnCheckBox(); + + assertTrue(pendingApproval.isAuthenticateButtonEnabled(), + "Verify if authenticate button is enable after selecting packet"); + + boolean isPageDisplayed = false; + + for (int i = 0; i < 3; i++) { + pendingApproval.clickOnAuthenticateButton(); + + if (pendingApproval.isSupervisorAuthenticationTitleDisplayed()) { + isPageDisplayed = true; + break; + } + } + + assertTrue(isPageDisplayed, "Supervisor Authentication page not displayed after retries"); + + pendingApproval.enterUserName(KeycloakUserManager.moduleSpecificUser); + pendingApproval.enterPassword(ArcConfigManager.getIAMUsersPassword()); + pendingApproval.clickOnSubmitButton(); + + pendingApproval.clickOnBackButton(); + + operationalTaskPage.clickApplicationUploadTitle(); + if ("eng".equalsIgnoreCase(language)) { + manageApplicationsPage = new ManageApplicationsPageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + manageApplicationsPage = new ManageApplicationsPageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + manageApplicationsPage = new ManageApplicationsPageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + manageApplicationsPage = new ManageApplicationsPageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + manageApplicationsPage = new ManageApplicationsPageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + manageApplicationsPage = new ManageApplicationsPageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + assertTrue(manageApplicationsPage.isManageApplicationPageDisplayed(), + "Verify if manage Applications Page displayed"); + manageApplicationsPage.enterAID(Aid); + + assertTrue(manageApplicationsPage.isSearchAIDDisplayed(Aid), "Verify if Search Aid should displayed"); + manageApplicationsPage.clickOnSearchCheckBox(); + boolean uploadSuccess = false; + + for (int i = 0; i < 3; i++) { + manageApplicationsPage.clickOnUploadButton(); + + if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) { + uploadSuccess = true; + break; + } + } + + assertTrue(uploadSuccess, "Upload failed after retries: No Network Found still displayed"); + + manageApplicationsPage.clickOnBackButton(); + + registrationTasksPage.clickProfileButton(); + + if ("eng".equalsIgnoreCase(language)) { + profilePage = new ProfilePageEnglish(driver); + } else if ("hin".equalsIgnoreCase(language)) { + profilePage = new ProfilePageHindi(driver); + } else if ("fra".equalsIgnoreCase(language)) { + profilePage = new ProfilePageFrench(driver); + } else if ("kan".equalsIgnoreCase(language)) { + profilePage = new ProfilePageKannada(driver); + } else if ("tam".equalsIgnoreCase(language)) { + profilePage = new ProfilePageTamil(driver); + } else if ("ara".equalsIgnoreCase(language)) { + profilePage = new ProfilePageArabic(driver); + } else { + throw new IllegalStateException("Unsupported language in testdata.json: " + language); + } + profilePage.clickOnLogoutButton(); + assertTrue(loginPage.isLoginPageLoaded(), "verify if login page is displayeded in Selected language"); + + } + +} + diff --git a/ui-test/src/main/java/regclient/api/AdminTestUtil.java b/ui-test/src/main/java/regclient/api/AdminTestUtil.java index 29f396d8c..64af96137 100644 --- a/ui-test/src/main/java/regclient/api/AdminTestUtil.java +++ b/ui-test/src/main/java/regclient/api/AdminTestUtil.java @@ -11,9 +11,14 @@ import com.github.javafaker.Faker; import javax.ws.rs.core.MediaType; + +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.format.DateTimeFormatter; +import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.Date; @@ -54,18 +59,17 @@ public static String generateCurrentUTCTimeStamp() { dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); return dateFormat.format(date); } - + public static String generateFutureUTCTimeStamp(int daysToAdd) { - Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")); - calendar.add(Calendar.DAY_OF_YEAR, daysToAdd); + Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")); + calendar.add(Calendar.DAY_OF_YEAR, daysToAdd); - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); - dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); + dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); - return dateFormat.format(calendar.getTime()); + return dateFormat.format(calendar.getTime()); } - public static String machinespecificationsID() { return AdminTestUtil.getmachinespecificationsID(tokenRoleAdmin); } @@ -106,7 +110,7 @@ public static void initialize() { if (!initialized) { ArcConfigManager.init(); BaseTestCase.initialize(); - //user zone and center mapping + // user zone and center mapping KeycloakUserManager.createUsers(); mapUserToZone(BaseTestCase.currentModule + "-" + propsKernel.getProperty("iam-users-to-create"), propsKernel.getProperty("zone")); @@ -114,13 +118,13 @@ public static void initialize() { mapUserToCenter(BaseTestCase.currentModule + "-" + propsKernel.getProperty("iam-users-to-create"), propsKernel.getProperty("regCenterId")); mapCenter(BaseTestCase.currentModule + "-" + propsKernel.getProperty("iam-users-to-create")); - //user zone and center mapping + // user zone and center mapping KeycloakUserManager.createUsersWithOutDefaultRole(); mapUserToZone(KeycloakUserManager.onboardUser, propsKernel.getProperty("zone")); mapZone(KeycloakUserManager.onboardUser); mapUserToCenter(KeycloakUserManager.onboardUser, propsKernel.getProperty("regCenterId")); mapCenter(KeycloakUserManager.onboardUser); - //user zone and center mapping + // user zone and center mapping KeycloakUserManager.createUsersWithOutSupervisorRole(); mapUserToZone(BaseTestCase.currentModule + "-" + propsKernel.getProperty("iam-users-to-create-operator"), propsKernel.getProperty("zone")); @@ -429,4 +433,33 @@ public static String activateMachine(String id) { return responseobj.getString("status"); } + private static final Logger LOG = Logger.getLogger(AdminTestUtil.class); + private static final List knownIssues = new ArrayList<>(); + + static { + try (InputStream is = AdminTestUtil.class.getClassLoader().getResourceAsStream("config/knownIssues.txt")) { + + if (is == null) { + LOG.warn("knownIssues.txt not found in classpath"); + } else { + try (BufferedReader br = new BufferedReader(new InputStreamReader(is))) { + String line; + while ((line = br.readLine()) != null) { + if (!line.trim().isEmpty()) { + knownIssues.add(line.trim()); + } + } + } + LOG.info("Known Issues Loaded: " + knownIssues); + } + + } catch (Exception e) { + LOG.warn("Error while loading knownIssues.txt", e); + } + } + + public static List getKnownIssues() { + return knownIssues; + } + } \ No newline at end of file diff --git a/ui-test/src/main/java/regclient/page/ExportPage.java b/ui-test/src/main/java/regclient/page/ExportPage.java index 90b814480..ec4c81fbe 100644 --- a/ui-test/src/main/java/regclient/page/ExportPage.java +++ b/ui-test/src/main/java/regclient/page/ExportPage.java @@ -57,6 +57,15 @@ public class ExportPage extends BasePage { @FindBy(xpath = "(//android.widget.TextView[@text='PACKET_MANAGER_ACCOUNT'])[2]") private WebElement packetManagerTitle; + @AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.TextView\").text(\"ExportPacket\")") + private WebElement exportPacketFolder; + + @AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.TextView\").text(\"Documents\")") + private WebElement documentsTitleHeader; + + @AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.TextView\").text(\"packets\")") + private WebElement packetsTitleHeader; + public ExportPage(AppiumDriver driver) { super(driver); } @@ -97,6 +106,15 @@ public boolean isNewFolderPopupDisplayed() { return isElementDisplayed(newfolderPopup); } + public boolean isFolderDisplayed(String folderName) { + try { + return driver.findElement(MobileBy.AndroidUIAutomator("new UiSelector().text(\"" + folderName + "\")")) + .isDisplayed(); + } catch (Exception e) { + return false; + } + } + public void enterFolderName(String foldername) { clickAndsendKeysToTextBox(newfolderTextBox, foldername); } @@ -131,37 +149,13 @@ public void handleAllowFolderConsentIfPresent() { } public boolean isPacketManagerTitleDisplayed() { - if (isElementDisplayed(packetManagerTitle)) { - logger.info("Already inside PACKET_MANAGER_ACCOUNT screen."); - return true; - } - try { - - if (!isElementDisplayed(documentsFolder)) { - scrollToText("Documents"); - } - clickOnElement(documentsFolder); - - if (!isElementDisplayed(packetsFolder)) { - scrollToText("packets"); - } - clickOnElement(packetsFolder); - - if (!isElementDisplayed(packetManagerAccountFolder)) { - scrollToText("PACKET_MANAGER_ACCOUNT"); - } - clickOnElement(packetManagerAccountFolder); - - } catch (Exception e) { - logger.info("Navigation failed: " + e.getMessage()); - return false; - } return isElementDisplayed(packetManagerTitle); } private void scrollToText(String text) { + String safeText = text.replace("\\", "\\\\").replace("\"", "\\\""); driver.findElement(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true))" - + ".scrollIntoView(new UiSelector().text(\"" + text + "\"))")); + + ".scrollIntoView(new UiSelector().text(\"" + safeText + "\"))")); } public void exportPacketIntoFolder(String folderName) { @@ -169,16 +163,33 @@ public void exportPacketIntoFolder(String folderName) { logger.info(folderName + " folder already exists. Using it."); clickOnUseThisFolderButton(); handleAllowFolderConsentIfPresent(); - } else { - logger.info(folderName + " folder not found. Creating new folder."); - clickNewFolderButton(); - if (!isNewFolderPopupDisplayed()) { - throw new RuntimeException("New Folder popup not displayed"); + if (exportIfTargetFolderAlreadyOpened(folderName)) { + return; + } + if (!isPacketManagerTitleDisplayed()) { + throw new IllegalStateException("Packet Manager page is not displayed."); + } + boolean folderExists = false; + try { + scrollToText(folderName); + folderExists = isFolderDisplayed(folderName); + } catch (Exception e) { + logger.info("Folder not found during scroll: " + folderName); + } + if (folderExists) { + logger.info(folderName + " folder exists. Selecting it."); + selectFolderByName(folderName); + } else { + logger.info(folderName + " folder not found. Creating new folder."); + clickNewFolderButton(); + if (!isNewFolderPopupDisplayed()) { + throw new RuntimeException("New Folder popup not displayed"); + } + enterFolderName(folderName); + clickOnOkButton(); + clickOnUseThisFolderButton(); + handleAllowFolderConsentIfPresent(); } - enterFolderName(folderName); - clickOnOkButton(); - clickOnUseThisFolderButton(); - handleAllowFolderConsentIfPresent(); } } @@ -187,12 +198,69 @@ public boolean isFolderTitleDisplayed(String folderName) { return isElementDisplayed(folderLocator); } - public void exportPacketIntoFolderIfReady(String folderName) { - if (!isPacketManagerTitleDisplayed()) { - throw new IllegalStateException("Packet Manager page is not displayed. Aborting export."); + public void navigateToFolderPath(String... folderPath) { + + try { + + for (String folder : folderPath) { + + logger.info("Navigating to folder: " + folder); + + // If already inside this folder → skip + if (isFolderHeaderDisplayed(folder)) { + logger.info("Already inside folder: " + folder); + continue; + } + + // Scroll and click folder + scrollToText(folder); + click(getFolderLocator(folder)); + + logger.info("Opened folder: " + folder); + } + + } catch (Exception e) { + logger.error("Folder navigation failed", e); + throw new RuntimeException("Unable to navigate folder path", e); + } + } + + private By getFolderLocator(String folderName) { + + return MobileBy.AndroidUIAutomator( + "new UiSelector()" + ".className(\"android.widget.TextView\")" + ".text(\"" + folderName + "\")"); + } + + private boolean isFolderHeaderDisplayed(String folderName) { + + By headerLocator = MobileBy.AndroidUIAutomator("new UiSelector()" + + ".resourceId(\"com.google.android.documentsui:id/title\")" + ".text(\"" + folderName + "\")"); + + return isElementDisplayed(headerLocator); + } + + public void exportToFolder(String folderName) { + + if (exportIfTargetFolderAlreadyOpened(folderName)) { + return; } - logger.info("Packet Manager page verified."); + + navigateToFolderPath("Documents", "packets", "PACKET_MANAGER_ACCOUNT"); + exportPacketIntoFolder(folderName); } + private boolean exportIfTargetFolderAlreadyOpened(String folderName) { + + if (isFolderTitleDisplayed(folderName)) { + + logger.info(folderName + " folder already opened. Using it."); + clickOnUseThisFolderButton(); + handleAllowFolderConsentIfPresent(); + return true; + } + + return false; + } + } diff --git a/ui-test/src/main/java/regclient/pages/english/OperationalTaskPageEnglish.java b/ui-test/src/main/java/regclient/pages/english/OperationalTaskPageEnglish.java index 6e3aef46e..93d2a2794 100644 --- a/ui-test/src/main/java/regclient/pages/english/OperationalTaskPageEnglish.java +++ b/ui-test/src/main/java/regclient/pages/english/OperationalTaskPageEnglish.java @@ -15,7 +15,7 @@ public class OperationalTaskPageEnglish extends OperationalTaskPage { @AndroidFindBy(accessibility = "System Storage Usage") private WebElement systemStorageUsageTitle; - @AndroidFindBy(uiAutomator = "new UiSelector().descriptionContains(\"Synchronize Data\")") + @AndroidFindBy(uiAutomator = "new UiSelector().descriptionStartsWith(\"Synchronize Data\")") private WebElement synchronizeDataButton; @AndroidFindBy(uiAutomator = "new UiSelector().descriptionContains(\"Application Upload\")") diff --git a/ui-test/src/main/java/regclient/pages/english/PreviewPageEnglish.java b/ui-test/src/main/java/regclient/pages/english/PreviewPageEnglish.java index ab794513d..b6d1fa01f 100644 --- a/ui-test/src/main/java/regclient/pages/english/PreviewPageEnglish.java +++ b/ui-test/src/main/java/regclient/pages/english/PreviewPageEnglish.java @@ -1,11 +1,14 @@ package regclient.pages.english; +import java.time.Duration; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; import io.appium.java_client.AppiumDriver; import io.appium.java_client.MobileBy; @@ -74,12 +77,17 @@ public boolean isDemographicInformationInPreviewPageDisplayed() { } public boolean isDocumentsInformationInPreviewPageDisplayed() { - try { - scrollToText("Documents"); - return isElementDisplayed(documentsInformationInPreviewPage); - } catch (Exception e) { - return false; - } + try { + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + wait.until(ExpectedConditions.visibilityOf(documentsInformationInPreviewPage)); + + scrollToText("Documents"); + + return isElementDisplayed(documentsInformationInPreviewPage); + + } catch (Exception e) { + return false; + } } public boolean isBiometricsInformationInPreviewPagePageDisplayed() { diff --git a/ui-test/src/main/java/regclient/pages/kannada/DocumentuploadPageKannada.java b/ui-test/src/main/java/regclient/pages/kannada/DocumentuploadPageKannada.java new file mode 100644 index 000000000..6bbd5b2a6 --- /dev/null +++ b/ui-test/src/main/java/regclient/pages/kannada/DocumentuploadPageKannada.java @@ -0,0 +1,239 @@ +package regclient.pages.kannada; + +import static org.testng.Assert.assertTrue; + +import java.util.List; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import io.appium.java_client.AppiumDriver; +import io.appium.java_client.MobileBy; +import io.appium.java_client.pagefactory.AndroidFindBy; +import regclient.api.FetchUiSpec; +import regclient.page.BiometricDetailsPage; +import regclient.page.CameraPage; +import regclient.page.DocumentUploadPage; +import regclient.pages.english.BiometricDetailsPageEnglish; +import regclient.pages.english.DocumentUploadPageEnglish; + +public class DocumentUploadPageKannada extends DocumentUploadPage { + + @AndroidFindBy(accessibility = "ಸ್ಕ್ರಿಮ್") + private WebElement PopUpCloseButton; + + @AndroidFindBy(accessibility = "ಹಿಂತಿರುಗಿ") + private WebElement backButton; + + @AndroidFindBy(accessibility = "ಮುಂದುವರಿಸಿ") + private WebElement continueButton; + + @AndroidFindBy(accessibility = "ಅಳಿಸಿ") + private WebElement deleteButton; + + @AndroidFindBy(xpath = "//android.widget.ImageView") + private WebElement captureImage; + + @AndroidFindBy(accessibility = "ಉಳಿಸಿ") + private WebElement saveButton; + + @AndroidFindBy(accessibility = "ರೀಟೇಕ್") + private WebElement retakeButton; + + @AndroidFindBy(uiAutomator = "UiSelector().className(\"android.view.View\").instance(8)") + private WebElement imageleftCorner; + + public DocumentUploadPageKannada(AppiumDriver driver) { + super(driver); + } + + public BiometricDetailsPage clickOnContinueButton() { + clickOnElement(continueButton); + return new BiometricDetailsPageKannada(driver); + } + + @SuppressWarnings("deprecation") + public boolean isDoccumentUploadPageDisplayed() { + return isElementDisplayed(findElementWithRetry(MobileBy.AndroidUIAutomator( + "new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().descriptionContains(\"" + + FetchUiSpec.getScreenTitle("Documents") + "\"))"))); + } + + public DocumentUploadPage clickOnSaveButton() { + clickOnElement(saveButton); + return new DocumentUploadPageKannada(driver); + } + + public boolean isRetakeButtonDisplayed() { + return isElementDisplayed(retakeButton); + } + + public void cropCaptureImage() { + isElementDisplayed(captureImage); + cropCaptureImage(imageleftCorner); + } + + public void uploadDoccuments(String age, String type) { + List idList = FetchUiSpec.getAllIds("Documents"); + for (String id : idList) { + if (FetchUiSpec.getRequiredTypeUsingId(id)) { + if (type.equalsIgnoreCase("ReferenceNumber")) { + clickAndsendKeysToTextBox( + findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.EditText")), + "1234567890"); + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + swipeOrScroll(); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + } + clickOnElement(PopUpCloseButton); + waitTime(1); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); + cameraPage.clickimage(); + cameraPage.clickOkButton(); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + cropCaptureImage(); + clickOnSaveButton(); + assertTrue(isDoccumentUploadPageDisplayed(), + "Verify if doccumentupload page is displayed after upload of " + + FetchUiSpec.getValueUsingId(id)); + } else { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + swipeOrScroll(); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + } + clickOnElement(PopUpCloseButton); + waitTime(1); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); + cameraPage.clickimage(); + cameraPage.clickOkButton(); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + cropCaptureImage(); + clickOnSaveButton(); + assertTrue(isDoccumentUploadPageDisplayed(), + "Verify if doccumentupload page is displayed after upload of " + + FetchUiSpec.getValueUsingId(id)); + } + } + if (id.equals("proofOfRelationship")) { + if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + swipeOrScroll(); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + } + clickOnElement(PopUpCloseButton); + waitTime(1); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); + cameraPage.clickimage(); + cameraPage.clickOkButton(); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + cropCaptureImage(); + clickOnSaveButton(); + assertTrue(isDoccumentUploadPageDisplayed(), + "Verify if doccumentupload page is displayed after upload of " + + FetchUiSpec.getValueUsingId(id)); + } + } + } + + } + + public void uploadDoccumentsUpdate(String age, String type) { + List idList = FetchUiSpec.getAllIds("Documents"); + for (String id : idList) { + if (type.equals("all") && !id.equals("proofOfException") && !id.equals("proofOfRelationship")) { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + swipeOrScroll(); + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + } + clickOnElement(PopUpCloseButton); + waitTime(1); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); + cameraPage.clickimage(); + cameraPage.clickOkButton(); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + cropCaptureImage(); + clickOnSaveButton(); + } + if (id.equals("proofOfRelationship")) { + if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + swipeOrScroll(); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + } + clickOnElement(PopUpCloseButton); + waitTime(1); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); + cameraPage.clickimage(); + cameraPage.clickOkButton(); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + cropCaptureImage(); + clickOnSaveButton(); + } + } + + } + } + +} diff --git a/ui-test/src/main/java/regclient/pages/tamil/DocumentuploadPageTamil.java b/ui-test/src/main/java/regclient/pages/tamil/DocumentuploadPageTamil.java new file mode 100644 index 000000000..f9358e8ee --- /dev/null +++ b/ui-test/src/main/java/regclient/pages/tamil/DocumentuploadPageTamil.java @@ -0,0 +1,238 @@ +package regclient.pages.tamil; + +import static org.testng.Assert.assertTrue; + +import java.util.List; + +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import io.appium.java_client.AppiumDriver; +import io.appium.java_client.MobileBy; +import io.appium.java_client.pagefactory.AndroidFindBy; +import regclient.api.FetchUiSpec; +import regclient.page.BiometricDetailsPage; +import regclient.page.CameraPage; +import regclient.page.DocumentUploadPage; +import regclient.pages.english.BiometricDetailsPageEnglish; +import regclient.pages.english.DocumentUploadPageEnglish; + +public class DocumentUploadPageTamil extends DocumentUploadPage { + + @AndroidFindBy(accessibility = "ஸ்க்ரிம்") + private WebElement PopUpCloseButton; + + @AndroidFindBy(accessibility = "முந்தைய பக்கம்") + private WebElement backButton; + + @AndroidFindBy(accessibility = "தொடர்க") + private WebElement continueButton; + + @AndroidFindBy(accessibility = "அழி") + private WebElement deleteButton; + + @AndroidFindBy(xpath = "//android.widget.ImageView") + private WebElement captureImage; + + @AndroidFindBy(accessibility = "சேமிக்கவும்") + private WebElement saveButton; + + @AndroidFindBy(accessibility = "ரீடேக்") + private WebElement retakeButton; + + @AndroidFindBy(uiAutomator = "UiSelector().className(\"android.view.View\").instance(8)") + private WebElement imageleftCorner; + + public DocumentUploadPageTamil(AppiumDriver driver) { + super(driver); + } + + public BiometricDetailsPage clickOnContinueButton() { + clickOnElement(continueButton); + return new BiometricDetailsPageTamil(driver); + } + + @SuppressWarnings("deprecation") + public boolean isDoccumentUploadPageDisplayed() { + return isElementDisplayed(findElementWithRetry(MobileBy.AndroidUIAutomator( + "new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().descriptionContains(\"" + + FetchUiSpec.getScreenTitle("Documents") + "\"))"))); + } + + public DocumentUploadPage clickOnSaveButton() { + clickOnElement(saveButton); + return new DocumentUploadPageTamil(driver); + } + + public boolean isRetakeButtonDisplayed() { + return isElementDisplayed(retakeButton); + } + + public void cropCaptureImage() { + isElementDisplayed(captureImage); + cropCaptureImage(imageleftCorner); + } + + public void uploadDoccuments(String age, String type) { + List idList = FetchUiSpec.getAllIds("Documents"); + for (String id : idList) { + if (FetchUiSpec.getRequiredTypeUsingId(id)) { + if (type.equalsIgnoreCase("ReferenceNumber")) { + clickAndsendKeysToTextBox( + findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.EditText")), + "1234567890"); + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + swipeOrScroll(); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + } + clickOnElement(PopUpCloseButton); + waitTime(1); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); + cameraPage.clickimage(); + cameraPage.clickOkButton(); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + cropCaptureImage(); + clickOnSaveButton(); + assertTrue(isDoccumentUploadPageDisplayed(), + "Verify if doccumentupload page is displayed after upload of " + + FetchUiSpec.getValueUsingId(id)); + } else { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + swipeOrScroll(); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + } + clickOnElement(PopUpCloseButton); + waitTime(1); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); + cameraPage.clickimage(); + cameraPage.clickOkButton(); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + cropCaptureImage(); + clickOnSaveButton(); + assertTrue(isDoccumentUploadPageDisplayed(), + "Verify if doccumentupload page is displayed after upload of " + + FetchUiSpec.getValueUsingId(id)); + } + } + if (id.equals("proofOfRelationship")) { + if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + swipeOrScroll(); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + } + clickOnElement(PopUpCloseButton); + waitTime(1); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); + cameraPage.clickimage(); + cameraPage.clickOkButton(); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + cropCaptureImage(); + clickOnSaveButton(); + assertTrue(isDoccumentUploadPageDisplayed(), + "Verify if doccumentupload page is displayed after upload of " + + FetchUiSpec.getValueUsingId(id)); + } + } + } + + } + + public void uploadDoccumentsUpdate(String age, String type) { + List idList = FetchUiSpec.getAllIds("Documents"); + for (String id : idList) { + if (type.equals("all") && !id.equals("proofOfException") && !id.equals("proofOfRelationship")) { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + swipeOrScroll(); + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + } + clickOnElement(PopUpCloseButton); + waitTime(1); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); + cameraPage.clickimage(); + cameraPage.clickOkButton(); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + cropCaptureImage(); + clickOnSaveButton(); + } + if (id.equals("proofOfRelationship")) { + if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { + clickOnElement(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + swipeOrScroll(); + clickOnElement(findElementWithRetry(By.xpath( + "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View"))); + } + clickOnElement(PopUpCloseButton); + waitTime(1); + boolean isEnabled = isElementEnabled(findElementWithRetry( + By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" + + FetchUiSpec.getValueUsingId(id) + + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage = new CameraPage(driver); + cameraPage.clickimage(); + cameraPage.clickOkButton(); + assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + cropCaptureImage(); + clickOnSaveButton(); + } + } + + } + } +} diff --git a/ui-test/src/main/java/regclient/utils/EmailableReport.java b/ui-test/src/main/java/regclient/utils/EmailableReport.java index ad0d29928..82cd54d81 100644 --- a/ui-test/src/main/java/regclient/utils/EmailableReport.java +++ b/ui-test/src/main/java/regclient/utils/EmailableReport.java @@ -14,7 +14,7 @@ import java.util.List; import java.util.Locale; import java.util.Set; - +import java.util.stream.Collectors; import org.testng.IReporter; import org.testng.ISuite; @@ -26,6 +26,7 @@ import org.testng.internal.Utils; import org.testng.xml.XmlSuite; +import io.mosip.testrig.apirig.utils.ConfigManager; import regclient.api.ArcConfigManager; /** @@ -36,6 +37,8 @@ public class EmailableReport implements IReporter { protected PrintWriter writer; protected final List suiteResults = Lists.newArrayList(); + protected final boolean reportIgnoredTestCases = ConfigManager.reportIgnoredTestCases(); + protected final boolean reportKnownIssueTestCases = ConfigManager.reportKnownIssueTestCases(); // Reusable buffer private final StringBuilder buffer = new StringBuilder(); @@ -44,11 +47,12 @@ public class EmailableReport implements IReporter { private static final String JVM_ARG = "emailable.report2.name"; - int totalPassedTests = 0; - int totalSkippedTests = 0; - int totalFailedTests = 0; - - + private int totalPassedTests = 0; + private static int totalSkippedTests = 0; + private int totalIgnoredTests = 0; + private int totalKnownIssueTests = 0; + private static int totalFailedTests = 0; + private long totalDuration = 0; public void setFileName(String fileName) { this.fileName = fileName; @@ -74,29 +78,42 @@ public void generateReport(List xmlSuites, List suites, String writeDocumentEnd(); writer.close(); - int totalTestCases = totalPassedTests + totalSkippedTests + totalFailedTests; + int totalTestCases = totalPassedTests + totalFailedTests + totalSkippedTests + totalKnownIssueTests; + if (reportIgnoredTestCases) { + totalTestCases = totalTestCases + totalIgnoredTests; + } + if (reportKnownIssueTestCases) { + totalTestCases = totalTestCases + totalKnownIssueTests; + } String oldString = System.getProperty("emailable.report2.name"); String temp = "-report_T-" + totalTestCases + "_P-" + totalPassedTests + "_S-" + totalSkippedTests + "_F-" + totalFailedTests; + if (reportIgnoredTestCases && reportKnownIssueTestCases) { + temp = "-report_T-" + totalTestCases + "_P-" + totalPassedTests + "_S-" + totalSkippedTests + "_F-" + + totalFailedTests + "_I-" + totalIgnoredTests + "_KI-" + totalKnownIssueTests; + } else if (reportIgnoredTestCases && !(reportKnownIssueTestCases)) { + temp = "-report_T-" + totalTestCases + "_P-" + totalPassedTests + "_S-" + totalSkippedTests + "_F-" + + totalFailedTests + "_I-" + totalIgnoredTests; + } else if (reportKnownIssueTestCases && !(reportIgnoredTestCases)) { + temp = "-report_T-" + totalTestCases + "_P-" + totalPassedTests + "_S-" + totalSkippedTests + "_F-" + + totalFailedTests + "_KI-" + totalKnownIssueTests; + } String newString = oldString.replace("-report", temp); File orignialReportFile = new File(System.getProperty("user.dir") + "/" + System.getProperty("testng.outpur.dir") + "/" + System.getProperty("emailable.report2.name")); - File newReportFile = new File( System.getProperty("user.dir") + "/" + System.getProperty("testng.outpur.dir") + "/" + newString); - + if (orignialReportFile.exists()) { if (orignialReportFile.renameTo(newReportFile)) { orignialReportFile.delete(); - } + } } } - - protected PrintWriter createWriter(String outdir) throws IOException { new File(outdir).mkdirs(); String jvmArg = System.getProperty(JVM_ARG); @@ -120,73 +137,75 @@ protected void writeHead() { } protected void writeStylesheet() { - writer.print(""); + writer.print(""); } - - - - - protected void writeBody() { writer.print(""); writeSuiteSummary(); @@ -200,204 +219,211 @@ protected void writeDocumentEnd() { } protected void writeSuiteSummary() { - NumberFormat integerFormat = NumberFormat.getIntegerInstance(); - - totalPassedTests = 0; - totalSkippedTests = 0; - totalFailedTests = 0; - long totalDuration = 0; - - // compute totals across suites - for (SuiteResult suiteResult : suiteResults) { - for (TestResult testResult : suiteResult.getTestResults()) { - totalPassedTests += testResult.getPassedTestCount(); - totalSkippedTests += testResult.getSkippedTestCount(); - totalFailedTests += testResult.getFailedTestCount(); - totalDuration += testResult.getDuration(); - } - } - - // top block (env info) - writer.print(""); - writer.print(""); - writer.print("
"); - writer.print(Utils.escapeHtml("Use Cases Test Report ---- Report Date: " + printCurrentDateTime() - + " ---- Tested Environment: " + ArcConfigManager.getEnv())); - writer.print("
"); - - // summary-of-test-results block - writer.print(""); - - // define columns widths: tweak percentages to match screenshot proportions - writer.print(""); - writer.print(""); // # Total - writer.print(""); // # Passed - writer.print(""); // # Ignored - writer.print(""); // # Known Issues - writer.print(""); // # Skipped - writer.print(""); // # Failed - writer.print(""); // Time - writer.print(""); - - // Title row - writer.print(""); - writer.print(""); - writer.print(""); - - // Labels row - writer.print(""); - writer.print(""); - writer.print(""); - writer.print(""); - writer.print(""); - writer.print(""); - writer.print(""); - writer.print(""); - writer.print(""); - - // Values row (colored bars) - writer.print(""); - writer.print(""); - writer.print(""); - // If you have an 'ignored' concept use it; here using 0 placeholder or compute if available - int totalIgnored = 0; - writer.print(""); - // If you track known issues, compute; placeholder 0 here - int totalKnown = 0; - writer.print(""); - writer.print(""); - writer.print(""); - writer.print(""); - writer.print(""); - - writer.print("
Summary of Test Results
# Total# Passed# Ignored# Known Issues# Skipped# FailedTime (HH:MM:SS)
" + integerFormat.format(totalPassedTests + totalFailedTests + totalSkippedTests) + "" + integerFormat.format(totalPassedTests) + "" + integerFormat.format(totalIgnored) + "" + integerFormat.format(totalKnown) + "" + integerFormat.format(totalSkippedTests) + "" + integerFormat.format(totalFailedTests) + "" + formatDurationMillis(totalDuration) + "
"); + NumberFormat integerFormat = NumberFormat.getIntegerInstance(); + + totalPassedTests = 0; + totalSkippedTests = 0; + totalIgnoredTests = 0; + totalKnownIssueTests = 0; + totalFailedTests = 0; + long totalDuration = 0; + + // compute totals across suites + for (SuiteResult suiteResult : suiteResults) { + for (TestResult testResult : suiteResult.getTestResults()) { + totalPassedTests += testResult.getPassedTestCount(); + totalSkippedTests += testResult.getSkippedTestCount(); + totalFailedTests += testResult.getFailedTestCount(); + totalIgnoredTests += testResult.getIgnoredTestCount(); + totalKnownIssueTests += testResult.getKnownIssueTestCount(); + totalDuration += testResult.getDuration(); + } + } + + // top block (env info) + writer.print(""); + writer.print(""); + writer.print("
"); + writer.print(Utils.escapeHtml("Use Cases Test Report ---- Report Date: " + printCurrentDateTime() + + " ---- Tested Environment: " + ArcConfigManager.getEnv())); + writer.print("
"); + + // summary-of-test-results block + writer.print(""); + + // define columns widths: tweak percentages to match screenshot proportions + writer.print(""); + writer.print(""); // # Total + writer.print(""); // # Passed + writer.print(""); // # Ignored + writer.print(""); // # Known Issues + writer.print(""); // # Skipped + writer.print(""); // # Failed + writer.print(""); // Time + writer.print(""); + + // Title row + writer.print(""); + writer.print(""); + writer.print(""); + + // Labels row + writer.print(""); + writer.print(""); + writer.print(""); + writer.print(""); + writer.print(""); + writer.print(""); + writer.print(""); + writer.print(""); + writer.print(""); + + // Values row (colored bars) + writer.print(""); + writer.print(""); + writer.print(""); + // If you have an 'ignored' concept use it; here using 0 placeholder or compute + // if available + writer.print(""); + // If you track known issues, compute; placeholder 0 here + writer.print(""); + writer.print(""); + writer.print(""); + if (reportIgnoredTestCases) { + writer.print(""); + } + + if (reportKnownIssueTestCases) { + writer.print(""); + } + writer.print(""); + writer.print(""); + + writer.print("
Summary of Test Results
# Total# Passed# Ignored# Known Issues# Skipped# FailedTime (HH:MM:SS)
" + integerFormat.format( + totalPassedTests + totalFailedTests + totalSkippedTests + totalKnownIssueTests + totalIgnoredTests) + + "" + integerFormat.format(totalPassedTests) + "" + integerFormat.format(totalIgnoredTests) + "" + integerFormat.format(totalKnownIssueTests) + "" + integerFormat.format(totalSkippedTests) + "" + integerFormat.format(totalFailedTests) + "" + integerFormat.format(totalIgnoredTests) + "" + integerFormat.format(totalKnownIssueTests) + "" + formatDurationMillis(totalDuration) + "
"); } /** * Writes a summary of all the test scenarios. */ protected void writeScenarioSummary() { - writer.print(""); - - // fixed columns widths: method 25%, desc 65%, time 10% (tweak if you like) - writer.print(""); - writer.print(""); - writer.print(""); - writer.print(""); - writer.print(""); - - writer.print(""); - writer.print(""); - writer.print(""); - writer.print(""); - writer.print(""); - writer.print(""); - writer.print(""); - - int testIndex = 0; - int scenarioIndex = 0; - for (SuiteResult suiteResult : suiteResults) { - for (TestResult testResult : suiteResult.getTestResults()) { - writer.print(""); - - String testName = Utils.escapeHtml("Scenarios"); - - // The calls below print blocks for Failed / Skipped / Passed etc. - scenarioIndex += writeScenarioSummary(testName + " — Failed (configuration methods)", - testResult.getFailedConfigurationResults(), "failed", scenarioIndex); - scenarioIndex += writeScenarioSummary(testName + " — Failed", testResult.getFailedTestResults(), - "failed", scenarioIndex); - scenarioIndex += writeScenarioSummary(testName + " — Skipped (configuration methods)", - testResult.getSkippedConfigurationResults(), "skipped", scenarioIndex); - scenarioIndex += writeScenarioSummary(testName + " — Skipped", testResult.getSkippedTestResults(), - "skipped", scenarioIndex); - scenarioIndex += writeScenarioSummary(testName + " — Passed", testResult.getPassedTestResults(), - "passed", scenarioIndex); - - writer.print(""); - - testIndex++; - } - } - - writer.print("
Test Description Time (HH:MM:SS)
"); - } + writer.print(""); + + // fixed columns widths: method 25%, desc 65%, time 10% (tweak if you like) + writer.print(""); + writer.print(""); + writer.print(""); + writer.print(""); + writer.print(""); + + writer.print(""); + writer.print(""); + writer.print(""); + writer.print(""); + writer.print(""); + writer.print(""); + writer.print(""); + + int testIndex = 0; + int scenarioIndex = 0; + for (SuiteResult suiteResult : suiteResults) { + for (TestResult testResult : suiteResult.getTestResults()) { + writer.print(""); + String testName = Utils.escapeHtml("Scenarios"); + // The calls below print blocks for Failed / Skipped / Passed etc. + scenarioIndex += writeScenarioSummary(testName + " — Failed", testResult.getFailedTestResults(), + "failed", scenarioIndex); + scenarioIndex += writeScenarioSummary(testName + " — Known Issues", + testResult.getKnownIssueTestResults(), "skipped", scenarioIndex); + scenarioIndex += writeScenarioSummary(testName + " — Skipped", testResult.getSkippedTestResults(), + "skipped", scenarioIndex); + scenarioIndex += writeScenarioSummary(testName + " — Passed", testResult.getPassedTestResults(), + "passed", scenarioIndex); + + writer.print(""); + + testIndex++; + } + } + + writer.print("
Test Description Time (HH:MM:SS)
"); + } /** * Writes the scenario summary for the results of a given state for a single * test. */ private int writeScenarioSummary(String description, List classResults, String cssClassPrefix, - int startingScenarioIndex) { - int scenarioCount = 0; - if (!classResults.isEmpty()) { - // Apply result-based class to the block header row so it adopts the correct color. - // e.g. cssClassPrefix == "failed" -> header row class "failedodd" (uses CSS rule for that class) - writer.print(""); - writer.print(description); - writer.print(""); - - int scenarioIndex = startingScenarioIndex; - int classIndex = 0; - for (ClassResult classResult : classResults) { - int methodIndex = 0; - - for (MethodResult methodResult : classResult.getMethodResults()) { - List results = methodResult.getResults(); - int resultsCount = results.size(); - assert resultsCount > 0; - ITestResult firstResult = results.iterator().next(); - - String methodName = Utils.escapeHtml(firstResult.getMethod().getMethodName()); - String methodDesc = firstResult.getMethod().getDescription(); - if (methodDesc == null) { - methodDesc = ""; - } else { - methodDesc = Utils.escapeHtml(methodDesc); - } - - // pick odd/even suffix based on methodIndex to alternate row classes - String suffix = ((methodIndex % 2) == 0) ? "even" : "odd"; - String rowClassPrefix = cssClassPrefix + suffix; // e.g., "failedeven" or "passedeven" - - for (int i = 0; i < resultsCount; i++) { - ITestResult result = results.get(i); - long scenarioStart = result.getStartMillis(); - long scenarioDuration = result.getEndMillis() - scenarioStart; - - // each row: method | description | time (HH:MM:SS) - writer.print(""); - writer.print("" + methodName + ""); - writer.print("" + methodDesc + ""); - writer.print("" + formatDurationMillis(scenarioDuration) + ""); - writer.print(""); - - scenarioIndex++; - } - methodIndex++; - } - classIndex++; - } - scenarioCount = scenarioIndex - startingScenarioIndex; - } - return scenarioCount; - } + int startingScenarioIndex) { + int scenarioCount = 0; + if (!classResults.isEmpty()) { + // Apply result-based class to the block header row so it adopts the correct + // color. + // e.g. cssClassPrefix == "failed" -> header row class "failedodd" (uses CSS + // rule for that class) + writer.print(""); + writer.print(description); + writer.print(""); + + int scenarioIndex = startingScenarioIndex; + int classIndex = 0; + for (ClassResult classResult : classResults) { + int methodIndex = 0; + + for (MethodResult methodResult : classResult.getMethodResults()) { + List results = methodResult.getResults(); + int resultsCount = results.size(); + assert resultsCount > 0; + ITestResult firstResult = results.iterator().next(); + + String methodName = Utils.escapeHtml(firstResult.getMethod().getMethodName()); + String methodDesc = firstResult.getMethod().getDescription(); + if (methodDesc == null) { + methodDesc = ""; + } else { + methodDesc = Utils.escapeHtml(methodDesc); + } + // pick odd/even suffix based on methodIndex to alternate row classes + String suffix = ((methodIndex % 2) == 0) ? "even" : "odd"; + String rowClassPrefix = cssClassPrefix + suffix; // e.g., "failedeven" or "passedeven" + for (int i = 0; i < resultsCount; i++) { + ITestResult result = results.get(i); + long scenarioStart = result.getStartMillis(); + long scenarioDuration = result.getEndMillis() - scenarioStart; + // each row: method | description | time (HH:MM:SS) + writer.print(""); + writer.print("" + methodName + ""); + writer.print("" + methodDesc + ""); + writer.print("" + formatDurationMillis(scenarioDuration) + ""); + writer.print(""); - public static String printCurrentDateTime() { - LocalDateTime localDateTime = LocalDateTime.now(); - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("EEEE dd MMMM HH:mm:ss",Locale.ENGLISH); - String formattedDateTime = localDateTime.format(formatter); - return formattedDateTime; - } + scenarioIndex++; + } + methodIndex++; + } + classIndex++; + } + scenarioCount = scenarioIndex - startingScenarioIndex; + } + return scenarioCount; + } + + public static String printCurrentDateTime() { + LocalDateTime localDateTime = LocalDateTime.now(); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("EEEE dd MMMM HH:mm:ss", Locale.ENGLISH); + String formattedDateTime = localDateTime.format(formatter); + return formattedDateTime; + } /** * Writes the details for all test scenarios. @@ -412,11 +438,13 @@ protected void writeScenarioDetails() { * writer.print(""); */ - scenarioIndex += writeScenarioDetails(testResult.getFailedConfigurationResults(), scenarioIndex); scenarioIndex += writeScenarioDetails(testResult.getFailedTestResults(), scenarioIndex); - scenarioIndex += writeScenarioDetails(testResult.getSkippedConfigurationResults(), scenarioIndex); + scenarioIndex += writeScenarioDetails(testResult.getSkippedTestResults(), scenarioIndex); - // scenarioIndex += writeScenarioDetails(testResult.getPassedTestResults(), scenarioIndex); + scenarioIndex += writeScenarioDetails(testResult.getKnownIssueTestResults(), scenarioIndex); + + // scenarioIndex += writeScenarioDetails(testResult.getPassedTestResults(), + // scenarioIndex); } } } @@ -432,8 +460,8 @@ private int writeScenarioDetails(List classResults, int startingSce for (MethodResult methodResult : classResult.getMethodResults()) { List results = methodResult.getResults(); assert !results.isEmpty(); - // ITestResult firstResult = results.iterator().next(); - // String methodName=firstResult.getName(); + // ITestResult firstResult = results.iterator().next(); + // String methodName=firstResult.getName(); String label = Utils .escapeHtml(className + "#" + results.iterator().next().getMethod().getMethodName()); for (ITestResult result : results) { @@ -450,39 +478,38 @@ private int writeScenarioDetails(List classResults, int startingSce * Writes the details for an individual test scenario. */ private void writeScenario(int scenarioIndex, String label, ITestResult result) { - writer.print("

"); - writer.print(label); - writer.print("

"); - - writer.print(""); - - // Reporter messages (if any) - List reporterMessages = Reporter.getOutput(result); - if (!reporterMessages.isEmpty()) { - writer.print(""); - } - - // Exception (if any) - Throwable throwable = result.getThrowable(); - if (throwable != null) { - // nicer exception header - writer.print(""); - writer.print(""); - } - - writer.print("
"); - writeReporterMessages(reporterMessages); - writer.print("
Exception
"); - writer.print("
"); - writer.print(Utils.shortStackTrace(throwable, true)); - writer.print("
"); - writer.print("
"); - writer.print("

back to summary

"); + writer.print("

"); + writer.print(label); + writer.print("

"); + + writer.print(""); + + // Reporter messages (if any) + List reporterMessages = Reporter.getOutput(result); + if (!reporterMessages.isEmpty()) { + writer.print(""); + } + + // Exception (if any) + Throwable throwable = result.getThrowable(); + if (throwable != null) { + // nicer exception header + writer.print(""); + writer.print(""); + } + + writer.print("
"); + writeReporterMessages(reporterMessages); + writer.print("
Exception
"); + writer.print("
"); + writer.print(Utils.shortStackTrace(throwable, true)); + writer.print("
"); + writer.print("
"); + writer.print("

back to summary

"); } - protected void writeReporterMessages(List reporterMessages) { writer.print("
"); Iterator iterator = reporterMessages.iterator(); @@ -611,14 +638,15 @@ public int compare(ITestResult o1, ITestResult o2) { }; private final String testName; - private final List failedConfigurationResults; private final List failedTestResults; - private final List skippedConfigurationResults; private final List skippedTestResults; private final List passedTestResults; + private final List knownIssueTestResults; private final int failedTestCount; private final int skippedTestCount; private final int passedTestCount; + private final int knownIssueTestCount; + private final int ignoredTestCount; private final long duration; private final String includedGroups; private final String excludedGroups; @@ -626,21 +654,36 @@ public int compare(ITestResult o1, ITestResult o2) { public TestResult(ITestContext context) { testName = context.getName(); - Set failedConfigurations = context.getFailedConfigurations().getAllResults(); Set failedTests = context.getFailedTests().getAllResults(); - Set skippedConfigurations = context.getSkippedConfigurations().getAllResults(); - Set skippedTests = context.getSkippedTests().getAllResults(); Set passedTests = context.getPassedTests().getAllResults(); + Set skippedTests = context.getSkippedTests().getAllResults().stream() + .filter(result -> result.getMethod().isTest()).collect(Collectors.toSet()); + + Set knownIssueTests = skippedTests.stream().filter(result -> { + Throwable throwable = result.getThrowable(); + if (throwable != null && throwable.getMessage() != null) { + return throwable.getMessage().contains("Known Issue"); + } + return false; + }).collect(Collectors.toSet()); - failedConfigurationResults = groupResults(failedConfigurations); + Set actualSkippedTests = skippedTests.stream().filter(result -> { + Throwable throwable = result.getThrowable(); + if (throwable != null && throwable.getMessage() != null) { + return !throwable.getMessage().contains("Known Issue"); + } + return true; + }).collect(Collectors.toSet()); failedTestResults = groupResults(failedTests); - skippedConfigurationResults = groupResults(skippedConfigurations); - skippedTestResults = groupResults(skippedTests); + skippedTestResults = groupResults(actualSkippedTests); passedTestResults = groupResults(passedTests); + knownIssueTestResults = groupResults(knownIssueTests); failedTestCount = failedTests.size(); - skippedTestCount = skippedTests.size(); + skippedTestCount = actualSkippedTests.size(); passedTestCount = passedTests.size(); + knownIssueTestCount = knownIssueTests.size(); + ignoredTestCount = context.getExcludedMethods().size(); duration = context.getEndDate().getTime() - context.getStartDate().getTime(); @@ -707,13 +750,6 @@ public String getTestName() { return testName; } - /** - * @return the results for failed configurations (possibly empty) - */ - public List getFailedConfigurationResults() { - return failedConfigurationResults; - } - /** * @return the results for failed tests (possibly empty) */ @@ -721,13 +757,6 @@ public List getFailedTestResults() { return failedTestResults; } - /** - * @return the results for skipped configurations (possibly empty) - */ - public List getSkippedConfigurationResults() { - return skippedConfigurationResults; - } - /** * @return the results for skipped tests (possibly empty) */ @@ -742,6 +771,13 @@ public List getPassedTestResults() { return passedTestResults; } + /** + * @return the results for passed tests (possibly empty) + */ + public List getKnownIssueTestResults() { + return knownIssueTestResults; + } + public int getFailedTestCount() { return failedTestCount; } @@ -754,6 +790,14 @@ public int getPassedTestCount() { return passedTestCount; } + public int getKnownIssueTestCount() { + return knownIssueTestCount; + } + + public int getIgnoredTestCount() { + return ignoredTestCount; + } + public long getDuration() { return duration; } @@ -831,17 +875,16 @@ public List getResults() { return results; } } - + private String formatDurationMillis(long millis) { - if (millis < 0) { - millis = 0; - } - long totalSeconds = millis / 1000; - long hours = totalSeconds / 3600; - long minutes = (totalSeconds % 3600) / 60; - long seconds = totalSeconds % 60; - return String.format("%02d:%02d:%02d", hours, minutes, seconds); + if (millis < 0) { + millis = 0; + } + long totalSeconds = millis / 1000; + long hours = totalSeconds / 3600; + long minutes = (totalSeconds % 3600) / 60; + long seconds = totalSeconds % 60; + return String.format("%02d:%02d:%02d", hours, minutes, seconds); } - } diff --git a/ui-test/src/main/java/regclient/utils/KnownIssues.java b/ui-test/src/main/java/regclient/utils/KnownIssues.java new file mode 100644 index 000000000..0d6ee03d9 --- /dev/null +++ b/ui-test/src/main/java/regclient/utils/KnownIssues.java @@ -0,0 +1,39 @@ +package regclient.utils; + +import org.testng.IInvokedMethod; +import org.testng.IInvokedMethodListener; +import org.testng.ITestResult; +import org.testng.SkipException; +import org.testng.log4testng.Logger; + +import regclient.api.AdminTestUtil; + +public class KnownIssues implements IInvokedMethodListener { + + private static final Logger logger = Logger.getLogger(KnownIssues.class); + + public void beforeInvocation(IInvokedMethod method, ITestResult testResult) { + + if (!method.isTestMethod()) + return; + + String methodName = testResult.getMethod().getMethodName(); + String className = testResult.getTestClass().getRealClass().getSimpleName(); + + for (String knownIssue : AdminTestUtil.getKnownIssues()) { + + if (knownIssue.equalsIgnoreCase(className)) { + logger.warn("Skipping Known Issue CLASS: " + className + "." + methodName); + throw new SkipException("KNOWN_ISSUE: " + className); + } + + if (knownIssue.equalsIgnoreCase(methodName)) { + logger.warn("Skipping Known Issue METHOD: " + className + "." + methodName); + throw new SkipException("KNOWN_ISSUE: " + methodName); + } + } + } + + public void afterInvocation(IInvokedMethod method, ITestResult testResult) { + } +} diff --git a/ui-test/src/main/java/regclient/utils/TestRunner.java b/ui-test/src/main/java/regclient/utils/TestRunner.java index c69c8398c..de1a762c7 100644 --- a/ui-test/src/main/java/regclient/utils/TestRunner.java +++ b/ui-test/src/main/java/regclient/utils/TestRunner.java @@ -1,9 +1,19 @@ package regclient.utils; +import java.io.BufferedReader; import java.io.File; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import org.junit.runner.Runner; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.testng.TestNG; import org.testng.xml.XmlClass; import org.testng.xml.XmlSuite; @@ -18,6 +28,8 @@ public class TestRunner { + private static final Logger LOGGER = LoggerFactory.getLogger(TestRunner.class); + public static String jarUrl = TestRunner.class.getProtectionDomain().getCodeSource().getLocation().getPath(); public static void main(String[] args) { @@ -66,6 +78,8 @@ public static void main(String[] args) { XmlClass biometricCorrection = new XmlClass("regclient.androidTestCases.BiometricCorrection"); XmlClass preRegFetchingPacket = new XmlClass("regclient.androidTestCases.PreRegFetchingPacket"); XmlClass exportPacket = new XmlClass("regclient.androidTestCases.ExportPacket"); + XmlClass newRegistrationAdultUploadMultipleDoccuments = new XmlClass( + "regclient.androidTestCases.NewRegistrationAdultUploadMultipleDoccuments"); List classes = new ArrayList<>(); String[] Scenarionames = ArcConfigManager.gettestcases().split(","); @@ -132,6 +146,9 @@ public static void main(String[] args) { if (Scenarioname.equalsIgnoreCase("exportPacket")) classes.add(exportPacket); + if (Scenarioname.equalsIgnoreCase("newRegistrationAdultUploadMultipleDoccuments")) + classes.add(newRegistrationAdultUploadMultipleDoccuments); + } XmlTest test = new XmlTest(suite); test.setName("MyTest"); @@ -177,4 +194,48 @@ public static String checkRunType() { return "IDE"; } + public static final Map knownIssues = new HashMap<>(); + + static { + loadKnownIssues(); + } + + private static void loadKnownIssues() { + try { + InputStream is = TestRunner.class + .getResourceAsStream("/config/knownIssues.txt"); + + if (is == null) { + System.out.println("❌ knownIssues.txt file NOT FOUND in classpath!"); + return; + } + + BufferedReader reader = new BufferedReader(new InputStreamReader(is)); + String line; + + while ((line = reader.readLine()) != null) { + + line = line.trim(); + + if (!line.isEmpty() && !line.startsWith("#")) { + + String[] parts = line.split("------", 2); + + if (parts.length == 2) { + String bugId = parts[0].trim(); + String testDescription = parts[1].trim().toLowerCase(); + + knownIssues.put(testDescription, bugId); + } + } + } + + reader.close(); + + System.out.println("✅ Loaded Known Issues: " + knownIssues); + + } catch (Exception e) { + e.printStackTrace(); + } + } } diff --git a/ui-test/src/main/resources/config/knownIssues.txt b/ui-test/src/main/resources/config/knownIssues.txt new file mode 100644 index 000000000..6b9ff70ab --- /dev/null +++ b/ui-test/src/main/resources/config/knownIssues.txt @@ -0,0 +1,3 @@ +#Add the Known Issue scenario with its bug id here +#Ex:bugId------scenario +#Ex:RCF-123------Verify the Login OTP diff --git a/ui-test/testng.xml b/ui-test/testng.xml index 12626c0bb..65f2193c8 100644 --- a/ui-test/testng.xml +++ b/ui-test/testng.xml @@ -12,11 +12,17 @@ - + + + + + - + @@ -31,7 +37,8 @@ - + @@ -46,7 +53,8 @@ - + @@ -61,12 +69,6 @@ - - - - - - @@ -95,6 +97,12 @@ + + + + + + From 0043ddaa17c574b77e8f8d2c8caa88248e909bf4 Mon Sep 17 00:00:00 2001 From: Madhuravas reddy Date: Thu, 26 Feb 2026 17:35:15 +0530 Subject: [PATCH 06/14] RCF-1254 resolved localization issue in global config settings page (#700) Signed-off-by: Madhuravas reddy Signed-off-by: damodarguru --- assets/l10n/app_ar.arb | 3 ++- assets/l10n/app_en.arb | 3 ++- assets/l10n/app_fr.arb | 3 ++- assets/l10n/app_hi.arb | 3 ++- assets/l10n/app_kn.arb | 3 ++- assets/l10n/app_ta.arb | 3 ++- lib/ui/settings/settings_screen.dart | 2 +- .../settings/widgets/global_config_settings_tab.dart | 4 ++-- lib/ui/settings/widgets/scheduled_jobs_settings.dart | 12 ++++++++++-- 9 files changed, 25 insertions(+), 11 deletions(-) diff --git a/assets/l10n/app_ar.arb b/assets/l10n/app_ar.arb index 8d6ef617f..f5df33a33 100644 --- a/assets/l10n/app_ar.arb +++ b/assets/l10n/app_ar.arb @@ -363,6 +363,7 @@ "connect_devices_and_scan": "يرجى توصيل أجهزتك والضغط على 'مسح' لاكتشافها", "search_for_key": "ابحث عن المفتاح", "sync_restart_dialog_message": "سيتم إعادة تشغيل التطبيق بمجرد النقر على إعادة التشغيل، وسيتم توجيهك إلى صفحة تسجيل الدخول.", - "sync_restart_button": "إعادة التشغيل" + "sync_restart_button": "إعادة التشغيل", + "app_restart_message": "تم حفظ التكوين بنجاح. جارٍ إعادة تشغيل التطبيق..." } diff --git a/assets/l10n/app_en.arb b/assets/l10n/app_en.arb index 72b55b737..fb380e671 100644 --- a/assets/l10n/app_en.arb +++ b/assets/l10n/app_en.arb @@ -363,5 +363,6 @@ "connect_devices_and_scan": "Please connect your devices and tap 'Scan' to detect them", "search_for_key": "Search for Key", "sync_restart_dialog_message": "The app will restart once you click Restart, and you will be redirected to the login page.", - "sync_restart_button": "Restart" + "sync_restart_button": "Restart", + "app_restart_message": "Configuration saved successfully. Restarting app..." } diff --git a/assets/l10n/app_fr.arb b/assets/l10n/app_fr.arb index ccff36ba3..ab0590505 100644 --- a/assets/l10n/app_fr.arb +++ b/assets/l10n/app_fr.arb @@ -363,6 +363,7 @@ "connect_devices_and_scan": "Veuillez connecter vos appareils et appuyer sur 'ANALYSE' pour les détecter", "search_for_key": "Rechercher une clé", "sync_restart_dialog_message": "L'application redémarrera une fois que vous aurez cliqué sur Redémarrer, et vous serez redirigé vers la page de connexion.", - "sync_restart_button": "Redémarrer" + "sync_restart_button": "Redémarrer", + "app_restart_message": "Configuration enregistrée avec succès. Redémarrage de l'application..." } diff --git a/assets/l10n/app_hi.arb b/assets/l10n/app_hi.arb index e72569388..22bbf37d3 100644 --- a/assets/l10n/app_hi.arb +++ b/assets/l10n/app_hi.arb @@ -363,5 +363,6 @@ "connect_devices_and_scan": "कृपया अपने डिवाइस कनेक्ट करें और उन्हें खोजने के लिए 'स्कैन' पर टैप करें", "search_for_key": "कुंजी खोजें", "sync_restart_dialog_message": "जैसे ही आप पुनः आरंभ करें पर क्लिक करेंगे ऐप पुनः आरंभ हो जाएगा, और आपको लॉगिन पृष्ठ पर पुनः निर्देशित किया जाएगा।", - "sync_restart_button": "पुनः आरंभ करें" + "sync_restart_button": "पुनः आरंभ करें", + "app_restart_message": "कॉन्फ़िगरेशन सफलतापूर्वक सहेजा गया. ऐप पुनः प्रारंभ हो रहा है..." } diff --git a/assets/l10n/app_kn.arb b/assets/l10n/app_kn.arb index a5ebe4b08..29e561fb7 100644 --- a/assets/l10n/app_kn.arb +++ b/assets/l10n/app_kn.arb @@ -363,5 +363,6 @@ "connect_devices_and_scan": "ದಯವಿಟ್ಟು ನಿಮ್ಮ ಸಾಧನಗಳನ್ನು ಸಂಪರ್ಕಿಸಿ ಮತ್ತು ಅವುಗಳನ್ನು ಪತ್ತೆಹಚ್ಚಲು 'ಸ್ಕ್ಯಾನ್' ಅನ್ನು ಟ್ಯಾಪ್ ಮಾಡಿ", "search_for_key": "ಕೀಗಾಗಿ ಹುಡುಕಿ", "sync_restart_dialog_message": "ನೀವು ಮರುಪ್ರಾರಂಭ ಕ್ಲಿಕ್ ಮಾಡಿದ ನಂತರ ಅಪ್ಲಿಕೇಶನ್ ಮರುಪ್ರಾರಂಭವಾಗುತ್ತದೆ ಮತ್ತು ನಿಮ್ಮನ್ನು ಲಾಗಿನ್ ಪುಟಕ್ಕೆ ಮರುನಿರ್ದೇಶಿಸಲಾಗುತ್ತದೆ.", - "sync_restart_button": "ಮರುಪ್ರಾರಂಭ" + "sync_restart_button": "ಮರುಪ್ರಾರಂಭ", + "app_restart_message": "ಕಾನ್ಫಿಗರೇಶನ್ ಯಶಸ್ವಿಯಾಗಿ ಉಳಿಸಲಾಗಿದೆ. ಅಪ್ಲಿಕೇಶನ್ ಅನ್ನು ಮರುಪ್ರಾರಂಭಿಸಲಾಗುತ್ತಿದೆ..." } diff --git a/assets/l10n/app_ta.arb b/assets/l10n/app_ta.arb index befaa0eb9..744cd8b05 100644 --- a/assets/l10n/app_ta.arb +++ b/assets/l10n/app_ta.arb @@ -372,5 +372,6 @@ "connect_devices_and_scan": "தயவுசெய்து உங்கள் சாதனங்களை இணைத்து, அவற்றைக் கண்டறிய 'ஊடுகதிர்' என்பதைத் தட்டவும்", "search_for_key": "விசையைத் தேடவும்", "sync_restart_dialog_message": "மறுதொடக்கம் என்பதைக் கிளிக் செய்தவுடன் பயன்பாடு மறுதொடங்கும், மற்றும் நீங்கள் உள்நுழைவு பக்கத்திற்கு திருப்பிவிடப்படுவீர்கள்.", - "sync_restart_button": "மறுதொடக்கம்" + "sync_restart_button": "மறுதொடக்கம்", + "app_restart_message": "உள்ளமைவு வெற்றிகரமாக சேமிக்கப்பட்டது. பயன்பாட்டை மறுதொடக்கம் செய்கிறது..." } diff --git a/lib/ui/settings/settings_screen.dart b/lib/ui/settings/settings_screen.dart index 3d7eb85b8..1b9d67360 100644 --- a/lib/ui/settings/settings_screen.dart +++ b/lib/ui/settings/settings_screen.dart @@ -177,7 +177,7 @@ class _SettingsScreenState extends State { switch (controllerName) { case 'ScheduledJobsSettingsController': - return ScheduledJobsSettings(jobJsonList: activeJobs); + return ScheduledJobsSettings(settings: settings, selectedLan: selectedLang, jobJsonList: activeJobs); case 'GlobalConfigSettingsController': return GlobalConfigSettingsTab(settings: settings,selectedLan: selectedLang); case 'DeviceSettingsController': diff --git a/lib/ui/settings/widgets/global_config_settings_tab.dart b/lib/ui/settings/widgets/global_config_settings_tab.dart index e6f64e090..263fb56d7 100644 --- a/lib/ui/settings/widgets/global_config_settings_tab.dart +++ b/lib/ui/settings/widgets/global_config_settings_tab.dart @@ -196,8 +196,8 @@ class _GlobalConfigSettingsTabState extends State { // Show success message ScaffoldMessenger.of(context).showSnackBar( - const SnackBar( - content: Text('Configuration saved successfully. Restarting app...'), + SnackBar( + content: Text(AppLocalizations.of(context)!.app_restart_message), duration: Duration(seconds: 2), ), ); diff --git a/lib/ui/settings/widgets/scheduled_jobs_settings.dart b/lib/ui/settings/widgets/scheduled_jobs_settings.dart index e1e135ebf..36a30e0ea 100644 --- a/lib/ui/settings/widgets/scheduled_jobs_settings.dart +++ b/lib/ui/settings/widgets/scheduled_jobs_settings.dart @@ -1,12 +1,12 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:provider/provider.dart'; import 'package:registration_client/platform_spi/sync_response_service.dart'; import 'package:registration_client/utils/sync_job_def.dart'; import 'package:restart_app/restart_app.dart'; +import '../../../model/settings.dart'; import '../../../provider/sync_provider.dart'; // Dart equivalent of the Java PACKET_JOBS constant @@ -15,10 +15,14 @@ const List PACKET_JOBS = ['RPS_J00006', 'RSJ_J00014', 'PUJ_J00017']; class ScheduledJobsSettings extends StatefulWidget { const ScheduledJobsSettings({ super.key, + required this.settings, + required this.selectedLan, required this.jobJsonList, this.onRefreshJob, }); + final Settings settings; + final String selectedLan; final List jobJsonList; final void Function(String jobId)? onRefreshJob; @@ -71,6 +75,10 @@ class _ScheduledJobsSettingsState extends State { .map((e) => _ScheduledJob.fromJson(json.decode(e) as Map)) .toList(); + final heading = widget.settings.label?[widget.selectedLan] ?? + widget.settings.label?['eng'] ?? + (widget.settings.label?.values.first ?? 'Unknown'); + return SafeArea( top: false, bottom: true, @@ -83,7 +91,7 @@ class _ScheduledJobsSettingsState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - AppLocalizations.of(context)!.scheduled_job_settings, + heading, style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w600), ), const SizedBox(height: 12), From 0080d664fce2b24bad616d4e6002bac42f7a3159 Mon Sep 17 00:00:00 2001 From: Madhuravas reddy Date: Thu, 26 Feb 2026 18:20:08 +0530 Subject: [PATCH 07/14] RCF-1243 Resolved user details dashboard alignment issue (#696) * RCF-1284 hiding next button in bimetric exception screen Signed-off-by: Madhuravas reddy * RCF-1243 Resolved user details dashboard alignment issue Signed-off-by: Madhuravas reddy * Resolved code rabbit review comments Signed-off-by: Madhuravas reddy * Resolved code rabbit review comments Signed-off-by: Madhuravas reddy --------- Signed-off-by: Madhuravas reddy Signed-off-by: damodarguru --- lib/ui/dashboard/user_dashboard.dart | 346 +++++++++++++++++++-------- 1 file changed, 251 insertions(+), 95 deletions(-) diff --git a/lib/ui/dashboard/user_dashboard.dart b/lib/ui/dashboard/user_dashboard.dart index 1641f1dae..a8f322ce0 100644 --- a/lib/ui/dashboard/user_dashboard.dart +++ b/lib/ui/dashboard/user_dashboard.dart @@ -119,10 +119,23 @@ class _UserDashBoardState extends State { ], ), const SizedBox(height: 10), - Text(appLocalizations.packets_created, - style: TextStyle( - fontSize: isMobileSize ? 15 : 20, - fontWeight: FontWeight.bold)), + SizedBox( + width: double.infinity, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 4.0), + child: FittedBox( + fit: BoxFit.scaleDown, + child: Text( + appLocalizations.packets_created, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: isMobileSize ? 15 : 20, + fontWeight: FontWeight.bold), + ), + ), + ), + ), ], ), ); @@ -165,10 +178,23 @@ class _UserDashBoardState extends State { ], ), const SizedBox(height: 10), - Text(appLocalizations.packets_synced, - style: TextStyle( - fontSize: isMobileSize ? 15 : 20, - fontWeight: FontWeight.bold)), + SizedBox( + width: double.infinity, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 4.0), + child: FittedBox( + fit: BoxFit.scaleDown, + child: Text( + appLocalizations.packets_synced, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: isMobileSize ? 15 : 20, + fontWeight: FontWeight.bold), + ), + ), + ), + ), ], ), ); @@ -209,25 +235,24 @@ class _UserDashBoardState extends State { ) ], ), - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const SizedBox(height: 12), // pushes text slightly downward - Padding( - padding: const EdgeInsets.symmetric(horizontal: 4.0), - child: FittedBox( - fit: BoxFit.scaleDown, - child: Text( - appLocalizations.packets_uploaded, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: isMobileSize ? 15 : 20, - fontWeight: FontWeight.bold, - ), + const SizedBox(height: 12), + SizedBox( + width: double.infinity, + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 4.0), + child: FittedBox( + fit: BoxFit.scaleDown, + child: Text( + appLocalizations.packets_uploaded, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: isMobileSize ? 15 : 20, + fontWeight: FontWeight.bold, ), ), ), - ], + ), ) ], ), @@ -315,55 +340,177 @@ class _UserDashBoardState extends State { ? const EdgeInsets.only(left: 10, right: 10, bottom: 10) : const EdgeInsets.only( left: 40, right: 40, bottom: 20), - child: SizedBox( - width: MediaQuery.of(context).size.width, - child: snapshot.hasData - ? FittedBox( - fit: BoxFit.scaleDown, // Shrinks table to fit in screen - alignment: Alignment.topLeft, - child:DataTable( - dividerThickness: 2, - headingRowHeight: 60, - columns: [ - DataColumn( - label: Text(appLocalizations.user_id, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: isMobileSize ? 12 : 20, - color: appBlackShade2))), - DataColumn( - label: Text(appLocalizations.user_name, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: isMobileSize ? 12 : 20, - color: appBlackShade2))), - DataColumn( - label: Text(appLocalizations.status, - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: isMobileSize ? 12 : 20, - color: appBlackShade2))), - ], - rows: snapshot.data! - .map((data) => DataRow(cells: [ - DataCell(Text(data!.userId.toString(), - style: TextStyle( - fontSize: - isMobileSize ? 10 : 17, - color: appBlackShade1, - fontWeight: FontWeight.w500))), - DataCell(Text(data.userName.toString(), - style: TextStyle( - fontSize: - isMobileSize ? 10 : 17, - color: appBlackShade2, - fontWeight: FontWeight.w500))), - DataCell(statusWidget(data.userStatus, - data.userIsOnboarded)) - ])) - .toList()) - ) - : const SizedBox.shrink(), + child: LayoutBuilder( + builder: (context, constraints) { + const minTableWidth = 480.0; + final cardMarginHorizontal = + isMobileSize ? 20.0 : 80.0; + final effectiveMaxWidth = + constraints.maxWidth.isFinite + ? constraints.maxWidth + : MediaQuery.of(context).size.width - + cardMarginHorizontal; + final tableWidth = + effectiveMaxWidth < minTableWidth + ? minTableWidth + : effectiveMaxWidth; + final needsHorizontalScroll = + tableWidth > effectiveMaxWidth; + final table = snapshot.hasData + ? Table( + columnWidths: const { + 0: FlexColumnWidth(), + 1: FlexColumnWidth(), + 2: FlexColumnWidth(), + }, + defaultVerticalAlignment: + TableCellVerticalAlignment.middle, + border: TableBorder( + horizontalInside: BorderSide( + width: 2, color: Colors.grey.shade300), + ), + children: [ + TableRow( + decoration: BoxDecoration( + color: Colors.grey.shade100), + children: [ + TableCell( + verticalAlignment: + TableCellVerticalAlignment + .middle, + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 16, + vertical: 20), + child: Text( + appLocalizations.user_id, + style: TextStyle( + fontWeight: + FontWeight.bold, + fontSize: + isMobileSize ? 12 : 20, + color: appBlackShade2)), + ), + ), + TableCell( + verticalAlignment: + TableCellVerticalAlignment + .middle, + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 16, + vertical: 20), + child: Text( + appLocalizations.user_name, + style: TextStyle( + fontWeight: + FontWeight.bold, + fontSize: + isMobileSize ? 12 : 20, + color: appBlackShade2)), + ), + ), + TableCell( + verticalAlignment: + TableCellVerticalAlignment + .middle, + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 16, + vertical: 20), + child: Text( + appLocalizations.status, + style: TextStyle( + fontWeight: + FontWeight.bold, + fontSize: + isMobileSize ? 12 : 20, + color: appBlackShade2)), + ), + ), + ]), + ...snapshot.data! + .whereType() + .map((data) => TableRow( + children: [ + TableCell( + verticalAlignment: + TableCellVerticalAlignment + .middle, + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 16, + vertical: 12), + child: Text( + data.userId.toString(), + style: TextStyle( + fontSize: isMobileSize + ? 10 + : 16, + color: appBlackShade1, + fontWeight: + FontWeight.w500)), + ), + ), + TableCell( + verticalAlignment: + TableCellVerticalAlignment + .middle, + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 16, + vertical: 12), + child: Text( + data.userName.toString(), + style: TextStyle( + fontSize: isMobileSize + ? 10 + : 16, + color: appBlackShade2, + fontWeight: + FontWeight.w500)), + ), + ), + TableCell( + verticalAlignment: + TableCellVerticalAlignment + .middle, + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 16, + vertical: 12), + child: statusWidget( + data.userStatus, + data.userIsOnboarded), + ), + ), + ], + )) + .toList(), + ], + ) + : const SizedBox.shrink(); + final tableChild = SizedBox( + width: tableWidth, + child: table, + ); + final content = needsHorizontalScroll + ? SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: tableChild, + ) + : tableChild; + return SizedBox( + width: effectiveMaxWidth, + child: content, + ); + }, ), ); }) @@ -394,13 +541,16 @@ class _UserDashBoardState extends State { size: isMobileSize ? 15 : 27, color: dashBoardPacketUploadPendingColor, ), - Text( - " ${appLocalizations.active_not_onboarded}", - style: TextStyle( - fontSize: isMobileSize ? 10 : 17, - color: appBlackShade2, - fontWeight: FontWeight.w500), - ) + Expanded( + child: Text( + " ${appLocalizations.active_not_onboarded}", + style: TextStyle( + fontSize: isMobileSize ? 10 : 16, + color: appBlackShade2, + fontWeight: FontWeight.w500), + overflow: TextOverflow.ellipsis, + ), + ), ], ); } @@ -412,20 +562,23 @@ class _UserDashBoardState extends State { size: isMobileSize ? 15 : 27, color: appBlackShade3, ), - Text( - " ${appLocalizations.user_inactive}", - style: TextStyle( - fontSize: isMobileSize ? 10 : 17, - color: appBlackShade2, - fontWeight: FontWeight.w500), - ) + Expanded( + child: Text( + " ${appLocalizations.user_inactive}", + style: TextStyle( + fontSize: isMobileSize ? 10 : 16, + color: appBlackShade2, + fontWeight: FontWeight.w500), + overflow: TextOverflow.ellipsis, + ), + ), ], ); } return Container(); } - Widget getUserOnboardedWidget(){ + Widget getUserOnboardedWidget() { return Row( children: [ Icon( @@ -433,13 +586,16 @@ class _UserDashBoardState extends State { size: isMobileSize ? 15 : 27, color: dashBoardPacketUploadColor, ), - Text( - " ${appLocalizations.onboarded}", - style: TextStyle( - fontSize: isMobileSize ? 10 : 17, - color: appBlackShade2, - fontWeight: FontWeight.w500), - ) + Expanded( + child: Text( + " ${appLocalizations.onboarded}", + style: TextStyle( + fontSize: isMobileSize ? 10 : 16, + color: appBlackShade2, + fontWeight: FontWeight.w500), + overflow: TextOverflow.ellipsis, + ), + ), ], ); } From 6faeaf3d2d9597141832486d020bfac96a98a63f Mon Sep 17 00:00:00 2001 From: Madhuravas reddy Date: Thu, 26 Feb 2026 18:27:21 +0530 Subject: [PATCH 08/14] RCF-1397 resolved Security CBC issue (#701) * RCF-1397 Security CBC issue Signed-off-by: Madhuravas reddy * Created comman file for secure storage configure Signed-off-by: Madhuravas reddy --------- Signed-off-by: Madhuravas reddy Signed-off-by: damodarguru --- lib/provider/approve_packets_provider.dart | 8 ++------ lib/provider/registration_task_provider.dart | 8 ++------ .../widget/template_bottom_sheet.dart | 9 ++------- lib/utils/secure_storage.dart | 19 +++++++++++++++++++ 4 files changed, 25 insertions(+), 19 deletions(-) create mode 100644 lib/utils/secure_storage.dart diff --git a/lib/provider/approve_packets_provider.dart b/lib/provider/approve_packets_provider.dart index 55bd8d428..9e64cf811 100644 --- a/lib/provider/approve_packets_provider.dart +++ b/lib/provider/approve_packets_provider.dart @@ -2,8 +2,8 @@ import 'dart:convert'; import 'dart:developer'; import 'package:flutter/material.dart'; -import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:registration_client/model/registration.dart'; +import 'package:registration_client/utils/secure_storage.dart'; import 'package:registration_client/platform_android/packet_service_impl.dart'; import 'package:registration_client/utils/constants.dart'; import 'package:webview_flutter_plus/webview_flutter_plus.dart'; @@ -12,11 +12,7 @@ import '../platform_android/sync_response_service_impl.dart'; import '../platform_spi/packet_service.dart'; class ApprovePacketsProvider with ChangeNotifier { - final storage = const FlutterSecureStorage( - aOptions: AndroidOptions( - encryptedSharedPreferences: true, - ), - ); + final storage = appSecureStorage; List> packetsList = []; List> matchingPackets = []; diff --git a/lib/provider/registration_task_provider.dart b/lib/provider/registration_task_provider.dart index 6d3211e3d..e9ecc431e 100644 --- a/lib/provider/registration_task_provider.dart +++ b/lib/provider/registration_task_provider.dart @@ -9,8 +9,8 @@ import 'dart:developer'; import 'dart:typed_data'; import 'package:flutter/material.dart'; -import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:flutter/services.dart'; +import 'package:registration_client/utils/secure_storage.dart'; import 'package:registration_client/pigeon/dash_board_pigeon.dart'; import 'package:registration_client/pigeon/dynamic_response_pigeon.dart'; import 'package:registration_client/pigeon/registration_data_pigeon.dart'; @@ -32,11 +32,7 @@ class RegistrationTaskProvider with ChangeNotifier { final DashBoard dashBoard = DashBoard(); DynamicResponseService dynamicResponseService = DynamicResponseService(); final DocumentCategory documentCategory = DocumentCategory(); - static const storage = FlutterSecureStorage( - aOptions: AndroidOptions( - encryptedSharedPreferences: true, - ), - ); + static const storage = appSecureStorage; List _listOfProcesses = List.empty(growable: true); List _listOfSettings = List.empty(growable: true); diff --git a/lib/ui/approve_packet/widget/template_bottom_sheet.dart b/lib/ui/approve_packet/widget/template_bottom_sheet.dart index cf506d64b..1462746ba 100644 --- a/lib/ui/approve_packet/widget/template_bottom_sheet.dart +++ b/lib/ui/approve_packet/widget/template_bottom_sheet.dart @@ -2,8 +2,8 @@ import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:provider/provider.dart'; +import 'package:registration_client/utils/secure_storage.dart'; import 'package:registration_client/utils/app_config.dart'; import 'package:registration_client/utils/constants.dart'; import 'package:webview_flutter_plus/webview_flutter_plus.dart'; @@ -18,12 +18,7 @@ import 'package:registration_client/utils/secure_screen_service.dart'; class TemplateBottomSheet { void loadHtmlData(WebViewPlusController? controller, String packetId) async { log(packetId); - const storage = FlutterSecureStorage( - aOptions: AndroidOptions( - encryptedSharedPreferences: true, - ), - ); - String? data = await storage.read(key: packetId); + String? data = await appSecureStorage.read(key: packetId); if (controller != null) { controller.webViewController.loadHtmlString(data ?? "No Template..."); } diff --git a/lib/utils/secure_storage.dart b/lib/utils/secure_storage.dart new file mode 100644 index 000000000..161d107c8 --- /dev/null +++ b/lib/utils/secure_storage.dart @@ -0,0 +1,19 @@ +/* + * Copyright (c) Modular Open Source Identity Platform + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +import 'package:flutter_secure_storage/flutter_secure_storage.dart'; + +/// App-wide secure storage instance with strong Android crypto options. +/// Use this wherever FlutterSecureStorage is needed for consistency and reuse. +const FlutterSecureStorage appSecureStorage = FlutterSecureStorage( + aOptions: AndroidOptions( + keyCipherAlgorithm: + KeyCipherAlgorithm.RSA_ECB_OAEPwithSHA_256andMGF1Padding, + storageCipherAlgorithm: StorageCipherAlgorithm.AES_GCM_NoPadding, + resetOnError: true, + ), +); From d345635eb6f227d885dbea68b689a129331e87ac Mon Sep 17 00:00:00 2001 From: Sachin S P <52343650+SachinPremkumar@users.noreply.github.com> Date: Fri, 27 Feb 2026 13:42:36 +0530 Subject: [PATCH 09/14] RCF-1394 : Added semantics keys for automation (#693) * added semantic key for automation Signed-off-by: sachin.sp * added semantic key for automation Signed-off-by: sachin.sp * fixed review comment Signed-off-by: sachin.sp * reverted review comment changes Signed-off-by: sachin.sp * reverted review comment changes Signed-off-by: sachin.sp * resolved merge conflict Signed-off-by: sachin.sp --------- Signed-off-by: sachin.sp Co-authored-by: sachin.sp Signed-off-by: damodarguru --- .../images/{Group 57951.png => Menu_Grid.png} | Bin assets/l10n/app_ar.arb | 4 +- assets/l10n/app_en.arb | 4 +- assets/l10n/app_fr.arb | 4 +- assets/l10n/app_hi.arb | 4 +- assets/l10n/app_kn.arb | 4 +- assets/l10n/app_ta.arb | 4 +- lib/ui/approve_packet/approve_packet_ui.dart | 36 +++-- lib/ui/export_packet/export_packet_ui.dart | 36 +++-- ...tor_biometric_capture_scan_block_view.dart | 77 +++++---- .../operator_biometrics_capture_view.dart | 47 +++--- .../process_ui/widgets/dropdown_control.dart | 148 +++++++++--------- .../widgets/dynamic_dropdown_control.dart | 2 +- .../widgets/radio_button_control.dart | 10 +- .../process_ui/widgets/textbox_control.dart | 15 +- .../biometric_capture_control_portrait.dart | 55 ++++--- ...biometric_capture_scan_block_portrait.dart | 75 +++++---- .../widgets/global_config_settings_tab.dart | 68 +++++--- .../widgets/scheduled_jobs_settings.dart | 34 ++-- 19 files changed, 360 insertions(+), 267 deletions(-) rename assets/images/{Group 57951.png => Menu_Grid.png} (100%) diff --git a/assets/images/Group 57951.png b/assets/images/Menu_Grid.png similarity index 100% rename from assets/images/Group 57951.png rename to assets/images/Menu_Grid.png diff --git a/assets/l10n/app_ar.arb b/assets/l10n/app_ar.arb index f5df33a33..ea3b883ed 100644 --- a/assets/l10n/app_ar.arb +++ b/assets/l10n/app_ar.arb @@ -364,6 +364,8 @@ "search_for_key": "ابحث عن المفتاح", "sync_restart_dialog_message": "سيتم إعادة تشغيل التطبيق بمجرد النقر على إعادة التشغيل، وسيتم توجيهك إلى صفحة تسجيل الدخول.", "sync_restart_button": "إعادة التشغيل", - "app_restart_message": "تم حفظ التكوين بنجاح. جارٍ إعادة تشغيل التطبيق..." + "app_restart_message": "تم حفظ التكوين بنجاح. جارٍ إعادة تشغيل التطبيق...", + "select_option": "اختر خياراً", + "cron_expression": "تعبير كرون" } diff --git a/assets/l10n/app_en.arb b/assets/l10n/app_en.arb index fb380e671..1b82dcb83 100644 --- a/assets/l10n/app_en.arb +++ b/assets/l10n/app_en.arb @@ -364,5 +364,7 @@ "search_for_key": "Search for Key", "sync_restart_dialog_message": "The app will restart once you click Restart, and you will be redirected to the login page.", "sync_restart_button": "Restart", - "app_restart_message": "Configuration saved successfully. Restarting app..." + "app_restart_message": "Configuration saved successfully. Restarting app...", + "select_option": "Select Option", + "cron_expression": "Cron Expression" } diff --git a/assets/l10n/app_fr.arb b/assets/l10n/app_fr.arb index ab0590505..034cc9cc0 100644 --- a/assets/l10n/app_fr.arb +++ b/assets/l10n/app_fr.arb @@ -364,6 +364,8 @@ "search_for_key": "Rechercher une clé", "sync_restart_dialog_message": "L'application redémarrera une fois que vous aurez cliqué sur Redémarrer, et vous serez redirigé vers la page de connexion.", "sync_restart_button": "Redémarrer", - "app_restart_message": "Configuration enregistrée avec succès. Redémarrage de l'application..." + "app_restart_message": "Configuration enregistrée avec succès. Redémarrage de l'application...", + "select_option": "Sélectionner une option", + "cron_expression": "Expression Cron" } diff --git a/assets/l10n/app_hi.arb b/assets/l10n/app_hi.arb index 22bbf37d3..3e186d2c0 100644 --- a/assets/l10n/app_hi.arb +++ b/assets/l10n/app_hi.arb @@ -364,5 +364,7 @@ "search_for_key": "कुंजी खोजें", "sync_restart_dialog_message": "जैसे ही आप पुनः आरंभ करें पर क्लिक करेंगे ऐप पुनः आरंभ हो जाएगा, और आपको लॉगिन पृष्ठ पर पुनः निर्देशित किया जाएगा।", "sync_restart_button": "पुनः आरंभ करें", - "app_restart_message": "कॉन्फ़िगरेशन सफलतापूर्वक सहेजा गया. ऐप पुनः प्रारंभ हो रहा है..." + "app_restart_message": "कॉन्फ़िगरेशन सफलतापूर्वक सहेजा गया. ऐप पुनः प्रारंभ हो रहा है...", + "select_option": "विकल्प चुनें", + "cron_expression": "क्रोन एक्सप्रेशन" } diff --git a/assets/l10n/app_kn.arb b/assets/l10n/app_kn.arb index 29e561fb7..ac7ceb1fb 100644 --- a/assets/l10n/app_kn.arb +++ b/assets/l10n/app_kn.arb @@ -364,5 +364,7 @@ "search_for_key": "ಕೀಗಾಗಿ ಹುಡುಕಿ", "sync_restart_dialog_message": "ನೀವು ಮರುಪ್ರಾರಂಭ ಕ್ಲಿಕ್ ಮಾಡಿದ ನಂತರ ಅಪ್ಲಿಕೇಶನ್ ಮರುಪ್ರಾರಂಭವಾಗುತ್ತದೆ ಮತ್ತು ನಿಮ್ಮನ್ನು ಲಾಗಿನ್ ಪುಟಕ್ಕೆ ಮರುನಿರ್ದೇಶಿಸಲಾಗುತ್ತದೆ.", "sync_restart_button": "ಮರುಪ್ರಾರಂಭ", - "app_restart_message": "ಕಾನ್ಫಿಗರೇಶನ್ ಯಶಸ್ವಿಯಾಗಿ ಉಳಿಸಲಾಗಿದೆ. ಅಪ್ಲಿಕೇಶನ್ ಅನ್ನು ಮರುಪ್ರಾರಂಭಿಸಲಾಗುತ್ತಿದೆ..." + "app_restart_message": "ಕಾನ್ಫಿಗರೇಶನ್ ಯಶಸ್ವಿಯಾಗಿ ಉಳಿಸಲಾಗಿದೆ. ಅಪ್ಲಿಕೇಶನ್ ಅನ್ನು ಮರುಪ್ರಾರಂಭಿಸಲಾಗುತ್ತಿದೆ...", + "select_option": "ಆಯ್ಕೆಯನ್ನು ಆರಿಸಿ", + "cron_expression": "ಕ್ರಾನ್ ಎಕ್ಸ್‌ಪ್ರೆಶನ್" } diff --git a/assets/l10n/app_ta.arb b/assets/l10n/app_ta.arb index 744cd8b05..1238445a1 100644 --- a/assets/l10n/app_ta.arb +++ b/assets/l10n/app_ta.arb @@ -373,5 +373,7 @@ "search_for_key": "விசையைத் தேடவும்", "sync_restart_dialog_message": "மறுதொடக்கம் என்பதைக் கிளிக் செய்தவுடன் பயன்பாடு மறுதொடங்கும், மற்றும் நீங்கள் உள்நுழைவு பக்கத்திற்கு திருப்பிவிடப்படுவீர்கள்.", "sync_restart_button": "மறுதொடக்கம்", - "app_restart_message": "உள்ளமைவு வெற்றிகரமாக சேமிக்கப்பட்டது. பயன்பாட்டை மறுதொடக்கம் செய்கிறது..." + "app_restart_message": "உள்ளமைவு வெற்றிகரமாக சேமிக்கப்பட்டது. பயன்பாட்டை மறுதொடக்கம் செய்கிறது...", + "select_option": "விருப்பத்தைத் தேர்ந்தெடுக்கவும்", + "cron_expression": "கிரான் வெளிப்பாடு" } diff --git a/lib/ui/approve_packet/approve_packet_ui.dart b/lib/ui/approve_packet/approve_packet_ui.dart index a67c00851..ea394cb67 100644 --- a/lib/ui/approve_packet/approve_packet_ui.dart +++ b/lib/ui/approve_packet/approve_packet_ui.dart @@ -89,23 +89,27 @@ class _ApprovePacketsPageState extends State { elevation: 0, toolbarHeight: 75, leadingWidth: 80, - leading: Container( - margin: const EdgeInsets.all(14), - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: Colors.white.withOpacity(0.2), - padding: const EdgeInsets.all(4)), - child: const Icon( - Icons.arrow_back, - size: 32, + leading: Semantics( + label: 'pending_approval_back_button', + excludeSemantics: true, + child: Container( + margin: const EdgeInsets.all(14), + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Colors.white.withOpacity(0.2), + padding: const EdgeInsets.all(4)), + child: const Icon( + Icons.arrow_back, + size: 32, + ), + onPressed: () { + context + .read() + .getApplicationUploadNumber(); + context.read().getTotalCreatedPackets(); + Navigator.of(context).pop(); + }, ), - onPressed: () { - context - .read() - .getApplicationUploadNumber(); - context.read().getTotalCreatedPackets(); - Navigator.of(context).pop(); - }, ), ), title: Text(AppLocalizations.of(context)!.pending_approval), diff --git a/lib/ui/export_packet/export_packet_ui.dart b/lib/ui/export_packet/export_packet_ui.dart index bb9f925e5..5ddad3574 100644 --- a/lib/ui/export_packet/export_packet_ui.dart +++ b/lib/ui/export_packet/export_packet_ui.dart @@ -26,23 +26,27 @@ class ExportPacketsPage extends StatelessWidget { elevation: 0, toolbarHeight: 75, leadingWidth: 80, - leading: Container( - margin: const EdgeInsets.all(14), - child: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: Colors.white.withOpacity(0.2), - padding: const EdgeInsets.all(4)), - child: const Icon( - Icons.arrow_back, - size: 32, + leading: Semantics( + label: "manage_application_back_button", + excludeSemantics: true, + child: Container( + margin: const EdgeInsets.all(14), + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Colors.white.withOpacity(0.2), + padding: const EdgeInsets.all(4)), + child: const Icon( + Icons.arrow_back, + size: 32, + ), + onPressed: () { + context + .read() + .getApplicationUploadNumber(); + context.read().getTotalCreatedPackets(); + Navigator.of(context).pop(); + }, ), - onPressed: () { - context - .read() - .getApplicationUploadNumber(); - context.read().getTotalCreatedPackets(); - Navigator.of(context).pop(); - }, ), ), title: Text(AppLocalizations.of(context)!.manage_applications), diff --git a/lib/ui/onboard/widgets/operator_biometric_capture_scan_block_view.dart b/lib/ui/onboard/widgets/operator_biometric_capture_scan_block_view.dart index 4f3a05721..b82e02d39 100644 --- a/lib/ui/onboard/widgets/operator_biometric_capture_scan_block_view.dart +++ b/lib/ui/onboard/widgets/operator_biometric_capture_scan_block_view.dart @@ -1240,17 +1240,22 @@ class _OperatorBiometricCaptureScanBlockViewState ), ); }, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(1000), - color: solidPrimary), - height: 75, - width: 75, - child: Icon( - Icons.zoom_in, - color: pureWhite, - size: 35, - )))), + child: Semantics( + label: "zoom_in_button", + container: true, + excludeSemantics: true, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(1000), + color: solidPrimary), + height: 75, + width: 75, + child: Icon( + Icons.zoom_in, + color: pureWhite, + size: 35, + )), + ))), ], ); } @@ -1901,17 +1906,22 @@ class _OperatorBiometricCaptureScanBlockViewState ), ); }, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(1000), - color: solidPrimary), - height: 75, - width: 75, - child: Icon( - Icons.zoom_in, - color: pureWhite, - size: 35, - )))), + child: Semantics( + label: "zoom_in_button", + container: true, + excludeSemantics: true, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(1000), + color: solidPrimary), + height: 75, + width: 75, + child: Icon( + Icons.zoom_in, + color: pureWhite, + size: 35, + ))), + )), ], ); } @@ -2358,15 +2368,20 @@ class _OperatorBiometricCaptureScanBlockViewState overflow: TextOverflow.ellipsis, ), ), - Padding( - padding: const EdgeInsets.only(right: 30), - child: InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Image.asset( - "assets/images/Group 57951.png", - height: (isMobileSize) ? 30.h : 52.h, + Semantics( + label: "menu_back_button", + container: true, + excludeSemantics: true, + child: Padding( + padding: const EdgeInsets.only(right: 30), + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Image.asset( + "assets/images/Menu_Grid.png", + height: (isMobileSize) ? 30.h : 52.h, + ), ), ), ) diff --git a/lib/ui/onboard/widgets/operator_biometrics_capture_view.dart b/lib/ui/onboard/widgets/operator_biometrics_capture_view.dart index 5283cfe4d..f56e02168 100644 --- a/lib/ui/onboard/widgets/operator_biometrics_capture_view.dart +++ b/lib/ui/onboard/widgets/operator_biometrics_capture_view.dart @@ -80,29 +80,34 @@ class _OperatorBiometricsCaptureState ? secondaryColors.elementAt(12) : secondaryColors.elementAt(14)), borderRadius: BorderRadius.circular(10)), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: SvgPicture.asset( - "assets/svg/${biometricAttributeData.title}.svg", - height: 200.h, - width: 200.h, + child: Semantics( + label: biometricAttributeData.title, + excludeSemantics: true, + container: true, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: SvgPicture.asset( + "assets/svg/${biometricAttributeData.title}.svg", + height: 200.h, + width: 200.h, + ), ), - ), - SizedBox( - height: 10.h, - ), - Text( - "${biometricAttributeData.viewTitle} ${AppLocalizations.of(context)!.scan}", - style: TextStyle( - fontSize: 28, - fontWeight: semiBold, - color: blackShade1, + SizedBox( + height: 10.h, ), - ) - ], + Text( + "${biometricAttributeData.viewTitle} ${AppLocalizations.of(context)!.scan}", + style: TextStyle( + fontSize: 28, + fontWeight: semiBold, + color: blackShade1, + ), + ) + ], + ), ), ), if (biometricAttributeData.isScanned == true) diff --git a/lib/ui/process_ui/widgets/dropdown_control.dart b/lib/ui/process_ui/widgets/dropdown_control.dart index 0ebede31b..da5f75015 100644 --- a/lib/ui/process_ui/widgets/dropdown_control.dart +++ b/lib/ui/process_ui/widgets/dropdown_control.dart @@ -236,85 +236,85 @@ class _CustomDropDownState extends State { return Column( children: [ Card( - elevation: 5, - margin: EdgeInsets.symmetric( - vertical: 1.h, horizontal: isPortrait ? 16.w : 0), - child: Padding( - padding: EdgeInsets.symmetric(vertical: 24.h, horizontal: 16.w), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - CustomLabel(field: widget.field), - const SizedBox( - height: 10, - ), - DropdownButtonFormField( - isExpanded: true, - icon: const Icon(null), - decoration: InputDecoration( - contentPadding: - const EdgeInsets.symmetric(horizontal: 16.0), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(8.0), - borderSide: const BorderSide( - color: Colors.grey, - width: 1.0, - ), - ), - hintText: "Select Option", - hintStyle: const TextStyle( - color: appBlackShade3, + elevation: 5, + margin: EdgeInsets.symmetric( + vertical: 1.h, horizontal: isPortrait ? 16.w : 0), + child: Padding( + padding: EdgeInsets.symmetric(vertical: 24.h, horizontal: 16.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CustomLabel(field: widget.field), + const SizedBox( + height: 10, + ), + DropdownButtonFormField( + isExpanded: true, + icon: const Icon(null), + decoration: InputDecoration( + contentPadding: + const EdgeInsets.symmetric(horizontal: 16.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(8.0), + borderSide: const BorderSide( + color: Colors.grey, + width: 1.0, ), - suffixIcon: const Icon(Icons.keyboard_arrow_down, - color: Colors.grey), ), - items: list - .map((option) => DropdownMenuItem( - value: option, - child: Text(option!.concatenatedName ?? option.name, - overflow: TextOverflow.ellipsis, - maxLines: 1, - softWrap: false, - ), - )) - .toList(), - autovalidateMode: AutovalidateMode.onUserInteraction, - value: selected, - validator: (value) { - if (!widget.field.required!) { - if (widget.field.requiredOn == null || - widget.field.requiredOn!.isEmpty || - !(globalProvider - .mvelRequiredFields[widget.field.id] ?? - true)) { - return null; - } - } - if (value == null) { - log("validation $value"); - return AppLocalizations.of(context)!.select_value_message; - } - if (!widget.validation.hasMatch(value.name)) { - log("validation match $value"); - return AppLocalizations.of(context)!.select_value_message; - } - return null; - }, - onChanged: (value) { - if (value != selected) { - saveData(value); - _saveDataToMap(value); - globalProvider.setLocationHierarchy( - widget.field.group!, value!.code, index!); - String lang = globalProvider.mandatoryLanguages[0]!; - _getSelectedValueFromMap(lang, list); - } - }, + hintText: AppLocalizations.of(context)!.select_option, + hintStyle: const TextStyle( + color: appBlackShade3, + ), + suffixIcon: const Icon(Icons.keyboard_arrow_down, + color: Colors.grey), ), - ], - ), + items: list + .map((option) => DropdownMenuItem( + value: option, + child: Text(option!.concatenatedName ?? option.name, + overflow: TextOverflow.ellipsis, + maxLines: 1, + softWrap: false, + ), + )) + .toList(), + autovalidateMode: AutovalidateMode.onUserInteraction, + value: selected, + validator: (value) { + if (!widget.field.required!) { + if (widget.field.requiredOn == null || + widget.field.requiredOn!.isEmpty || + !(globalProvider + .mvelRequiredFields[widget.field.id] ?? + true)) { + return null; + } + } + if (value == null) { + log("validation $value"); + return AppLocalizations.of(context)!.select_value_message; + } + if (!widget.validation.hasMatch(value.name)) { + log("validation match $value"); + return AppLocalizations.of(context)!.select_value_message; + } + return null; + }, + onChanged: (value) { + if (value != selected) { + saveData(value); + _saveDataToMap(value); + globalProvider.setLocationHierarchy( + widget.field.group!, value!.code, index!); + String lang = globalProvider.mandatoryLanguages[0]!; + _getSelectedValueFromMap(lang, list); + } + }, + ), + ], ), ), + ), ], ); } diff --git a/lib/ui/process_ui/widgets/dynamic_dropdown_control.dart b/lib/ui/process_ui/widgets/dynamic_dropdown_control.dart index 7890a41a1..6156fe7ff 100644 --- a/lib/ui/process_ui/widgets/dynamic_dropdown_control.dart +++ b/lib/ui/process_ui/widgets/dynamic_dropdown_control.dart @@ -172,7 +172,7 @@ class _CustomDynamicDropDownState extends State { width: 1.0, ), ), - hintText: "Select Option", + hintText: AppLocalizations.of(context)!.select_option, hintStyle: const TextStyle( color: appBlackShade3, ), diff --git a/lib/ui/process_ui/widgets/radio_button_control.dart b/lib/ui/process_ui/widgets/radio_button_control.dart index 9d8a3132f..ebec12089 100644 --- a/lib/ui/process_ui/widgets/radio_button_control.dart +++ b/lib/ui/process_ui/widgets/radio_button_control.dart @@ -17,6 +17,8 @@ import '../../../model/field.dart'; import '../../../provider/global_provider.dart'; import 'custom_label.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; + class RadioButtonControl extends StatefulWidget { const RadioButtonControl({super.key, required this.field}); @@ -118,7 +120,7 @@ class _RadioFormFieldState extends State { setState(() { showError = true; }); - return "Select option"; + return AppLocalizations.of(context)!.select_option; } setState(() { showError = false; @@ -154,9 +156,9 @@ class _RadioFormFieldState extends State { height: 10, ), showError - ? const Text( - "* Select Option", - style: TextStyle( + ? Text( + "* ${AppLocalizations.of(context)!.select_option}", + style: const TextStyle( color: Color.fromARGB(255, 159, 21, 11), fontSize: 12), ) diff --git a/lib/ui/process_ui/widgets/textbox_control.dart b/lib/ui/process_ui/widgets/textbox_control.dart index c4c423f83..e75744ea8 100644 --- a/lib/ui/process_ui/widgets/textbox_control.dart +++ b/lib/ui/process_ui/widgets/textbox_control.dart @@ -167,11 +167,15 @@ class _TextBoxControlState extends State controllerMap.putIfAbsent(lang, () => TextEditingController(text: _getDataFromMap(lang))); }); - return Container( - margin: const EdgeInsets.only(bottom: 8), - child: TextFormField( - autovalidateMode: AutovalidateMode.onUserInteraction, - controller: controllerMap[lang], + return Semantics( + label: '${widget.e.id}', + container: true, + excludeSemantics: true, + child: Container( + margin: const EdgeInsets.only(bottom: 8), + child: TextFormField( + autovalidateMode: AutovalidateMode.onUserInteraction, + controller: controllerMap[lang], textCapitalization: TextCapitalization.words, onChanged: (value) async { if (lang == mandatoryLanguageCode) { @@ -249,6 +253,7 @@ class _TextBoxControlState extends State const TextStyle(color: appBlackShade3, fontSize: 14), ), ), + ), ); }).toList(), ), diff --git a/lib/ui/process_ui/widgets_mobile/biometric_capture_control_portrait.dart b/lib/ui/process_ui/widgets_mobile/biometric_capture_control_portrait.dart index 81f8c3269..209c1c403 100644 --- a/lib/ui/process_ui/widgets_mobile/biometric_capture_control_portrait.dart +++ b/lib/ui/process_ui/widgets_mobile/biometric_capture_control_portrait.dart @@ -89,33 +89,38 @@ class _BiometricCaptureControlPortraitState ? secondaryColors.elementAt(12) : secondaryColors.elementAt(14)), borderRadius: BorderRadius.circular(10)), - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: SvgPicture.asset( - "assets/svg/${biometricAttributeData.title}.svg", - height: 200.h, - width: 200.h, + child: Semantics( + label: biometricAttributeData.title, + excludeSemantics: true, + container: true, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: SvgPicture.asset( + "assets/svg/${biometricAttributeData.title}.svg", + height: 200.h, + width: 200.h, + ), ), - ), - SizedBox( - height: 10.h, - ), - Text( - "${biometricAttributeData.viewTitle} ${AppLocalizations.of(context)!.scan}", - style: TextStyle( - fontSize: 28, - fontWeight: semiBold, - color: blackShade1, + SizedBox( + height: 10.h, ), - textAlign: TextAlign.center, - maxLines: 2, - overflow: TextOverflow.ellipsis, - softWrap: true, - ) - ], + Text( + "${biometricAttributeData.viewTitle} ${AppLocalizations.of(context)!.scan}", + style: TextStyle( + fontSize: 28, + fontWeight: semiBold, + color: blackShade1, + ), + textAlign: TextAlign.center, + maxLines: 2, + overflow: TextOverflow.ellipsis, + softWrap: true, + ) + ], + ), ), ), if (biometricAttributeData.isScanned == true) diff --git a/lib/ui/process_ui/widgets_mobile/biometric_capture_scan_block_portrait.dart b/lib/ui/process_ui/widgets_mobile/biometric_capture_scan_block_portrait.dart index 4fdf3e096..d8127fa99 100644 --- a/lib/ui/process_ui/widgets_mobile/biometric_capture_scan_block_portrait.dart +++ b/lib/ui/process_ui/widgets_mobile/biometric_capture_scan_block_portrait.dart @@ -1941,16 +1941,21 @@ class _BiometricCaptureScanBlockPortraitState ), ); }, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(1000), - color: solidPrimary), - height: 75, - width: 75, - child: Icon( - Icons.zoom_in, - color: pureWhite, - size: 35, + child: Semantics( + label: "zoom_in_button", + container: true, + excludeSemantics: true, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(1000), + color: solidPrimary), + height: 75, + width: 75, + child: Icon( + Icons.zoom_in, + color: pureWhite, + size: 35, + ), ), ), ), @@ -2669,17 +2674,22 @@ class _BiometricCaptureScanBlockPortraitState ), ); }, - child: Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(1000), - color: solidPrimary), - height: 75, - width: 75, - child: Icon( - Icons.zoom_in, - color: pureWhite, - size: 35, - )))), + child: Semantics( + label: "zoom_in_button", + container: true, + excludeSemantics: true, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(1000), + color: solidPrimary), + height: 75, + width: 75, + child: Icon( + Icons.zoom_in, + color: pureWhite, + size: 35, + )), + ))), ], ); } @@ -3086,15 +3096,20 @@ class _BiometricCaptureScanBlockPortraitState ), ), ), - Padding( - padding: const EdgeInsets.only(right: 30), - child: InkWell( - onTap: () { - Navigator.pop(context); - }, - child: Image.asset( - "assets/images/Group 57951.png", - height: (isMobileSize) ? 30.h : 52.h, + Semantics( + label: "menu_back_button", + container: true, + excludeSemantics: true, + child: Padding( + padding: const EdgeInsets.only(right: 30), + child: InkWell( + onTap: () { + Navigator.pop(context); + }, + child: Image.asset( + "assets/images/Menu_Grid.png", + height: (isMobileSize) ? 30.h : 52.h, + ), ), ), ) diff --git a/lib/ui/settings/widgets/global_config_settings_tab.dart b/lib/ui/settings/widgets/global_config_settings_tab.dart index 263fb56d7..3226edd63 100644 --- a/lib/ui/settings/widgets/global_config_settings_tab.dart +++ b/lib/ui/settings/widgets/global_config_settings_tab.dart @@ -278,16 +278,21 @@ class _GlobalConfigSettingsTabState extends State { const SizedBox(height: 12), Padding( padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: TextField( - controller: _searchController, - decoration: InputDecoration( - hintText: AppLocalizations.of(context)!.search_for_key, - prefixIcon: const Icon(Icons.search), - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(4), - borderSide: BorderSide(color: Colors.grey[300]!), + child: Semantics( + label: 'global_config_search', + container: true, + excludeSemantics: true, + child: TextField( + controller: _searchController, + decoration: InputDecoration( + hintText: AppLocalizations.of(context)!.search_for_key, + prefixIcon: const Icon(Icons.search), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(4), + borderSide: BorderSide(color: Colors.grey[300]!), + ), + contentPadding: const EdgeInsets.symmetric(vertical: 0, horizontal: 12), ), - contentPadding: const EdgeInsets.symmetric(vertical: 0, horizontal: 12), ), ), ), @@ -302,31 +307,46 @@ class _GlobalConfigSettingsTabState extends State { children: [ Expanded( flex: 2, - child: Text( - AppLocalizations.of(context)!.key, - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, + child: Semantics( + label: 'key', + container: true, + excludeSemantics: true, + child: Text( + AppLocalizations.of(context)!.key, + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + ), ), ), ), Expanded( flex: 1, - child: Text( - AppLocalizations.of(context)!.server_value, - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, + child: Semantics( + label: 'server_value', + container: true, + excludeSemantics: true, + child: Text( + AppLocalizations.of(context)!.server_value, + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + ), ), ), ), Expanded( flex: 1, - child: Text( - AppLocalizations.of(context)!.local_value, - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, + child: Semantics( + label: 'local_value', + container: true, + excludeSemantics: true, + child: Text( + AppLocalizations.of(context)!.local_value, + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + ), ), ), ), diff --git a/lib/ui/settings/widgets/scheduled_jobs_settings.dart b/lib/ui/settings/widgets/scheduled_jobs_settings.dart index 36a30e0ea..d682673bf 100644 --- a/lib/ui/settings/widgets/scheduled_jobs_settings.dart +++ b/lib/ui/settings/widgets/scheduled_jobs_settings.dart @@ -5,6 +5,7 @@ import 'package:provider/provider.dart'; import 'package:registration_client/platform_spi/sync_response_service.dart'; import 'package:registration_client/utils/sync_job_def.dart'; import 'package:restart_app/restart_app.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import '../../../model/settings.dart'; import '../../../provider/sync_provider.dart'; @@ -401,20 +402,25 @@ class _JobCardState extends State<_JobCard> { children: [ SizedBox( height: 32, - child: TextField( - controller: _cronController, - decoration: InputDecoration( - hintText: 'Cron Expression', - errorText: null, - errorBorder: _cronError != null - ? const OutlineInputBorder( - borderSide: BorderSide(color: Colors.red, width: 1)) - : null, - border: const OutlineInputBorder(), - isDense: true, - contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8), + child: Semantics( + label: '${job.id}_cron_expression', + excludeSemantics: true, + container: true, + child: TextField( + controller: _cronController, + decoration: InputDecoration( + hintText: AppLocalizations.of(context)!.cron_expression, + errorText: null, + errorBorder: _cronError != null + ? const OutlineInputBorder( + borderSide: BorderSide(color: Colors.red, width: 1)) + : null, + border: const OutlineInputBorder(), + isDense: true, + contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8), + ), + style: const TextStyle(fontSize: 11), ), - style: const TextStyle(fontSize: 11), ), ), if (_cronError != null) @@ -446,7 +452,7 @@ class _JobCardState extends State<_JobCard> { valueColor: AlwaysStoppedAnimation(Colors.white), ), ) - : const Text('Submit', style: TextStyle(fontSize: 11)), + : Text(AppLocalizations.of(context)!.submit, style: const TextStyle(fontSize: 11)), ), ), ], From 6bb3fa4357edb8d1bd4eefcfb4ede7fb334a14c2 Mon Sep 17 00:00:00 2001 From: Sachin S P <52343650+SachinPremkumar@users.noreply.github.com> Date: Fri, 27 Feb 2026 13:46:19 +0530 Subject: [PATCH 10/14] [RCF-1368] added dropdown list in logged language (#690) * added dropdown list in logged lang Signed-off-by: sachin.sp * added dropdown list in logged lang Signed-off-by: sachin.sp * added dropdown list in logged lang Signed-off-by: sachin.sp * added dropdown list in logged lang Signed-off-by: sachin.sp * reverted review comment changes Signed-off-by: sachin.sp --------- Signed-off-by: sachin.sp Co-authored-by: sachin.sp Signed-off-by: damodarguru --- .../api_services/DocumentCategoryApi.java | 59 +++++++++++++------ .../document_category_impl.dart | 4 +- .../document_category_service.dart | 2 +- lib/provider/registration_task_provider.dart | 4 +- .../widgets/document_upload_control.dart | 13 +++- pigeon/document_category.dart | 2 +- 6 files changed, 58 insertions(+), 26 deletions(-) diff --git a/android/app/src/main/java/io/mosip/registration_client/api_services/DocumentCategoryApi.java b/android/app/src/main/java/io/mosip/registration_client/api_services/DocumentCategoryApi.java index 5e6e2d839..1d7d171a4 100644 --- a/android/app/src/main/java/io/mosip/registration_client/api_services/DocumentCategoryApi.java +++ b/android/app/src/main/java/io/mosip/registration_client/api_services/DocumentCategoryApi.java @@ -14,12 +14,16 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + import javax.inject.Inject; import javax.inject.Singleton; @@ -65,10 +69,11 @@ public class DocumentCategoryApi implements DocumentCategoryPigeon.DocumentCateg ClientCryptoManagerService clientCryptoManagerService; - - @Inject - public DocumentCategoryApi(RegistrationService registrationService,FileSignatureDao fileSignatureRepository,GlobalParamRepository globalParamRepository,MasterDataService masterDataService,CertificateManagerService certificateManagerService,CryptoManagerService cryptoManagerServiceImpl,ClientCryptoManagerService clientCryptoManagerService,Context context) { + public DocumentCategoryApi(RegistrationService registrationService, FileSignatureDao fileSignatureRepository, + GlobalParamRepository globalParamRepository, MasterDataService masterDataService, + CertificateManagerService certificateManagerService, CryptoManagerService cryptoManagerServiceImpl, + ClientCryptoManagerService clientCryptoManagerService, Context context) { this.registrationService = registrationService; this.context = context; this.fileSignatureRepository = fileSignatureRepository; @@ -79,14 +84,33 @@ public DocumentCategoryApi(RegistrationService registrationService,FileSignature this.cryptoManagerServiceImpl = cryptoManagerServiceImpl; this.clientCryptoManagerService = clientCryptoManagerService; } + @Override - public void getDocumentCategories(@NonNull String categoryCode, @NonNull String langCode, @NonNull DocumentCategoryPigeon.Result> result) { + public void getDocumentCategories(@NonNull String categoryCode, @NonNull String langCode, + @NonNull List languages, @NonNull DocumentCategoryPigeon.Result> result) { List documentCategory = new ArrayList<>(); try { Map dataContext = this.registrationService.getRegistrationDto().getMVELDataContext(); - String applicantTypeCode = this.evaluateMvelScript((String) this.globalParamRepository.getCachedStringMAVELScript(), dataContext); + String applicantTypeCode = this + .evaluateMvelScript((String) this.globalParamRepository.getCachedStringMAVELScript(), dataContext); Log.i(getClass().getSimpleName(), "applicantType: " + applicantTypeCode); - documentCategory = this.masterDataService.getDocumentTypes(categoryCode, applicantTypeCode, langCode); + if (languages.size() <= 1) { + List docs = this.masterDataService.getDocumentTypes(categoryCode, applicantTypeCode, langCode); + documentCategory = docs != null ? docs : Collections.emptyList(); + } else { + List> docsPerLang = languages.stream() + .map(l -> this.masterDataService.getDocumentTypes(categoryCode, applicantTypeCode, l)) + .map(d -> d != null ? d : Collections.emptyList()) + .collect(Collectors.toList()); + + documentCategory = IntStream.range(0, docsPerLang.stream().mapToInt(List::size).max().orElse(0)) + .mapToObj(i -> docsPerLang.stream() + .filter(l -> i < l.size()) + .map(l -> l.get(i)) + .collect(Collectors.joining(" / "))) + .filter(s -> !s.isEmpty()) + .collect(Collectors.toList()); + } } catch (Exception e) { Log.e(getClass().getSimpleName(), "Fetch document values: " + Arrays.toString(e.getStackTrace())); } @@ -106,9 +130,9 @@ public void getDocumentSize(@NonNull DocumentCategoryPigeon.Result resul public String evaluateMvelScript(String scriptName, Map dataContext) { try { - Map ageGroups = new HashMap(); + Map ageGroups = new HashMap(); JSONObject ageGroupConfig = new JSONObject((String) this.globalParamRepository.getCachedStringAgeGroup()); - for (Iterator it = ageGroupConfig.keys(); it.hasNext(); ) { + for (Iterator it = ageGroupConfig.keys(); it.hasNext();) { String key = it.next(); ageGroups.put(key, ageGroupConfig.getString(key)); } @@ -119,25 +143,25 @@ public String evaluateMvelScript(String scriptName, Map dataCont context.put("ageGroups", ageGroups); return MVEL.eval("return getApplicantType();", context, String.class); } catch (Exception e) { - Log.e(getClass().getSimpleName(),"Failed to evaluate mvel script", e); + Log.e(getClass().getSimpleName(), "Failed to evaluate mvel script", e); } return null; } private String getScript(String scriptName) { - if(SCRIPT_CACHE.containsKey(scriptName) && SCRIPT_CACHE.get(scriptName) != null) + if (SCRIPT_CACHE.containsKey(scriptName) && SCRIPT_CACHE.get(scriptName) != null) return SCRIPT_CACHE.get(scriptName); try { Optional fileSignature = this.fileSignatureRepository.findByFileName(scriptName); - if(!fileSignature.isPresent()) { + if (!fileSignature.isPresent()) { Log.e("File signature not found : {}", scriptName); return null; } Path path = Paths.get(context.getFilesDir().getAbsolutePath(), scriptName); byte[] bytes; - if(fileSignature.get().getEncrypted()) { + if (fileSignature.get().getEncrypted()) { CryptoRequestDto cryptoRequestDto = new CryptoRequestDto(); cryptoRequestDto.setValue(FileUtils.readFileToString(path.toFile(), StandardCharsets.UTF_8)); CryptoResponseDto cryptoResponseDto = clientCryptoFacade.decrypt(cryptoRequestDto); @@ -146,29 +170,30 @@ private String getScript(String scriptName) { bytes = FileUtils.readFileToByteArray(path.toFile()); } String actualData = String.format("{\"hash\":\"%s\"}", HMACUtils2.digestAsPlainText(bytes)); - if(!validateScriptSignature(fileSignature.get().getSignature(), actualData)) { + if (!validateScriptSignature(fileSignature.get().getSignature(), actualData)) { Log.e("File signature validation failed : {}", scriptName); return null; } SCRIPT_CACHE.put(scriptName, new String(bytes)); } catch (Exception e) { - Log.e(getClass().getSimpleName(),"Failed to get mvel script", e); + Log.e(getClass().getSimpleName(), "Failed to get mvel script", e); } return SCRIPT_CACHE.get(scriptName); } - private boolean validateScriptSignature(String signature, String actualData) throws Exception { String certificateData = this.certificateManagerService.getCertificate("SERVER-RESPONSE", "SIGN-VERIFY"); JWTSignatureVerifyRequestDto jwtSignatureVerifyRequestDto = new JWTSignatureVerifyRequestDto(); jwtSignatureVerifyRequestDto.setJwtSignatureData(signature); - jwtSignatureVerifyRequestDto.setActualData(CryptoUtil.encodeToURLSafeBase64(actualData.getBytes(StandardCharsets.UTF_8))); + jwtSignatureVerifyRequestDto + .setActualData(CryptoUtil.encodeToURLSafeBase64(actualData.getBytes(StandardCharsets.UTF_8))); jwtSignatureVerifyRequestDto.setCertificateData(certificateData); - JWTSignatureVerifyResponseDto verifyResponseDto = this.clientCryptoManagerService.jwtVerify(jwtSignatureVerifyRequestDto); + JWTSignatureVerifyResponseDto verifyResponseDto = this.clientCryptoManagerService + .jwtVerify(jwtSignatureVerifyRequestDto); return verifyResponseDto.isSignatureValid(); } diff --git a/lib/platform_android/document_category_impl.dart b/lib/platform_android/document_category_impl.dart index 511623563..5a6805216 100644 --- a/lib/platform_android/document_category_impl.dart +++ b/lib/platform_android/document_category_impl.dart @@ -5,12 +5,12 @@ import 'package:registration_client/platform_spi/document_category_service.dart' class DocumentCategoryImpl implements DocumentCategory { @override - Future> getDocumentCategories(String categoryCode, String langCode) async{ + Future> getDocumentCategories(String categoryCode, String langCode, List languages) async{ List documentValuesList = []; try { documentValuesList = await DocumentCategoryApi() - .getDocumentCategories(categoryCode,langCode); + .getDocumentCategories(categoryCode, langCode, languages); } on PlatformException { debugPrint('DynamicServiceResponseApi call failed!'); } catch (e) { diff --git a/lib/platform_spi/document_category_service.dart b/lib/platform_spi/document_category_service.dart index a64bea85c..f890a47a5 100644 --- a/lib/platform_spi/document_category_service.dart +++ b/lib/platform_spi/document_category_service.dart @@ -1,7 +1,7 @@ import 'package:registration_client/platform_android/document_category_impl.dart'; abstract class DocumentCategory { - Future> getDocumentCategories(String categoryCode,String langCode); + Future> getDocumentCategories(String categoryCode, String langCode, List languages); Future getDocumentSize(); diff --git a/lib/provider/registration_task_provider.dart b/lib/provider/registration_task_provider.dart index e9ecc431e..a8a7da51d 100644 --- a/lib/provider/registration_task_provider.dart +++ b/lib/provider/registration_task_provider.dart @@ -270,8 +270,8 @@ class RegistrationTaskProvider with ChangeNotifier { } Future> getDocumentType( - String categoryCode, String langCode) async { - return await documentCategory.getDocumentCategories(categoryCode, langCode); + String categoryCode, String langCode, List languages) async { + return await documentCategory.getDocumentCategories(categoryCode, langCode, languages); } removeDocumentField(String fieldId) async { diff --git a/lib/ui/process_ui/widgets/document_upload_control.dart b/lib/ui/process_ui/widgets/document_upload_control.dart index 32465d366..78d067b40 100644 --- a/lib/ui/process_ui/widgets/document_upload_control.dart +++ b/lib/ui/process_ui/widgets/document_upload_control.dart @@ -110,7 +110,14 @@ class _DocumentUploadControlState extends State { _removeExceptionData(widget.field); getScannedDocuments(widget.field); myGetDocumentCategoryFuture = - _getDocumentType(widget.field.subType!, "eng"); + _getDocumentType( + widget.field.subType!, + globalProvider.chosenLang.isNotEmpty + ? globalProvider.langToCode(globalProvider.chosenLang.first) + : "eng", + globalProvider.chosenLang + .map((value) => globalProvider.langToCode(value)) + .toList()); _fetchMaxFileSize(); } @@ -349,10 +356,10 @@ class _DocumentUploadControlState extends State { } Future> _getDocumentType( - String categoryCode, String langCode) async { + String categoryCode, String langCode, List languages) async { return await context .read() - .getDocumentType(categoryCode, langCode); + .getDocumentType(categoryCode, langCode, languages); } void _deleteImage(Field e, Uint8List? item) async { diff --git a/pigeon/document_category.dart b/pigeon/document_category.dart index 0208d0811..03b2dad88 100644 --- a/pigeon/document_category.dart +++ b/pigeon/document_category.dart @@ -4,7 +4,7 @@ import 'package:pigeon/pigeon.dart'; @HostApi() abstract class DocumentCategoryApi { @async - List getDocumentCategories(String categoryCode,String langCode); + List getDocumentCategories(String categoryCode,String langCode,List languages); @async String getDocumentSize(); From 84c1cdcb7b71085b448699c82b7cce1aa89b9a48 Mon Sep 17 00:00:00 2001 From: Madhuravas reddy Date: Mon, 2 Mar 2026 18:34:33 +0530 Subject: [PATCH 11/14] RCF-1242 fixed device settings page alignment issue (#702) * fixed device settings page alignment issue Signed-off-by: Madhuravas reddy * removed print log Signed-off-by: Madhuravas reddy * RCF-1242 resolved alignemnt issue in device settings page Signed-off-by: Madhuravas reddy * Resolved review comments Signed-off-by: Madhuravas reddy * Resolved review comments Signed-off-by: Madhuravas reddy --------- Signed-off-by: Madhuravas reddy Signed-off-by: damodarguru --- assets/l10n/app_ar.arb | 4 +- assets/l10n/app_en.arb | 4 +- assets/l10n/app_fr.arb | 4 +- assets/l10n/app_hi.arb | 4 +- assets/l10n/app_kn.arb | 4 +- assets/l10n/app_ta.arb | 4 +- .../widgets/device_settings_tab.dart | 112 ++++++++++++------ 7 files changed, 91 insertions(+), 45 deletions(-) diff --git a/assets/l10n/app_ar.arb b/assets/l10n/app_ar.arb index ea3b883ed..c3b216ae3 100644 --- a/assets/l10n/app_ar.arb +++ b/assets/l10n/app_ar.arb @@ -366,6 +366,8 @@ "sync_restart_button": "إعادة التشغيل", "app_restart_message": "تم حفظ التكوين بنجاح. جارٍ إعادة تشغيل التطبيق...", "select_option": "اختر خياراً", - "cron_expression": "تعبير كرون" + "cron_expression": "تعبير كرون", + "id": "بطاقة تعريف", + "name": "اسم" } diff --git a/assets/l10n/app_en.arb b/assets/l10n/app_en.arb index 1b82dcb83..0012c53a8 100644 --- a/assets/l10n/app_en.arb +++ b/assets/l10n/app_en.arb @@ -366,5 +366,7 @@ "sync_restart_button": "Restart", "app_restart_message": "Configuration saved successfully. Restarting app...", "select_option": "Select Option", - "cron_expression": "Cron Expression" + "cron_expression": "Cron Expression", + "id": "ID", + "name": "Name" } diff --git a/assets/l10n/app_fr.arb b/assets/l10n/app_fr.arb index 034cc9cc0..4935d2571 100644 --- a/assets/l10n/app_fr.arb +++ b/assets/l10n/app_fr.arb @@ -366,6 +366,8 @@ "sync_restart_button": "Redémarrer", "app_restart_message": "Configuration enregistrée avec succès. Redémarrage de l'application...", "select_option": "Sélectionner une option", - "cron_expression": "Expression Cron" + "cron_expression": "Expression Cron", + "id": "IDENTIFIANT", + "name": "Nom" } diff --git a/assets/l10n/app_hi.arb b/assets/l10n/app_hi.arb index 3e186d2c0..fc09a47e3 100644 --- a/assets/l10n/app_hi.arb +++ b/assets/l10n/app_hi.arb @@ -366,5 +366,7 @@ "sync_restart_button": "पुनः आरंभ करें", "app_restart_message": "कॉन्फ़िगरेशन सफलतापूर्वक सहेजा गया. ऐप पुनः प्रारंभ हो रहा है...", "select_option": "विकल्प चुनें", - "cron_expression": "क्रोन एक्सप्रेशन" + "cron_expression": "क्रोन एक्सप्रेशन", + "id": "आईडी", + "name": "नाम" } diff --git a/assets/l10n/app_kn.arb b/assets/l10n/app_kn.arb index ac7ceb1fb..29bc909f3 100644 --- a/assets/l10n/app_kn.arb +++ b/assets/l10n/app_kn.arb @@ -366,5 +366,7 @@ "sync_restart_button": "ಮರುಪ್ರಾರಂಭ", "app_restart_message": "ಕಾನ್ಫಿಗರೇಶನ್ ಯಶಸ್ವಿಯಾಗಿ ಉಳಿಸಲಾಗಿದೆ. ಅಪ್ಲಿಕೇಶನ್ ಅನ್ನು ಮರುಪ್ರಾರಂಭಿಸಲಾಗುತ್ತಿದೆ...", "select_option": "ಆಯ್ಕೆಯನ್ನು ಆರಿಸಿ", - "cron_expression": "ಕ್ರಾನ್ ಎಕ್ಸ್‌ಪ್ರೆಶನ್" + "cron_expression": "ಕ್ರಾನ್ ಎಕ್ಸ್‌ಪ್ರೆಶನ್", + "id": "ID", + "name": "ಹೆಸರು" } diff --git a/assets/l10n/app_ta.arb b/assets/l10n/app_ta.arb index 1238445a1..12ecdf7a2 100644 --- a/assets/l10n/app_ta.arb +++ b/assets/l10n/app_ta.arb @@ -375,5 +375,7 @@ "sync_restart_button": "மறுதொடக்கம்", "app_restart_message": "உள்ளமைவு வெற்றிகரமாக சேமிக்கப்பட்டது. பயன்பாட்டை மறுதொடக்கம் செய்கிறது...", "select_option": "விருப்பத்தைத் தேர்ந்தெடுக்கவும்", - "cron_expression": "கிரான் வெளிப்பாடு" + "cron_expression": "கிரான் வெளிப்பாடு", + "id": "ஐடி", + "name": "பெயர்" } diff --git a/lib/ui/process_ui/widgets/device_settings_tab.dart b/lib/ui/process_ui/widgets/device_settings_tab.dart index fadd11b9c..79fc86491 100644 --- a/lib/ui/process_ui/widgets/device_settings_tab.dart +++ b/lib/ui/process_ui/widgets/device_settings_tab.dart @@ -120,47 +120,81 @@ class _DeviceSettingsTabState extends State { ], ), ) - : GridView.builder( - itemCount: devices.length, - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - crossAxisSpacing: 16, - mainAxisSpacing: 16, - childAspectRatio: 3.5, - ), - itemBuilder: (context, index) { - final device = devices[index]; - return Container( - padding: const EdgeInsets.all(8), - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.shade300), - borderRadius: BorderRadius.circular(8), + : LayoutBuilder( + builder: (context, constraints) { + // Responsive grid: 1 column for mobile (<600), 2 for tablet (<800), 3 for desktop + final crossAxisCount = constraints.maxWidth < 600 + ? 1 + : constraints.maxWidth < 800 + ? 2 + : 3; + // Adjust aspect ratio based on screen size - allow more height on mobile + final childAspectRatio = + constraints.maxWidth < 600 ? 4.0 : 3.5; + + return GridView.builder( + itemCount: devices.length, + gridDelegate: + SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: crossAxisCount, + crossAxisSpacing: 16, + mainAxisSpacing: 16, + childAspectRatio: childAspectRatio, ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Icon(Icons.scanner, size: 25, color: solidPrimary), - const SizedBox(width: 10), - Flexible( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Text("ID: ${device.deviceId ?? ''}", - style: const TextStyle(fontSize: 12)), - Text( - "Name: ${device.deviceName ?? ''}", - style: const TextStyle(fontSize: 12)), - Text( - "Status: ${device.connectionStatus ?? ''}", - style: const TextStyle(fontSize: 12)), - ], - ), + itemBuilder: (context, index) { + final device = devices[index]; + return Container( + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey.shade300), + borderRadius: BorderRadius.circular(8), ), - ], - ), + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Icon(Icons.scanner, + size: 25, color: solidPrimary), + const SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + "${AppLocalizations.of(context)!.id}: ${device.deviceId ?? ''}", + style: const TextStyle( + fontSize: 12), + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + const SizedBox(height: 4), + Text( + "${AppLocalizations.of(context)!.name}: ${device.deviceName ?? ''}", + style: const TextStyle( + fontSize: 12), + overflow: TextOverflow.ellipsis, + maxLines: 2, + ), + const SizedBox(height: 4), + Text( + "${AppLocalizations.of(context)!.status}: ${device.connectionStatus ?? ''}", + style: const TextStyle( + fontSize: 12), + overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ], + ), + ), + ], + ), + ); + }, ); }, ), From dbff127b80cffcc35a1fa0b4c63340fb342752b7 Mon Sep 17 00:00:00 2001 From: damodarguru Date: Tue, 3 Mar 2026 19:00:52 +0530 Subject: [PATCH 12/14] MOSIP-44534-ARC: Refactored report and added Known Issue support in Emailable Report. Signed-off-by: damodarguru --- .../kannada/DocumentuploadPageKannada.java | 239 ------------------ .../pages/tamil/DocumentuploadPageTamil.java | 238 ----------------- 2 files changed, 477 deletions(-) delete mode 100644 ui-test/src/main/java/regclient/pages/kannada/DocumentuploadPageKannada.java delete mode 100644 ui-test/src/main/java/regclient/pages/tamil/DocumentuploadPageTamil.java diff --git a/ui-test/src/main/java/regclient/pages/kannada/DocumentuploadPageKannada.java b/ui-test/src/main/java/regclient/pages/kannada/DocumentuploadPageKannada.java deleted file mode 100644 index 6bbd5b2a6..000000000 --- a/ui-test/src/main/java/regclient/pages/kannada/DocumentuploadPageKannada.java +++ /dev/null @@ -1,239 +0,0 @@ -package regclient.pages.kannada; - -import static org.testng.Assert.assertTrue; - -import java.util.List; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import io.appium.java_client.AppiumDriver; -import io.appium.java_client.MobileBy; -import io.appium.java_client.pagefactory.AndroidFindBy; -import regclient.api.FetchUiSpec; -import regclient.page.BiometricDetailsPage; -import regclient.page.CameraPage; -import regclient.page.DocumentUploadPage; -import regclient.pages.english.BiometricDetailsPageEnglish; -import regclient.pages.english.DocumentUploadPageEnglish; - -public class DocumentUploadPageKannada extends DocumentUploadPage { - - @AndroidFindBy(accessibility = "ಸ್ಕ್ರಿಮ್") - private WebElement PopUpCloseButton; - - @AndroidFindBy(accessibility = "ಹಿಂತಿರುಗಿ") - private WebElement backButton; - - @AndroidFindBy(accessibility = "ಮುಂದುವರಿಸಿ") - private WebElement continueButton; - - @AndroidFindBy(accessibility = "ಅಳಿಸಿ") - private WebElement deleteButton; - - @AndroidFindBy(xpath = "//android.widget.ImageView") - private WebElement captureImage; - - @AndroidFindBy(accessibility = "ಉಳಿಸಿ") - private WebElement saveButton; - - @AndroidFindBy(accessibility = "ರೀಟೇಕ್") - private WebElement retakeButton; - - @AndroidFindBy(uiAutomator = "UiSelector().className(\"android.view.View\").instance(8)") - private WebElement imageleftCorner; - - public DocumentUploadPageKannada(AppiumDriver driver) { - super(driver); - } - - public BiometricDetailsPage clickOnContinueButton() { - clickOnElement(continueButton); - return new BiometricDetailsPageKannada(driver); - } - - @SuppressWarnings("deprecation") - public boolean isDoccumentUploadPageDisplayed() { - return isElementDisplayed(findElementWithRetry(MobileBy.AndroidUIAutomator( - "new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().descriptionContains(\"" - + FetchUiSpec.getScreenTitle("Documents") + "\"))"))); - } - - public DocumentUploadPage clickOnSaveButton() { - clickOnElement(saveButton); - return new DocumentUploadPageKannada(driver); - } - - public boolean isRetakeButtonDisplayed() { - return isElementDisplayed(retakeButton); - } - - public void cropCaptureImage() { - isElementDisplayed(captureImage); - cropCaptureImage(imageleftCorner); - } - - public void uploadDoccuments(String age, String type) { - List idList = FetchUiSpec.getAllIds("Documents"); - for (String id : idList) { - if (FetchUiSpec.getRequiredTypeUsingId(id)) { - if (type.equalsIgnoreCase("ReferenceNumber")) { - clickAndsendKeysToTextBox( - findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.EditText")), - "1234567890"); - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { - swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - } - clickOnElement(PopUpCloseButton); - waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); - cameraPage.clickimage(); - cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); - cropCaptureImage(); - clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(), - "Verify if doccumentupload page is displayed after upload of " - + FetchUiSpec.getValueUsingId(id)); - } else { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { - swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - } - clickOnElement(PopUpCloseButton); - waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); - cameraPage.clickimage(); - cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); - cropCaptureImage(); - clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(), - "Verify if doccumentupload page is displayed after upload of " - + FetchUiSpec.getValueUsingId(id)); - } - } - if (id.equals("proofOfRelationship")) { - if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { - swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - } - clickOnElement(PopUpCloseButton); - waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); - cameraPage.clickimage(); - cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); - cropCaptureImage(); - clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(), - "Verify if doccumentupload page is displayed after upload of " - + FetchUiSpec.getValueUsingId(id)); - } - } - } - - } - - public void uploadDoccumentsUpdate(String age, String type) { - List idList = FetchUiSpec.getAllIds("Documents"); - for (String id : idList) { - if (type.equals("all") && !id.equals("proofOfException") && !id.equals("proofOfRelationship")) { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { - swipeOrScroll(); - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - } - clickOnElement(PopUpCloseButton); - waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); - cameraPage.clickimage(); - cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); - cropCaptureImage(); - clickOnSaveButton(); - } - if (id.equals("proofOfRelationship")) { - if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { - swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - } - clickOnElement(PopUpCloseButton); - waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); - cameraPage.clickimage(); - cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); - cropCaptureImage(); - clickOnSaveButton(); - } - } - - } - } - -} diff --git a/ui-test/src/main/java/regclient/pages/tamil/DocumentuploadPageTamil.java b/ui-test/src/main/java/regclient/pages/tamil/DocumentuploadPageTamil.java deleted file mode 100644 index f9358e8ee..000000000 --- a/ui-test/src/main/java/regclient/pages/tamil/DocumentuploadPageTamil.java +++ /dev/null @@ -1,238 +0,0 @@ -package regclient.pages.tamil; - -import static org.testng.Assert.assertTrue; - -import java.util.List; - -import org.openqa.selenium.By; -import org.openqa.selenium.WebElement; - -import io.appium.java_client.AppiumDriver; -import io.appium.java_client.MobileBy; -import io.appium.java_client.pagefactory.AndroidFindBy; -import regclient.api.FetchUiSpec; -import regclient.page.BiometricDetailsPage; -import regclient.page.CameraPage; -import regclient.page.DocumentUploadPage; -import regclient.pages.english.BiometricDetailsPageEnglish; -import regclient.pages.english.DocumentUploadPageEnglish; - -public class DocumentUploadPageTamil extends DocumentUploadPage { - - @AndroidFindBy(accessibility = "ஸ்க்ரிம்") - private WebElement PopUpCloseButton; - - @AndroidFindBy(accessibility = "முந்தைய பக்கம்") - private WebElement backButton; - - @AndroidFindBy(accessibility = "தொடர்க") - private WebElement continueButton; - - @AndroidFindBy(accessibility = "அழி") - private WebElement deleteButton; - - @AndroidFindBy(xpath = "//android.widget.ImageView") - private WebElement captureImage; - - @AndroidFindBy(accessibility = "சேமிக்கவும்") - private WebElement saveButton; - - @AndroidFindBy(accessibility = "ரீடேக்") - private WebElement retakeButton; - - @AndroidFindBy(uiAutomator = "UiSelector().className(\"android.view.View\").instance(8)") - private WebElement imageleftCorner; - - public DocumentUploadPageTamil(AppiumDriver driver) { - super(driver); - } - - public BiometricDetailsPage clickOnContinueButton() { - clickOnElement(continueButton); - return new BiometricDetailsPageTamil(driver); - } - - @SuppressWarnings("deprecation") - public boolean isDoccumentUploadPageDisplayed() { - return isElementDisplayed(findElementWithRetry(MobileBy.AndroidUIAutomator( - "new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().descriptionContains(\"" - + FetchUiSpec.getScreenTitle("Documents") + "\"))"))); - } - - public DocumentUploadPage clickOnSaveButton() { - clickOnElement(saveButton); - return new DocumentUploadPageTamil(driver); - } - - public boolean isRetakeButtonDisplayed() { - return isElementDisplayed(retakeButton); - } - - public void cropCaptureImage() { - isElementDisplayed(captureImage); - cropCaptureImage(imageleftCorner); - } - - public void uploadDoccuments(String age, String type) { - List idList = FetchUiSpec.getAllIds("Documents"); - for (String id : idList) { - if (FetchUiSpec.getRequiredTypeUsingId(id)) { - if (type.equalsIgnoreCase("ReferenceNumber")) { - clickAndsendKeysToTextBox( - findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.EditText")), - "1234567890"); - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { - swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - } - clickOnElement(PopUpCloseButton); - waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); - cameraPage.clickimage(); - cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); - cropCaptureImage(); - clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(), - "Verify if doccumentupload page is displayed after upload of " - + FetchUiSpec.getValueUsingId(id)); - } else { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { - swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - } - clickOnElement(PopUpCloseButton); - waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); - cameraPage.clickimage(); - cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); - cropCaptureImage(); - clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(), - "Verify if doccumentupload page is displayed after upload of " - + FetchUiSpec.getValueUsingId(id)); - } - } - if (id.equals("proofOfRelationship")) { - if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { - swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - } - clickOnElement(PopUpCloseButton); - waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); - cameraPage.clickimage(); - cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); - cropCaptureImage(); - clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(), - "Verify if doccumentupload page is displayed after upload of " - + FetchUiSpec.getValueUsingId(id)); - } - } - } - - } - - public void uploadDoccumentsUpdate(String age, String type) { - List idList = FetchUiSpec.getAllIds("Documents"); - for (String id : idList) { - if (type.equals("all") && !id.equals("proofOfException") && !id.equals("proofOfRelationship")) { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { - swipeOrScroll(); - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - } - clickOnElement(PopUpCloseButton); - waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); - cameraPage.clickimage(); - cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); - cropCaptureImage(); - clickOnSaveButton(); - } - if (id.equals("proofOfRelationship")) { - if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { - swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - } - clickOnElement(PopUpCloseButton); - waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); - cameraPage.clickimage(); - cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); - cropCaptureImage(); - clickOnSaveButton(); - } - } - - } - } -} From c21001a955cdb45f085d96e7a34dedc610ca4f60 Mon Sep 17 00:00:00 2001 From: damodarguru Date: Tue, 3 Mar 2026 20:49:22 +0530 Subject: [PATCH 13/14] MOSIP-44534-ARC: Refactored report and added Known Issue support in Emailable Report. Signed-off-by: damodarguru --- .../kannada/DocumentUploadPageKannada.java | 184 +++++++----------- .../pages/tamil/DocumentUploadPageTamil.java | 179 ++++++----------- 2 files changed, 127 insertions(+), 236 deletions(-) diff --git a/ui-test/src/main/java/regclient/pages/kannada/DocumentUploadPageKannada.java b/ui-test/src/main/java/regclient/pages/kannada/DocumentUploadPageKannada.java index 6bbd5b2a6..6a7051899 100644 --- a/ui-test/src/main/java/regclient/pages/kannada/DocumentUploadPageKannada.java +++ b/ui-test/src/main/java/regclient/pages/kannada/DocumentUploadPageKannada.java @@ -17,7 +17,8 @@ import regclient.pages.english.BiometricDetailsPageEnglish; import regclient.pages.english.DocumentUploadPageEnglish; -public class DocumentUploadPageKannada extends DocumentUploadPage { + +public class DocumentUploadPageKannada extends DocumentUploadPage{ @AndroidFindBy(accessibility = "ಸ್ಕ್ರಿಮ್") private WebElement PopUpCloseButton; @@ -33,7 +34,7 @@ public class DocumentUploadPageKannada extends DocumentUploadPage { @AndroidFindBy(xpath = "//android.widget.ImageView") private WebElement captureImage; - + @AndroidFindBy(accessibility = "ಉಳಿಸಿ") private WebElement saveButton; @@ -46,20 +47,18 @@ public class DocumentUploadPageKannada extends DocumentUploadPage { public DocumentUploadPageKannada(AppiumDriver driver) { super(driver); } - - public BiometricDetailsPage clickOnContinueButton() { + + public BiometricDetailsPage clickOnContinueButton() { clickOnElement(continueButton); return new BiometricDetailsPageKannada(driver); } @SuppressWarnings("deprecation") public boolean isDoccumentUploadPageDisplayed() { - return isElementDisplayed(findElementWithRetry(MobileBy.AndroidUIAutomator( - "new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().descriptionContains(\"" - + FetchUiSpec.getScreenTitle("Documents") + "\"))"))); + return isElementDisplayed(findElementWithRetry(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().descriptionContains(\"" + FetchUiSpec.getScreenTitle("Documents") + "\"))"))); } - public DocumentUploadPage clickOnSaveButton() { + public DocumentUploadPage clickOnSaveButton() { clickOnElement(saveButton); return new DocumentUploadPageKannada(driver); } @@ -73,161 +72,108 @@ public void cropCaptureImage() { cropCaptureImage(imageleftCorner); } - public void uploadDoccuments(String age, String type) { - List idList = FetchUiSpec.getAllIds("Documents"); - for (String id : idList) { - if (FetchUiSpec.getRequiredTypeUsingId(id)) { - if (type.equalsIgnoreCase("ReferenceNumber")) { - clickAndsendKeysToTextBox( - findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.EditText")), - "1234567890"); - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + public void uploadDoccuments(String age,String type) { + List idList=FetchUiSpec.getAllIds("Documents"); + for(String id : idList) { + if(FetchUiSpec.getRequiredTypeUsingId(id)) { + if(type.equalsIgnoreCase("ReferenceNumber")) { + clickAndsendKeysToTextBox(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.EditText")),"1234567890"); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + if(!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage=new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(), - "Verify if doccumentupload page is displayed after upload of " - + FetchUiSpec.getValueUsingId(id)); - } else { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + assertTrue(isDoccumentUploadPageDisplayed(),"Verify if doccumentupload page is displayed after upload of "+FetchUiSpec.getValueUsingId(id)); + }else { + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + if(!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage=new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(), - "Verify if doccumentupload page is displayed after upload of " - + FetchUiSpec.getValueUsingId(id)); + assertTrue(isDoccumentUploadPageDisplayed(),"Verify if doccumentupload page is displayed after upload of "+FetchUiSpec.getValueUsingId(id)); } - } - if (id.equals("proofOfRelationship")) { - if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + }if(id.equals("proofOfRelationship")) { + if(age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + if(!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage=new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(), - "Verify if doccumentupload page is displayed after upload of " - + FetchUiSpec.getValueUsingId(id)); + assertTrue(isDoccumentUploadPageDisplayed(),"Verify if doccumentupload page is displayed after upload of "+FetchUiSpec.getValueUsingId(id)); } } } } - - public void uploadDoccumentsUpdate(String age, String type) { - List idList = FetchUiSpec.getAllIds("Documents"); - for (String id : idList) { - if (type.equals("all") && !id.equals("proofOfException") && !id.equals("proofOfRelationship")) { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + public void uploadDoccumentsUpdate(String age,String type) { + List idList=FetchUiSpec.getAllIds("Documents"); + for(String id : idList) { + if(type.equals("all") && !id.equals("proofOfException") && !id.equals("proofOfRelationship")) { + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + if(!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage=new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - } - if (id.equals("proofOfRelationship")) { - if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + }if(id.equals("proofOfRelationship")) { + if(age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + if(!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage=new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); } diff --git a/ui-test/src/main/java/regclient/pages/tamil/DocumentUploadPageTamil.java b/ui-test/src/main/java/regclient/pages/tamil/DocumentUploadPageTamil.java index f9358e8ee..fbdadbbf3 100644 --- a/ui-test/src/main/java/regclient/pages/tamil/DocumentUploadPageTamil.java +++ b/ui-test/src/main/java/regclient/pages/tamil/DocumentUploadPageTamil.java @@ -33,7 +33,7 @@ public class DocumentUploadPageTamil extends DocumentUploadPage { @AndroidFindBy(xpath = "//android.widget.ImageView") private WebElement captureImage; - + @AndroidFindBy(accessibility = "சேமிக்கவும்") private WebElement saveButton; @@ -47,19 +47,17 @@ public DocumentUploadPageTamil(AppiumDriver driver) { super(driver); } - public BiometricDetailsPage clickOnContinueButton() { + public BiometricDetailsPage clickOnContinueButton() { clickOnElement(continueButton); return new BiometricDetailsPageTamil(driver); } @SuppressWarnings("deprecation") public boolean isDoccumentUploadPageDisplayed() { - return isElementDisplayed(findElementWithRetry(MobileBy.AndroidUIAutomator( - "new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().descriptionContains(\"" - + FetchUiSpec.getScreenTitle("Documents") + "\"))"))); + return isElementDisplayed(findElementWithRetry(MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().descriptionContains(\"" + FetchUiSpec.getScreenTitle("Documents") + "\"))"))); } - public DocumentUploadPage clickOnSaveButton() { + public DocumentUploadPage clickOnSaveButton() { clickOnElement(saveButton); return new DocumentUploadPageTamil(driver); } @@ -73,161 +71,108 @@ public void cropCaptureImage() { cropCaptureImage(imageleftCorner); } - public void uploadDoccuments(String age, String type) { - List idList = FetchUiSpec.getAllIds("Documents"); - for (String id : idList) { - if (FetchUiSpec.getRequiredTypeUsingId(id)) { - if (type.equalsIgnoreCase("ReferenceNumber")) { - clickAndsendKeysToTextBox( - findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.EditText")), - "1234567890"); - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + public void uploadDoccuments(String age,String type) { + List idList=FetchUiSpec.getAllIds("Documents"); + for(String id : idList) { + if(FetchUiSpec.getRequiredTypeUsingId(id)) { + if(type.equalsIgnoreCase("ReferenceNumber")) { + clickAndsendKeysToTextBox(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.EditText")),"1234567890"); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + if(!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage=new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(), - "Verify if doccumentupload page is displayed after upload of " - + FetchUiSpec.getValueUsingId(id)); - } else { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + assertTrue(isDoccumentUploadPageDisplayed(),"Verify if doccumentupload page is displayed after upload of "+FetchUiSpec.getValueUsingId(id)); + }else { + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + if(!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage=new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(), - "Verify if doccumentupload page is displayed after upload of " - + FetchUiSpec.getValueUsingId(id)); + assertTrue(isDoccumentUploadPageDisplayed(),"Verify if doccumentupload page is displayed after upload of "+FetchUiSpec.getValueUsingId(id)); } - } - if (id.equals("proofOfRelationship")) { - if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + }if(id.equals("proofOfRelationship")) { + if(age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + if(!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage=new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - assertTrue(isDoccumentUploadPageDisplayed(), - "Verify if doccumentupload page is displayed after upload of " - + FetchUiSpec.getValueUsingId(id)); + assertTrue(isDoccumentUploadPageDisplayed(),"Verify if doccumentupload page is displayed after upload of "+FetchUiSpec.getValueUsingId(id)); } } } } - - public void uploadDoccumentsUpdate(String age, String type) { - List idList = FetchUiSpec.getAllIds("Documents"); - for (String id : idList) { - if (type.equals("all") && !id.equals("proofOfException") && !id.equals("proofOfRelationship")) { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + public void uploadDoccumentsUpdate(String age,String type) { + List idList=FetchUiSpec.getAllIds("Documents"); + for(String id : idList) { + if(type.equals("all") && !id.equals("proofOfException") && !id.equals("proofOfRelationship")) { + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + if(!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage=new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); - } - if (id.equals("proofOfRelationship")) { - if (age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { - clickOnElement(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); - if (!isElementDisplayedOnScreen(PopUpCloseButton)) { + }if(id.equals("proofOfRelationship")) { + if(age.equals("minor") || age.equals("infant") || age.equals("currentCalenderDate")) { + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); + if(!isElementDisplayedOnScreen(PopUpCloseButton)) { swipeOrScroll(); - clickOnElement(findElementWithRetry(By.xpath( - "//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View"))); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View"))); } clickOnElement(PopUpCloseButton); waitTime(1); - boolean isEnabled = isElementEnabled(findElementWithRetry( - By.xpath("//android.view.View[contains(@content-desc, \"" + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - assertTrue(isEnabled, "Verify if scan button enabled for " + FetchUiSpec.getValueUsingId(id)); - clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \"" - + FetchUiSpec.getValueUsingId(id) - + "\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); - CameraPage cameraPage = new CameraPage(driver); + boolean isEnabled = isElementEnabled(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + assertTrue(isEnabled,"Verify if scan button enabled for "+FetchUiSpec.getValueUsingId(id)); + clickOnElement(findElementWithRetry(By.xpath("//android.view.View[contains(@content-desc, \""+FetchUiSpec.getValueUsingId(id)+"\")]/parent::android.view.View/parent::android.view.View/following-sibling::android.widget.Button"))); + CameraPage cameraPage=new CameraPage(driver); cameraPage.clickimage(); cameraPage.clickOkButton(); - assertTrue(isRetakeButtonDisplayed(), "Verify if retake button displayed"); + assertTrue(isRetakeButtonDisplayed(),"Verify if retake button displayed"); cropCaptureImage(); clickOnSaveButton(); } From 6588efbb90b160af7c84f9fbf61760bb5284d72d Mon Sep 17 00:00:00 2001 From: damodarguru Date: Wed, 4 Mar 2026 01:46:24 +0530 Subject: [PATCH 14/14] MOSIP-44534-ARC: Refactored report and added Known Issue support in Emailable Report. Signed-off-by: damodarguru --- .../pages/english/PreviewPageEnglish.java | 63 +++++++++++-------- .../java/regclient/utils/EmailableReport.java | 9 +-- 2 files changed, 39 insertions(+), 33 deletions(-) diff --git a/ui-test/src/main/java/regclient/pages/english/PreviewPageEnglish.java b/ui-test/src/main/java/regclient/pages/english/PreviewPageEnglish.java index b6d1fa01f..4054a0de5 100644 --- a/ui-test/src/main/java/regclient/pages/english/PreviewPageEnglish.java +++ b/ui-test/src/main/java/regclient/pages/english/PreviewPageEnglish.java @@ -64,36 +64,45 @@ public AuthenticationPage clickOnContinueButton() { clickOnElement(continueButton); return new AuthenticationPageEnglish(driver); } - + public boolean isDemographicInformationInPreviewPageDisplayed() { try { - scrollToText("Demographic Information"); - WebElement demographicInformationInPreviewPage = driver - .findElement(MobileBy.AndroidUIAutomator("new UiSelector().text(\"Demographic Information\")")); - return isElementDisplayed(demographicInformationInPreviewPage); + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + + By locator = MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true))" + + ".scrollIntoView(new UiSelector().text(\"Demographic Information\"))"); + + wait.until(ExpectedConditions.visibilityOfElementLocated(locator)); + + return true; + } catch (Exception e) { return false; } } - + public boolean isDocumentsInformationInPreviewPageDisplayed() { - try { - WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); - wait.until(ExpectedConditions.visibilityOf(documentsInformationInPreviewPage)); + try { + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + wait.until(ExpectedConditions.visibilityOf(documentsInformationInPreviewPage)); - scrollToText("Documents"); + scrollToText("Documents"); - return isElementDisplayed(documentsInformationInPreviewPage); + return isElementDisplayed(documentsInformationInPreviewPage); - } catch (Exception e) { - return false; - } + } catch (Exception e) { + return false; + } } public boolean isBiometricsInformationInPreviewPagePageDisplayed() { try { + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + wait.until(ExpectedConditions.visibilityOf(biometricsInformationInPreviewPage)); scrollToText("Biometrics"); + return isElementDisplayed(biometricsInformationInPreviewPage); + } catch (Exception e) { return false; } @@ -114,21 +123,25 @@ public boolean updateUINTitleDisplayed() { } public boolean isBiometricCorrectionTitleDisplayed() { - try { - driver.findElement(MobileBy.AndroidUIAutomator( - "new UiScrollable(new UiSelector().scrollable(true))" + - ".scrollIntoView(new UiSelector().description(\"Biometric correction\"))" - )); - return true; - } catch (Exception e) { - return false; - } + try { + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + wait.until(ExpectedConditions.visibilityOfElementLocated( + MobileBy.AndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true))" + + ".scrollIntoView(new UiSelector().description(\"Biometric correction\"))"))); + + return true; + + } catch (Exception e) { + return false; + } } public boolean isApplicationIDPreviewPagePageDisplayed() { try { - waitTime(1); - return isElementDisplayed(applicationIDPreviewPage); + scrollToText("Application ID"); + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); + wait.until(ExpectedConditions.visibilityOf(applicationIDPreviewPage)); + return true; } catch (Exception e) { return false; } diff --git a/ui-test/src/main/java/regclient/utils/EmailableReport.java b/ui-test/src/main/java/regclient/utils/EmailableReport.java index 82cd54d81..dcc49fb75 100644 --- a/ui-test/src/main/java/regclient/utils/EmailableReport.java +++ b/ui-test/src/main/java/regclient/utils/EmailableReport.java @@ -234,7 +234,6 @@ protected void writeSuiteSummary() { totalPassedTests += testResult.getPassedTestCount(); totalSkippedTests += testResult.getSkippedTestCount(); totalFailedTests += testResult.getFailedTestCount(); - totalIgnoredTests += testResult.getIgnoredTestCount(); totalKnownIssueTests += testResult.getKnownIssueTestCount(); totalDuration += testResult.getDuration(); } @@ -281,7 +280,7 @@ protected void writeSuiteSummary() { // Values row (colored bars) writer.print(""); writer.print("" + integerFormat.format( - totalPassedTests + totalFailedTests + totalSkippedTests + totalKnownIssueTests + totalIgnoredTests) + totalPassedTests + totalFailedTests + totalSkippedTests + totalKnownIssueTests) + ""); writer.print("" + integerFormat.format(totalPassedTests) + ""); // If you have an 'ignored' concept use it; here using 0 placeholder or compute @@ -646,7 +645,6 @@ public int compare(ITestResult o1, ITestResult o2) { private final int skippedTestCount; private final int passedTestCount; private final int knownIssueTestCount; - private final int ignoredTestCount; private final long duration; private final String includedGroups; private final String excludedGroups; @@ -683,7 +681,6 @@ public TestResult(ITestContext context) { skippedTestCount = actualSkippedTests.size(); passedTestCount = passedTests.size(); knownIssueTestCount = knownIssueTests.size(); - ignoredTestCount = context.getExcludedMethods().size(); duration = context.getEndDate().getTime() - context.getStartDate().getTime(); @@ -794,10 +791,6 @@ public int getKnownIssueTestCount() { return knownIssueTestCount; } - public int getIgnoredTestCount() { - return ignoredTestCount; - } - public long getDuration() { return duration; }