Skip to content

RCF-1344: Automation for multilingual support#1090

Closed
damodarguru wants to merge 20 commits into
mosip:developfrom
damodarguru:develop
Closed

RCF-1344: Automation for multilingual support#1090
damodarguru wants to merge 20 commits into
mosip:developfrom
damodarguru:develop

Conversation

@damodarguru

@damodarguru damodarguru commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

RCF-1344: Automation for multilingual support

Summary by CodeRabbit

  • Tests
    • Expanded automated UI tests and added a scenario for offline packet creation; improved reliability of biometric, document upload, and application-filtering flows.
  • New Features
    • Added UI checks for packet size and client-version display; enhanced settings visibility and toast detection.
  • Bug Fixes
    • Improved navigation/scrolling gestures and corrected selection behavior for temporary exception flows and language selection.

damodarguru and others added 19 commits March 26, 2026 09:31
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
…tomation.

Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
…tomation.

Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
…tomation.

Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Standardizes swiping to swipeUp, adds/implements invalid pre-reg handlers, packet-size and client-version checks, biometrics helpers, import cleanup, and registers a new no-network test class in TestRunner/testng.xml across multilingual UI test page objects.

Changes

Multilingual Test Page Object Updates

Layer / File(s) Summary
Arabic: Demographic invalid-AID and dropdown fixes
ui-test/src/main/java/regclient/pages/arabic/DemographicDetailsPageArabic.java
Adds non-foreigner locator, "Application ID does not exist" message and OKAY button locators, implements invalid prereg helpers, and replaces swipeOrScroll() with swipeUp() across dropdowns and validation loops.
Arabic: Document upload, ManageApplications, language/version
ui-test/src/main/java/regclient/pages/arabic/DocumentUploadPageArabic.java, ManageApplicationsPageArabic.java, SelectLanguagePageArabic.java, RegistrationTasksPageArabic.java, LoginPageArabic.java
Document upload adds packet-size detection and pointer-based horizontal swipe helper; ManageApplications adds clear-filter and horizontal scrolling helpers; Arabic language/client-version locators updated.
Arabic: Biometrics & OperationalTask
ui-test/src/main/java/regclient/pages/arabic/*Biometric*.java, OperationalTaskPageArabic.java, PendingApprovalArabic.java
Standardizes fallback gestures to swipeUp(), adds scrollToTop() before scan-title checks, corrects temporary-exception click target, and adds threshold/iris parsing helpers in ApplicantBiometricsPageArabic.
Hindi: Demographic, DocumentUpload, ManageApplications, Settings
ui-test/src/main/java/regclient/pages/hindi/*
Implements invalid-prereg helpers, replaces fallback scrolling with swipeUp() in demographic and document flows, adds isPacketSizeDisplayed(), fleshes out ManageApplications horizontal/clear-filter logic, and implements several Settings/Registration visibility methods.
Kannada: Demographic, DocumentUpload, ManageApplications, Settings (stubs)
ui-test/src/main/java/regclient/pages/kannada/*
Replaces swipeOrScroll() with swipeUp() across flows; adds/overrides packet-size and manage/registration/settings methods as TODO stubs or simple returns.
Tamil: Demographic rework and document/Settings stubs
ui-test/src/main/java/regclient/pages/tamil/*
Removes unused English imports, standardizes swipeUp() usage, reworks remaining-demographic postal handling with retries, and adds packet-size/registration/settings stub overrides.
Shared contracts and tooling
ui-test/src/main/java/regclient/page/DocumentUploadPage.java, ManageApplicationsPage.java, CameraPage.java, ui-test/src/main/java/regclient/utils/TestRunner.java, ui-test/testng.xml
Adds abstract isPacketSizeDisplayed() and new ManageApplications abstract methods; updates CameraPage locators/coordinates; registers new CreatePacketWithoutNetwork test class and includes it in testng.xml.
Import cleanup & test placeholders
multiple ui-test/src/main/java/regclient/pages/* and PreRegFetchingPacket.java
Removes unused English-specific imports, switches many pages to shared regclient.page.* interfaces, and adds commented placeholder code and minor formatting in the prereg test.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • jayesh12234
  • mohanachandran-s
  • anushasunkada

"🐰 In pockets of code I hop and peep,
Scrolling aligned so tests no longer creep,
Packet sizes peek, prereg whispers 'done',
Helpers parse scores — one by one,
The test garden hops toward the sun."

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'RCF-1344: Automation for multilingual support' directly aligns with the main changes in the PR, which involve extensive updates to Arabic, Hindi, Tamil, and Kannada page objects to support multilingual UI automation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 14

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ui-test/src/main/java/regclient/androidTestCases/PreRegFetchingPacket.java`:
- Line 265: The commented assertion uses a misleading message "Verify if
fetchdata button is displayed" while calling
isApplicationIdDoesNotExistMessageDisplay(); update the assertion message to
accurately describe the validation (e.g., "Verify application ID does not exist
error message is displayed") so future uncommenting of the assertion matches the
actual check performed by isApplicationIdDoesNotExistMessageDisplay().

In
`@ui-test/src/main/java/regclient/pages/arabic/DemographicDetailsPageArabic.java`:
- Around line 799-810: The locator for the invalid prereg textbox in
fetchInvalidPreregApplicationId is too strict; replace the appIdTextbox XPath
that uses contains(`@hint`,'Please Enter Application ID') with the same robust
locator pattern used for the valid prereg path (the class-instance based lookup
used around the valid flow), i.e. update the appIdTextbox variable used with
findElementWithRetry and clickAndsendKeysToTextBox so it targets the same
EditText instance pattern as appIdLabel/applicationIdTextBox (refer to
fetchInvalidPreregApplicationId, appIdTextbox, appIdLabel, applicationIdTextBox,
findElementWithRetry for where to change).

In
`@ui-test/src/main/java/regclient/pages/hindi/ApplicantBiometricsPageHindi.java`:
- Around line 274-284: The Hindi page currently has stubbed methods
getThresholdScore() and irisAttemptLeft() returning 0; replace these with the
real implementations used by other locale pages so they return the expected
values (e.g., the same threshold score and the irisAttemptLeft initial value of
2 after first scan). Update ApplicantBiometricsPageHindi.getThresholdScore() and
ApplicantBiometricsPageHindi.irisAttemptLeft() to mirror the non-Hindi
implementation (copy the logic from the existing ApplicantBiometricsPage
implementation used by other locales) so downstream assertions
(NewRegistrationAdult expecting irisAttemptLeft() == 2) pass.

In
`@ui-test/src/main/java/regclient/pages/hindi/DemographicDetailsPageHindi.java`:
- Around line 762-778: The three Hindi overrides currently return false/no-op
and must be implemented to mirror the real behavior in DemographicDetailsPage so
invalid-prereg flows can be tested: implement
isApplicationIdDoesNotExistMessageDisplay to check the Hindi "application id
does not exist" element visibility/text (same locator/validation used by the
base/English implementation), implement fetchInvalidPreregApplicationId(String
prid) to populate the prereg ID input with the provided prid and trigger any
blur/validation event as the base method does, and implement clickOnOkayButton
to find and click the Hindi "Okay" button and wait for the expected post-click
state; if the class already extends or wraps the base DemographicDetailsPage,
delegate to super.isApplicationIdDoesNotExistMessageDisplay(),
super.fetchInvalidPreregApplicationId(prid) and super.clickOnOkayButton()
instead of duplicating logic.

In `@ui-test/src/main/java/regclient/pages/hindi/DocumentUploadPageHindi.java`:
- Around line 187-191: The isPacketSizeDisplayed() in DocumentUploadPageHindi is
incorrectly hardcoded to return false; replace it with the same logic used in
DocumentUploadPageEnglish so it actually checks the UI for the packet-size
badge/element. Update DocumentUploadPageHindi.isPacketSizeDisplayed() to locate
the same element(s) used by DocumentUploadPageEnglish (e.g., the packet-size
badge locator or method that reads size text), verify presence/displayed state
and return that boolean (handling no-such-element exceptions or empty text the
same way the English implementation does) so packet-size validation works in
Hindi pages too.

In
`@ui-test/src/main/java/regclient/pages/hindi/ManageApplicationsPageHindi.java`:
- Around line 272-288: ManageApplicationsPageHindi currently leaves
clickOnClearFilterButton() and scrollTillDisplayingApplicationCountVisible()
unimplemented and returns false from isClientStatusDropdownDisplayed(), breaking
the page contract; implement these methods in the ManageApplicationsPageHindi
class to mirror the behavior of the base/English page (e.g., delegate to
existing implementations or perform the actual UI interactions): implement
clickOnClearFilterButton() to locate and click the clear-filter control,
implement scrollTillDisplayingApplicationCountVisible() to perform the scrolling
logic until the application count element is visible, and implement
isClientStatusDropdownDisplayed() to return the real visibility state of the
client status dropdown (not a hardcoded false) by checking the dropdown
element’s presence/visibility; reference these method names
(clickOnClearFilterButton, scrollTillDisplayingApplicationCountVisible,
isClientStatusDropdownDisplayed) when making the edits.

In `@ui-test/src/main/java/regclient/pages/hindi/RegistrationTasksPageHindi.java`:
- Around line 196-200: The isClientVersionDisplayed() method in
RegistrationTasksPageHindi is stubbed to always return false; replace the
hardcoded return with a real visibility check that queries the client-version UI
element (use the same locator/element used elsewhere in
RegistrationTasksPageHindi or the base RegistrationTasksPage class) and return
its displayed/visible state; if there is a shared helper (e.g., a getElement or
isElementVisible method) use that to implement isClientVersionDisplayed() so it
accurately reflects the UI instead of always failing.

In
`@ui-test/src/main/java/regclient/pages/kannada/DemographicDetailsPageKannada.java`:
- Around line 761-777: The three stub methods in
DemographicDetailsPageKannada—isApplicationIdDoesNotExistMessageDisplay,
fetchInvalidPreregApplicationId, and clickOnOkayButton—must be implemented to
mirror the invalid-PRID behavior in other locale page classes: implement
fetchInvalidPreregApplicationId(prid) to enter the provided PRID into the
Kannada prereg input element and trigger validation (use the same input
selector/submit action used by other DemographicDetailsPage implementations),
implement isApplicationIdDoesNotExistMessageDisplay() to return whether the
Kannada-specific "application id does not exist" error element is
visible/present, and implement clickOnOkayButton() to click the Kannada-specific
OK/dismiss button for that error; use the existing element identifiers or
localized selectors from sibling classes to locate the correct elements and
ensure the methods return/perform the same effects as in other language
implementations.

In
`@ui-test/src/main/java/regclient/pages/kannada/DocumentUploadPageKannada.java`:
- Around line 185-189: Replace the stubbed isPacketSizeDisplayed() in
DocumentUploadPageKannada with a real UI check: locate the packet-size element
(use the same locator/element identifier used in the English implementation) and
return its visibility (element.isDisplayed()) while catching
NoSuchElementException to return false; ensure the method uses the page's
WebDriver instance and mirrors the logic from the English DocumentUploadPage
implementation so behavior is consistent across locales.

In
`@ui-test/src/main/java/regclient/pages/kannada/ManageApplicationsPageKannada.java`:
- Around line 272-288: The three stubbed overrides (clickOnClearFilterButton,
isClientStatusDropdownDisplayed, scrollTillDisplayingApplicationCountVisible)
must be implemented to mirror the base page behavior so the
CreatePacketWithoutNetwork flow's assertions pass; implement
clickOnClearFilterButton to locate and click the Kannada "clear filter" element
(use the same locator/name used in other locale pages), implement
isClientStatusDropdownDisplayed to return the actual visibility state of the
client status dropdown element (e.g., element.isDisplayed() with a safe
null/exception check), and implement scrollTillDisplayingApplicationCountVisible
to programmatically scroll to the application count element (using the existing
scroll helper or JavascriptExecutor) and wait for it to be visible; reference
these methods (clickOnClearFilterButton, isClientStatusDropdownDisplayed,
scrollTillDisplayingApplicationCountVisible) when wiring to the existing
locators/wrappers so the CreatePacketWithoutNetwork flow can assert dropdown
visibility reliably.

In
`@ui-test/src/main/java/regclient/pages/tamil/DemographicDetailsPageTamil.java`:
- Around line 760-776: The three placeholder methods in
DemographicDetailsPageTamil need real UI interactions: implement
isApplicationIdDoesNotExistMessageDisplay() to wait for and return the
visibility/presence of the "application id does not exist" message element (use
the same locator/wait pattern used by other locale pages), implement
fetchInvalidPreregApplicationId(String prid) to populate the prereg input with
the given prid (set the field value and trigger any blur/submit as other locale
implementations do), and implement clickOnOkayButton() to find and click the
OK/confirm button for the invalid-prereg dialog (use existing click/wait helpers
used elsewhere); ensure you reference the page’s element locators and existing
driver/wait utilities in DemographicDetailsPageTamil so behavior matches other
locale implementations.

In `@ui-test/src/main/java/regclient/pages/tamil/DocumentUploadPageTamil.java`:
- Around line 182-186: The isPacketSizeDisplayed() method in
DocumentUploadPageTamil currently returns false unconditionally; replace the
stub with real detection logic that queries the page for the packet-size element
and returns its visibility state. Locate the packet-size element using the same
selector strategy used elsewhere in this class/base page (e.g., the packet size
WebElement or a By constant used for other fields), call the existing helper
like isElementVisible/isDisplayed on that element or use
getDriver().findElements(By...).isEmpty() to infer presence, and return true
only when the element is present and visible; keep the method name
isPacketSizeDisplayed() unchanged.

In
`@ui-test/src/main/java/regclient/pages/tamil/ManageApplicationsPageTamil.java`:
- Around line 272-288: The three TODO methods in ManageApplicationsPageTamil are
unimplemented: clickOnClearFilterButton(), isClientStatusDropdownDisplayed(),
and scrollTillDisplayingApplicationCountVisible(). Implement them by mirroring
the behavior from the working ManageApplicationsPage (e.g., the English/Default
implementation): locate and click the clear-filter control in
clickOnClearFilterButton(), implement isClientStatusDropdownDisplayed() to
return the client status dropdown element's visibility
(element.isDisplayed()/isVisible()), and implement
scrollTillDisplayingApplicationCountVisible() to scroll the page (e.g., via JS
scrollIntoView or repeated scroll steps) until the application-count element is
visible; use the same element locators/selector variables and helper utilities
used elsewhere in ManageApplicationsPage to keep behavior consistent.

In `@ui-test/src/main/java/regclient/pages/tamil/RegistrationTasksPageTamil.java`:
- Around line 195-199: The method isClientVersionDisplayed() in
RegistrationTasksPageTamil is a placeholder returning false; replace it with the
actual visibility check used by other locale implementations: locate the
client-version element (same selector/identifier used by
RegistrationTasksPage/other locale classes) via the page driver (e.g.,
findElement or equivalent) and return its displayed/visible state (or presence)
as a boolean; ensure you reference the class RegistrationTasksPageTamil and
method isClientVersionDisplayed() and mirror the logic from the working
implementation in the corresponding RegistrationTasksPage (or other locale) to
keep behavior consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1203c394-5fb2-4c6c-8995-9fe5e79e124f

📥 Commits

Reviewing files that changed from the base of the PR and between c77db8c and 54e498a.

📒 Files selected for processing (54)
  • ui-test/src/main/java/regclient/androidTestCases/PreRegFetchingPacket.java
  • ui-test/src/main/java/regclient/pages/arabic/ApplicantBiometricsPageArabic.java
  • ui-test/src/main/java/regclient/pages/arabic/DemographicDetailsPageArabic.java
  • ui-test/src/main/java/regclient/pages/arabic/DocumentUploadPageArabic.java
  • ui-test/src/main/java/regclient/pages/arabic/IntroducerBiometricPageArabic.java
  • ui-test/src/main/java/regclient/pages/arabic/LoginPageArabic.java
  • ui-test/src/main/java/regclient/pages/arabic/ManageApplicationsPageArabic.java
  • ui-test/src/main/java/regclient/pages/arabic/OperationalTaskPageArabic.java
  • ui-test/src/main/java/regclient/pages/arabic/PendingApprovalArabic.java
  • ui-test/src/main/java/regclient/pages/arabic/RegistrationTasksPageArabic.java
  • ui-test/src/main/java/regclient/pages/arabic/SelectLanguagePageArabic.java
  • ui-test/src/main/java/regclient/pages/arabic/SupervisorBiometricVerificationpageArabic.java
  • ui-test/src/main/java/regclient/pages/arabic/UpdateOperatorBiometricspageArabic.java
  • ui-test/src/main/java/regclient/pages/hindi/AcknowledgementPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/ApplicantBiometricsPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/BiometricDetailsPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/ConsentPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/DemographicDetailsPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/DocumentUploadPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/IntroducerBiometricPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/ManageApplicationsPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/OperationalTaskPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/PendingApprovalHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/PreviewPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/RegistrationTasksPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/SettingsPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/SupervisorBiometricVerificationpageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/UpdateOperatorBiometricspageHindi.java
  • ui-test/src/main/java/regclient/pages/kannada/ApplicantBiometricsPageKannada.java
  • ui-test/src/main/java/regclient/pages/kannada/DemographicDetailsPageKannada.java
  • ui-test/src/main/java/regclient/pages/kannada/DocumentUploadPageKannada.java
  • ui-test/src/main/java/regclient/pages/kannada/ManageApplicationsPageKannada.java
  • ui-test/src/main/java/regclient/pages/kannada/OperationalTaskPageKannada.java
  • ui-test/src/main/java/regclient/pages/kannada/PendingApprovalKannada.java
  • ui-test/src/main/java/regclient/pages/kannada/RegistrationTasksPageKannada.java
  • ui-test/src/main/java/regclient/pages/kannada/SettingsPageKannada.java
  • ui-test/src/main/java/regclient/pages/kannada/SupervisorBiometricVerificationpageKannada.java
  • ui-test/src/main/java/regclient/pages/kannada/UpdateOperatorBiometricspageKannada.java
  • ui-test/src/main/java/regclient/pages/kannada/UpdateUINPageKannada.java
  • ui-test/src/main/java/regclient/pages/tamil/AcknowledgementPageTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/ApplicantBiometricsPageTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/BiometricDetailsPageTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/DemographicDetailsPageTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/DocumentUploadPageTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/IntroducerBiometricPageTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/ManageApplicationsPageTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/OperationalTaskPageTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/PendingApprovalTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/PreviewPageTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/ProfilePageTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/RegistrationTasksPageTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/SettingsPageTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/SupervisorBiometricVerificationpageTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/UpdateOperatorBiometricspageTamil.java
💤 Files with no reviewable changes (11)
  • ui-test/src/main/java/regclient/pages/tamil/IntroducerBiometricPageTamil.java
  • ui-test/src/main/java/regclient/pages/kannada/UpdateUINPageKannada.java
  • ui-test/src/main/java/regclient/pages/tamil/BiometricDetailsPageTamil.java
  • ui-test/src/main/java/regclient/pages/tamil/AcknowledgementPageTamil.java
  • ui-test/src/main/java/regclient/pages/hindi/IntroducerBiometricPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/AcknowledgementPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/ConsentPageHindi.java
  • ui-test/src/main/java/regclient/pages/tamil/PreviewPageTamil.java
  • ui-test/src/main/java/regclient/pages/hindi/BiometricDetailsPageHindi.java
  • ui-test/src/main/java/regclient/pages/tamil/ProfilePageTamil.java
  • ui-test/src/main/java/regclient/pages/hindi/PreviewPageHindi.java

Comment thread ui-test/src/main/java/regclient/pages/hindi/ApplicantBiometricsPageHindi.java Outdated
Comment thread ui-test/src/main/java/regclient/pages/hindi/DemographicDetailsPageHindi.java Outdated
Comment thread ui-test/src/main/java/regclient/pages/hindi/DocumentUploadPageHindi.java Outdated
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ui-test/src/main/java/regclient/page/CameraPage.java`:
- Line 36: The hardcoded tap call clickAtCoordinates(534, 1794) is
resolution-dependent; replace it with an element-based click using the
already-defined okBtn (com.google.android.GoogleCamera:id/shutter_button).
Remove the coordinate call and either call the existing helper
clickOnElement2(okBtn) or compute the element center via
getCenterOfElement(okBtn) (from BasePage) and use the pointer tap on that
center; ensure you reference okBtn and the helper methods (clickOnElement2,
getCenterOfElement) rather than raw x/y.

In `@ui-test/src/main/java/regclient/pages/hindi/RegistrationTasksPageHindi.java`:
- Around line 199-201: The isClientVersionDisplayed method can throw if
clientVersionText is missing or its contentDescription is null; update
isClientVersionDisplayed to safely guard the read by first verifying
clientVersionText is present/visible (or null-checked), then retrieve the
attribute and check for null before calling contains, and return false on any
exception (e.g., NoSuchElementException or NullPointerException) so the method
always returns a boolean; reference the clientVersionText field and
isClientVersionDisplayed method and ensure any exception-catching is narrow and
documented.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d2e2fbef-066a-4d74-8278-c14ce8f0281e

📥 Commits

Reviewing files that changed from the base of the PR and between 54e498a and 791e517.

📒 Files selected for processing (14)
  • ui-test/src/main/java/regclient/androidTestCases/PreRegFetchingPacket.java
  • ui-test/src/main/java/regclient/page/CameraPage.java
  • ui-test/src/main/java/regclient/page/DocumentUploadPage.java
  • ui-test/src/main/java/regclient/page/ManageApplicationsPage.java
  • ui-test/src/main/java/regclient/pages/arabic/DemographicDetailsPageArabic.java
  • ui-test/src/main/java/regclient/pages/hindi/ApplicantBiometricsPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/AutoLogoutPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/DemographicDetailsPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/DocumentUploadPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/ManageApplicationsPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/RegistrationTasksPageHindi.java
  • ui-test/src/main/java/regclient/pages/hindi/SettingsPageHindi.java
  • ui-test/src/main/java/regclient/utils/TestRunner.java
  • ui-test/testng.xml
💤 Files with no reviewable changes (1)
  • ui-test/src/main/java/regclient/pages/hindi/AutoLogoutPageHindi.java
✅ Files skipped from review due to trivial changes (2)
  • ui-test/src/main/java/regclient/page/DocumentUploadPage.java
  • ui-test/src/main/java/regclient/androidTestCases/PreRegFetchingPacket.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • ui-test/src/main/java/regclient/pages/arabic/DemographicDetailsPageArabic.java

public void clickimage() {
for (int i = 0; i < 3; i++) {
clickAtCoordinates(732, 696);
clickAtCoordinates(534, 1794);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Look for resolution handling or dynamic coordinate calculation.

# Check for screen resolution or dimension references
echo "=== Screen resolution/dimension handling ==="
rg -n 'getSize|getDimensions|resolution|viewport|screen.*width|screen.*height' --type=java -g '**/page/**' -C3

# Check for other hardcoded coordinate usages
echo -e "\n=== Other hardcoded clickAtCoordinates calls ==="
rg -n 'clickAtCoordinates\(' --type=java -C2

Repository: mosip/android-registration-client

Length of output: 16077


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== CameraPage.java around clickimage ==="
sed -n '1,120p' ui-test/src/main/java/regclient/page/CameraPage.java | nl -ba

echo -e "\n=== BasePage.java: clickAtCoordinates + nearby helpers ==="
# Print the region around clickAtCoordinates and getCenterOfElement if present
rg -n "protected void clickAtCoordinates|getCenterOfElement" ui-test/src/main/java/regclient/page/BasePage.java
start=$(rg -n "protected void clickAtCoordinates" ui-test/src/main/java/regclient/page/BasePage.java | head -n1 | cut -d: -f1)
# Print a window around the found line
sed -n "$((start-40)),$((start+60))p" ui-test/src/main/java/regclient/page/BasePage.java | nl -ba

echo -e "\n=== BasePage.java: getCenterOfElement definition (if different area) ==="
getCenterLine=$(rg -n "getCenterOfElement" ui-test/src/main/java/regclient/page/BasePage.java | head -n1 | cut -d: -f1 || true)
if [ -n "${getCenterLine:-}" ]; then
  sed -n "$((getCenterLine-30)),$((getCenterLine+40))p" ui-test/src/main/java/regclient/page/BasePage.java | nl -ba
fi

Repository: mosip/android-registration-client

Length of output: 180


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== CameraPage.java around clickimage ==="
sed -n '1,120p' ui-test/src/main/java/regclient/page/CameraPage.java | cat -n

echo -e "\n=== BasePage.java: region containing clickAtCoordinates ==="
clickLine=$(rg -n "protected void clickAtCoordinates" ui-test/src/main/java/regclient/page/BasePage.java | cut -d: -f1 | head -n1)
sed -n "$((clickLine-40)),$((clickLine+60))p" ui-test/src/main/java/regclient/page/BasePage.java | cat -n

echo -e "\n=== BasePage.java: occurrences of getCenterOfElement ==="
rg -n "getCenterOfElement" ui-test/src/main/java/regclient/page/BasePage.java
if [ -n "${getCenterLine:-}" ]; then :; fi

Repository: mosip/android-registration-client

Length of output: 6168


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== BasePage.java: clickOnElement2 (if present) ==="
rg -n "clickOnElement2|clickOnElement\(" ui-test/src/main/java/regclient/page/BasePage.java

echo -e "\n=== BasePage.java: getCenterOfElement definition ==="
centerLine=$(rg -n "getCenterOfElement\\(" ui-test/src/main/java/regclient/page/BasePage.java | head -n1 | cut -d: -f1)
sed -n "$((centerLine-10)),$((centerLine+40))p" ui-test/src/main/java/regclient/page/BasePage.java | cat -n

Repository: mosip/android-registration-client

Length of output: 2927


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== BasePage.java: clickOnElement / clickOnElement2 ==="
# Show around the reported line numbers (~90-140)
sed -n '70,160p' ui-test/src/main/java/regclient/page/BasePage.java | cat -n

Repository: mosip/android-registration-client

Length of output: 3190


ui-test/src/main/java/regclient/page/CameraPage.java:36 — Remove the hardcoded tap and click the shutter control via element-based coordinates.

clickAtCoordinates(534, 1794) passes fixed x/y directly into PointerInput.Origin.viewport() with no scaling logic, so it’s resolution-dependent. Since CameraPage already defines the shutter/confirmation element as okBtn (com.google.android.GoogleCamera:id/shutter_button), replace the hardcoded coordinate tap with an element-based click (e.g., clickOnElement2(okBtn) or tap its center using the existing getCenterOfElement(...) pattern used elsewhere in BasePage).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui-test/src/main/java/regclient/page/CameraPage.java` at line 36, The
hardcoded tap call clickAtCoordinates(534, 1794) is resolution-dependent;
replace it with an element-based click using the already-defined okBtn
(com.google.android.GoogleCamera:id/shutter_button). Remove the coordinate call
and either call the existing helper clickOnElement2(okBtn) or compute the
element center via getCenterOfElement(okBtn) (from BasePage) and use the pointer
tap on that center; ensure you reference okBtn and the helper methods
(clickOnElement2, getCenterOfElement) rather than raw x/y.

Comment on lines +199 to +201
public boolean isClientVersionDisplayed() {
String versionText = clientVersionText.getAttribute("contentDescription");
return versionText.contains("Client Version");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Guard the client-version read to avoid runtime failures.

This method can throw when the element is absent or attribute is null, instead of returning false as a boolean visibility check.

Suggested fix
 public boolean isClientVersionDisplayed() {
-	    String versionText = clientVersionText.getAttribute("contentDescription");
-	    return versionText.contains("Client Version");
+	    if (!isElementDisplayed(clientVersionText)) {
+	        return false;
+	    }
+	    String versionText = clientVersionText.getAttribute("contentDescription");
+	    return versionText != null && versionText.contains("Client Version");
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui-test/src/main/java/regclient/pages/hindi/RegistrationTasksPageHindi.java`
around lines 199 - 201, The isClientVersionDisplayed method can throw if
clientVersionText is missing or its contentDescription is null; update
isClientVersionDisplayed to safely guard the read by first verifying
clientVersionText is present/visible (or null-checked), then retrieve the
attribute and check for null before calling contains, and return false on any
exception (e.g., NoSuchElementException or NullPointerException) so the method
always returns a boolean; reference the clientVersionText field and
isClientVersionDisplayed method and ensure any exception-catching is narrow and
documented.

@damodarguru

Copy link
Copy Markdown
Collaborator Author

Closing this PR and raised another PR with fixes

@damodarguru damodarguru closed this Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant