MOSIP-44176:ARC - Run the ARC UI automation in Arab language#670
MOSIP-44176:ARC - Run the ARC UI automation in Arab language#670damodarguru wants to merge 29 commits into
Conversation
Signed-off-by: damodar <damodar.g@cyberpwn.com>
Signed-off-by: damodar <damodar.g@cyberpwn.com>
Signed-off-by: damodar <damodar.g@cyberpwn.com>
Signed-off-by: damodar <damodar.g@cyberpwn.com>
Signed-off-by: damodar <damodar.g@cyberpwn.com>
Signed-off-by: damodar <damodar.g@cyberpwn.com>
Signed-off-by: damodar <damodar.g@cyberpwn.com>
Signed-off-by: damodar <damodar.g@cyberpwn.com>
Signed-off-by: damodar <damodar.g@cyberpwn.com>
Signed-off-by: damodar <damodar.g@cyberpwn.com>
Signed-off-by: damodar <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>
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>
WalkthroughIntroduces retry loops for UI transitions (typically 3 attempts), expands BasePage locator-based utilities, adds camera-permission and MockSBI settings clicks, renames LoginTest, and standardizes PendingApproval API across language page objects. Several page objects receive locator and minor navigation updates. Changes
Sequence Diagram(s)Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 14
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ui-test/src/main/java/regclient/page/BasePage.java (1)
14-14: Wrong TimeoutException import - will not catch Selenium timeouts.The import at line 14 is
io.netty.handler.timeout.TimeoutException, butWebDriverWait.until()throwsorg.openqa.selenium.TimeoutException. The catch block at line 863 will never catch the intended exception.🐛 Proposed fix
Update the import:
-import io.netty.handler.timeout.TimeoutException; +import org.openqa.selenium.TimeoutException;Or if both are needed, use fully qualified names in the catch block:
- } catch (TimeoutException | NoSuchElementException e) { + } catch (org.openqa.selenium.TimeoutException | NoSuchElementException e) {Also applies to: 853-866
🤖 Fix all issues with AI agents
In `@ui-test/src/main/java/regclient/androidTestCases/BiometricCorrection.java`:
- Around line 1510-1512: The biometric reset call is commented out which leaves
FetchUiSpec in the introducer-biometric state and can mis-order later steps;
restore the reset by re-enabling the call to
FetchUiSpec.getBiometricDetails("individualBiometrics") (or the equivalent reset
method) before the subsequent assertion so the flow returns to individual
biometrics; verify the call is placed immediately before
registrationTasksPage.isOperationalTaskDisplayed() to ensure the UI state is
correct for the correction flow.
In `@ui-test/src/main/java/regclient/androidTestCases/logintest.java`:
- Around line 72-77: The class declaration public class LoginTest does not match
the source filename logintest.java; rename the file to LoginTest.java or change
the class name to match the existing filename so Java's public class vs filename
rule is satisfied — locate the class LoginTest in the file and either rename the
file to LoginTest.java or refactor the class identifier to match logintest,
update any references/imports accordingly, and ensure the test runner
configuration references the updated name.
In `@ui-test/src/main/java/regclient/androidTestCases/NewRegistrationAdult.java`:
- Around line 552-553: Fix the typo in the assertion message for the pending
approval submit-button check: update the assertion call that uses
pendingApproval.isSubmitButtonDisabledWithEmptyUsername() to replace "disapbled"
with "disabled" in the message string so it reads "Verify if submit button
disabled while username empty" (or better: "Verify submit button is disabled
when username is empty").
In `@ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinInfant.java`:
- Around line 427-437: Replace the fixed Thread.sleep polling loop with an
explicit wait: remove the for-loop that calls
previewPage.clickOnContinueButton() + Thread.sleep(2000) and instead click the
continue button once (previewPage.clickOnContinueButton()) then use a
WebDriverWait (or BasePage.retryFindElement()) to wait until
authenticationPage.isAuthenticationPageDisplayed() becomes true within a
suitable timeout (e.g., 10s); you can also wait for the authentication page
element via authenticationPage.getAuthenticationPageElement() with
ExpectedConditions.visibilityOfElementLocated to avoid flaky sleeps.
In
`@ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinUpdateBiometrics.java`:
- Around line 429-439: The retry loop repeatedly calls
previewPage.clickOnContinueButton(), which risks double-submit/stale element
errors; instead, call previewPage.clickOnContinueButton() once before the loop
and then poll authenticationPage.isAuthenticationPageDisplayed() up to 3 times
with Thread.sleep(2000) between checks, setting isAuthenticationPageDisplayed
and breaking when true, and keep the final assertTrue message unchanged
(class/methods involved: UpdateMyUinUpdateBiometrics,
previewPage.clickOnContinueButton(),
authenticationPage.isAuthenticationPageDisplayed()).
In
`@ui-test/src/main/java/regclient/androidTestCases/UpdateMyUINUpdateDemographicDetails.java`:
- Around line 405-415: Replace the retry loop in
UpdateMyUINUpdateDemographicDetails by performing a single
previewPage.clickOnContinueButton() and removing the Thread.sleep/retry logic;
then use an explicit wait (WebDriverWait) to wait until
authenticationPage.isAuthenticationPageDisplayed() (or a stable locator/method
on AuthenticationPage) returns true or timeout occurs, and assert after the wait
instead of looping—update references in this method to remove
isAuthenticationPageDisplayed flag logic and rely on the explicit wait for
determinism.
In `@ui-test/src/main/java/regclient/page/CameraPage.java`:
- Around line 75-77: The isCoordinatesDisplayed stub in CameraPage always
returns true which prevents the okButton click path from ever running; replace
the stub with a real check (or remove it and simplify the logic) by updating
CameraPage.isCoordinatesDisplayed(int x, int y) to actually verify the on-screen
coordinate element (e.g., locate the coordinate/display element, parse its
values and compare to x and y or verify element bounds contain those coords) so
the caller can correctly choose between the coordinates branch and the okButton
branch (or, if you prefer the simpler route, remove isCoordinatesDisplayed usage
and always click okButton).
In `@ui-test/src/main/java/regclient/page/MockSBIPage.java`:
- Around line 66-82: The clickOnMockSbiSettingsButton method silently logs when
the Device Config page fails to display; change it to surface failure by
returning a boolean (or throwing an exception) so callers can react: update the
method signature clickOnMockSbiSettingsButton to return boolean, keep the retry
loop using isElementDisplayed(deviceConfigTitle, 3) and set/return true on
success, return false (or alternatively throw an IllegalStateException with a
clear message including "Device Config page not displayed after clicking
Settings") when isDisplayed is false, and update all callers to handle the
boolean result (or to catch the exception) accordingly.
In `@ui-test/src/main/java/regclient/page/PendingApproval.java`:
- Line 53: Remove the dead legacy methods named
isSubmitButtonEnabledWithEmptyUsername() from the five implementation classes
PendingApprovalEnglish, PendingApprovalFrench, PendingApprovalTamil,
PendingApprovalHindi, and PendingApprovalKannada; keep the new abstract method
isSubmitButtonDisabledWithEmptyUsername() in the abstract PendingApproval and
ensure each implementation only implements
isSubmitButtonDisabledWithEmptyUsername(), deleting the unused
isSubmitButtonEnabledWithEmptyUsername() definitions and any accompanying unused
imports or comments specific to those methods.
In `@ui-test/src/main/java/regclient/pages/arabic/DocumentUploadPageArabic.java`:
- Around line 102-104: The branch only calls CameraPage.handleCameraPermission()
before clickimage() for the ReferenceNumber flow, causing inconsistent
permission handling; update every CameraPage instantiation (where new
CameraPage(driver) is followed by clickimage()) to call handleCameraPermission()
first, or extract a small helper like ensureCameraPermission(CameraPage) and
invoke it before clickimage() in all document upload flows (same spots where
CameraPage is constructed and clickimage() is invoked) so the permission dialog
is consistently handled.
In `@ui-test/src/main/java/regclient/pages/english/PendingApprovalEnglish.java`:
- Around line 236-239: Remove the dead method
isSubmitButtonEnabledWithEmptyUsername() from PendingApprovalEnglish (it’s
orphaned after adding isSubmitButtonDisabledWithEmptyUsername()); locate and
delete the entire method declaration for
isSubmitButtonEnabledWithEmptyUsername() so only
isSubmitButtonDisabledWithEmptyUsername() remains, and run a project-wide search
to confirm there are no remaining references to that removed method.
In `@ui-test/src/main/java/regclient/pages/french/DocumentUploadPageFrench.java`:
- Around line 104-106: DocumentUploadPageFrench inconsistently handles camera
permissions: ensure every instantiation/use of CameraPage (e.g., CameraPage
cameraPage = new CameraPage(driver)) calls cameraPage.handleCameraPermission()
before invoking cameraPage.clickimage(); update all CameraPage usages (the ones
mirrored at the other locations analogous to lines where clickimage() is called)
so permission handling is applied consistently across ReferenceNumber and the
other branches.
In
`@ui-test/src/main/java/regclient/pages/french/ManageApplicationsPageFrench.java`:
- Around line 86-88: The backButton field in ManageApplicationsPageFrench uses a
fragile UiAutomator instance(0) selector; replace it with a more specific
locator (e.g., content-desc/accessibility id, resource-id, or a relative XPath
to a known header element) to match the actual back button reliably. Update the
`@AndroidFindBy` annotation for the backButton field (in class
ManageApplicationsPageFrench) to use the app's content-desc or resource-id (or a
deterministic relative selector) consistent with other button locators in the
codebase so the selector no longer depends on button ordering.
In `@ui-test/src/main/java/regclient/pages/kannada/PendingApprovalKannada.java`:
- Around line 234-237: Remove the dead/orphaned method
isSubmitButtonEnabledWithEmptyUsername() from class PendingApprovalKannada since
the new implementation isSubmitButtonDisabledWithEmptyUsername() satisfies the
contract; locate and delete the obsolete
isSubmitButtonEnabledWithEmptyUsername() method (matching that exact method
name) so the class no longer contains the unused/duplicate method and mirrors
the PendingApprovalEnglish cleanup.
🧹 Nitpick comments (18)
ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinUpdateDocuments.java (1)
404-413: Prefer an explicit wait overThread.sleepfor the retry loop.
Thread.sleep(2000)makes the test slower and still flaky under slow UI transitions. Consider a wait utility (e.g., a BasePage wait helper or a WebDriverWait) to pollisAuthenticationPageDisplayed()with a timeout instead.ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinMinor.java (1)
545-555: Retry mechanism for authentication page navigation looks good.The retry loop addresses potential timing issues when transitioning to the authentication page, and the pattern is consistent with other test cases in this PR.
Optional improvement: Consider extracting the magic numbers to constants for maintainability:
private static final int MAX_RETRIES = 3; private static final int RETRY_DELAY_MS = 2000;Alternatively, if the framework supports it, explicit waits (e.g.,
WebDriverWaitwithExpectedConditions) would be more robust thanThread.sleep()as they can return early when the element is found.ui-test/src/main/java/regclient/androidTestCases/NewRegistrationMinorException.java (1)
583-594: Retry mechanism is reasonable; consider extracting a reusable helper.The retry logic correctly handles intermittent navigation delays. However:
- Code duplication: This pattern is repeated at lines 665-675. Consider extracting a reusable method.
- Magic numbers:
3(retry count) and2000(sleep ms) should be constants for maintainability.- Thread.sleep: Consider using explicit waits (e.g.,
WebDriverWaitwithExpectedConditions) for more reliable synchronization, thoughThread.sleepis acceptable here.♻️ Optional: Extract retry helper method
// Add as a helper method or in BasePage private boolean waitForPageWithRetry(Runnable action, Supplier<Boolean> condition, int maxRetries, long sleepMs) throws InterruptedException { for (int i = 0; i < maxRetries; i++) { action.run(); Thread.sleep(sleepMs); if (condition.get()) { return true; } } return false; }Usage:
boolean isAuthenticationPageDisplayed = waitForPageWithRetry( () -> previewPage.clickOnContinueButton(), () -> authenticationPage.isAuthenticationPageDisplayed(), 3, 2000); assertTrue(isAuthenticationPageDisplayed, "Authentication page not displayed after retries");ui-test/src/main/java/regclient/androidTestCases/logintest.java (1)
126-130: Avoid leaving disabled assertions in comments.
If the password‑incorrect message is intentionally unavailable, consider guarding the check with a feature flag or skipping it explicitly (e.g., a dedicated disabled test) instead of commented‑out code, so it’s easier to re‑enable and doesn’t go stale.ui-test/src/main/java/regclient/androidTestCases/PreRegFetchingPacket.java (1)
445-456: Replace fixed sleeps with WebDriverWait-based polling to reduce flakiness.The retry loop uses
Thread.sleep(2000)with hardcoded 3 attempts, which can fail on slower devices and wastes time on fast ones. BasePage already provideswaitForElementToBeVisible(element, int waitTime)andretryFindElement(element, Duration timeout)for timeout-based polling. Use one of these or a similar WebDriverWait approach to make retries adaptive:WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); wait.until(ExpectedConditions.visibilityOf(authenticationPage.getAuthenticationPageElement()));Alternatively, refactor into a reusable helper method in BasePage to centralize and standardize this pattern across all test files.
ui-test/src/main/java/regclient/androidTestCases/NewRegistrationAdultException.java (1)
497-508: Retry mechanism for authentication page navigation looks good.The retry loop (up to 3 attempts with 2-second waits) appropriately handles asynchronous UI state transitions. This pattern aligns with similar retry-based navigation patterns across other test classes in this PR.
Consider extracting the magic numbers (retry count: 3, wait time: 2000ms) to constants if this pattern is used widely, but this is optional for test code.
♻️ Optional: Extract retry constants
private static final int MAX_RETRIES = 3; private static final int RETRY_WAIT_MS = 2000;ui-test/src/main/java/regclient/pages/english/DemographicDetailsPageEnglish.java (1)
242-243: Remove commented-out code.The commented-out line should be removed to keep the code clean. If the old behavior needs to be referenced, it can be found in version control history.
♻️ Remove commented code
if (!isElementDisplayed(dropdownElement)) { - // clickOnElement(findElement(By.className("android.view.View"))); clickOnElement(nonForeignerOption);ui-test/src/main/java/regclient/androidTestCases/NewRegistrationMinor.java (1)
478-489: Consider replacingThread.sleep()with explicit waits for better reliability.The retry mechanism addresses timing issues, but using
Thread.sleep(2000)is fragile - it may wait longer than necessary or fail intermittently. Appium'sWebDriverWaitwithExpectedConditionsprovides a more robust approach.♻️ Suggested improvement using explicit waits
- boolean isAuthenticationPageDisplayed = false; - for (int i = 0; i < 3; i++) { - previewPage.clickOnContinueButton(); - Thread.sleep(2000); - if (authenticationPage.isAuthenticationPageDisplayed()) { - isAuthenticationPageDisplayed = true; - break; - } - } - assertTrue(isAuthenticationPageDisplayed, - "Authentication page not displayed after retries"); + previewPage.clickOnContinueButton(); + assertTrue(authenticationPage.waitForAuthenticationPageDisplayed(10), + "Authentication page not displayed after waiting");This assumes adding a
waitForAuthenticationPageDisplayed(int timeoutSeconds)method inAuthenticationPagethat usesWebDriverWait. This pattern could be reused across all similar retry loops in the test suite.ui-test/src/main/java/regclient/androidTestCases/NewRegistrationInfant.java (1)
436-447: SameThread.sleep()pattern as other test files - consider consolidating.This retry logic is duplicated across
NewRegistrationMinor,NewRegistrationInfant, and likely other test classes. Consider extracting this into a reusable helper method in a base class or utility to reduce duplication and make future improvements easier.ui-test/src/main/java/regclient/page/BasePage.java (2)
840-851: Inconsistent lambda parameter naming convention.The lambda parameter
Webdriver(lines 844, 858) should follow Java naming conventions and be lowercasewebDriverordriver.♻️ Suggested fix
- wait.until(Webdriver -> { - WebElement element = Webdriver.findElement(locator); + wait.until(webDriver -> { + WebElement element = webDriver.findElement(locator);Also applies to: 853-866
799-838: Robust scroll logic but potentially slow.The method performs up to 12 swipes (6 down, scroll to top, 6 more down) which could be slow for elements near the top. Consider adding an early visibility check after
scrollToTopSafe()before the second loop.♻️ Suggested improvement
scrollToTopSafe(); hideKeyboardIfVisible(); + // Check immediately after scrolling to top + try { + WebElement el = driver.findElement(locator); + if (el.isDisplayed()) { + return; + } + } catch (Exception ignored) { + } + for (int i = 0; i < 6; i++) { swipeUp();ui-test/src/main/java/regclient/page/CameraPage.java (1)
31-39: Hardcoded coordinates are device-specific.The coordinates
(1840, 598)are tied to a specific device resolution. Consider using relative positioning or finding the capture button element by locator for better cross-device compatibility.ui-test/src/main/java/regclient/pages/english/ManageApplicationsPageEnglish.java (1)
90-92: Fragile locator using instance index.Using
instance(0)to select the first button by class name is position-dependent and could break if the UI layout changes. The back button appears to lack specific accessibility or resource identifiers (unlike other buttons on this page which useaccessibilityoridattributes), necessitating this pattern. However, consider verifying if the back button has acontent-descor other unique attribute available via the Android UI hierarchy, and refactor to use it if possible.ui-test/src/main/java/regclient/androidTestCases/NewRegistrationAdult.java (3)
452-462: Retry loop for authentication page navigation looks reasonable.The retry mechanism handles asynchronous UI transitions appropriately. However, consider extracting this pattern to a reusable helper method since identical logic appears in
newRegistrationAdultUploadMultipleDoccuments(lines 1192-1201).♻️ Suggested helper extraction
private boolean waitForAuthenticationPage(PreviewPage previewPage, AuthenticationPage authenticationPage, int maxRetries) throws InterruptedException { for (int i = 0; i < maxRetries; i++) { previewPage.clickOnContinueButton(); Thread.sleep(2000); if (authenticationPage.isAuthenticationPageDisplayed()) { return true; } } return false; }
1191-1201: Duplicate retry pattern - same as first test method.This is identical to lines 452-462. Consider the helper extraction suggested earlier to reduce duplication.
651-665: Consider a page factory pattern to reduce language switch duplication.The repeated
if-elsechains for language-specific page instantiation (e.g., LoginPage, RegistrationTasksPage, SelectLanguagePage, etc.) appear 20+ times across both test methods. A factory pattern or method would significantly reduce boilerplate.♻️ Example factory approach
private <T> T createPageForLanguage(Class<T> pageInterface, String language, AppiumDriver driver) { // Map language codes to page implementations // Return appropriate language-specific page object } // Usage: LoginPage loginPage = createPageForLanguage(LoginPage.class, language, driver);Also applies to: 728-742, 750-764, 772-786, 793-807, 906-920, 934-948, 953-967, 974-988, 1149-1163, 1176-1190
ui-test/src/main/java/regclient/pages/french/SupervisorBiometricVerificationpageFrench.java (1)
354-369: Silent failure on retry exhaustion may mask test issues.The method logs an INFO message but doesn't indicate failure to the caller when the Dismiss page never loads after 3 attempts. This could cause downstream test steps to fail with misleading errors.
Additionally:
- No delay between retries could cause rapid clicking before the UI can respond
System.out.printlnshould use a proper logging framework♻️ Suggested improvement
public void clickOnVerifyAndSaveButton() { boolean isDismissLoaded = false; for (int i = 0; i < 3; i++) { clickOnElement(verifyAndSaveButton); + waitTime(1); // Allow UI to respond if (isDismissPageLoaded()) { isDismissLoaded = true; break; } } if (!isDismissLoaded) { - System.out.println("INFO: Dismiss page not loaded after clicking Verify & Save 3 times"); + // Consider throwing or returning a boolean to signal failure + logger.warn("Dismiss page not loaded after clicking Verify & Save 3 times"); } }ui-test/src/main/java/regclient/pages/english/SupervisorBiometricVerificationpageEnglish.java (1)
360-375: Same concerns as French variant: silent failure and missing delay.This implementation has the same issues noted for
SupervisorBiometricVerificationpageFrench:
- Silent failure when Dismiss page doesn't load
- No delay between retry attempts
- Uses
System.out.printlninstead of proper loggingSince this logic is identical across language variants, consider moving it to the base class
SupervisorBiometricVerificationpageto avoid duplication.
Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
|
Raised invalid PR |
There was a problem hiding this comment.
Actionable comments posted: 11
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ui-test/src/main/java/regclient/page/BasePage.java (1)
14-14: WrongTimeoutExceptionimport - method will not catch Selenium timeouts.Line 14 imports
io.netty.handler.timeout.TimeoutException, butWebDriverWait.until()throwsorg.openqa.selenium.TimeoutException. The catch block at line 856 will never catch the actual timeout, causing the exception to propagate instead of returningfalse.🐛 Proposed fix
Add the correct import and update the catch clause:
+import org.openqa.selenium.TimeoutException;If you need both, use fully qualified names in the catch:
- } catch (TimeoutException | NoSuchElementException e) { + } catch (org.openqa.selenium.TimeoutException | NoSuchElementException e) { return false; }Also applies to: 846-859
🤖 Fix all issues with AI agents
In `@ui-test/src/main/java/regclient/androidTestCases/BiometricCorrection.java`:
- Line 1863: Fix the typo in the assertion message for the call to
loginPage.isLoginPageLoaded(): replace "displayeded" with "displayed" so the
assertion reads "verify if login page is displayed in Selected language" to
ensure the message is correct and readable.
In `@ui-test/src/main/java/regclient/androidTestCases/NewRegistrationAdult.java`:
- Around line 598-604: The retry loop around
manageApplicationsPage.clickOnUploadButton currently gives up after 3 attempts
without failing the test; after the loop (for both occurrences) add a post-retry
assertion that verifies the upload succeeded by asserting
manageApplicationsPage.isNoNetworkFoundDisplayed() is false (or that a success
indicator is present) and fail the test if the “No Network Found” message still
persists so failures don’t pass silently.
- Around line 631-632: The method newRegistrationAdultUploadMultipleDoccuments
currently has its `@Test` annotation commented out, which silently disables the
test; either re-enable the test by restoring the `@Test` annotation above
newRegistrationAdultUploadMultipleDoccuments so it runs as part of the suite, or
explicitly disable it with a clear `@Test`(enabled = false, description = "...",
groups = {...}) or a TestNG `@Disabled` equivalent and include a ticket/reference
ID and reason; update the method's annotation accordingly and ensure the method
name newRegistrationAdultUploadMultipleDoccuments is left unchanged.
In `@ui-test/src/main/java/regclient/androidTestCases/NewRegistrationMinor.java`:
- Around line 595-601: The retry loop around
manageApplicationsPage.clickOnUploadButton() needs a short delay between
attempts and a final assertion to fail the test if the "no network" condition
persists; modify the loop to sleep (e.g., Thread.sleep or a test util wait)
between retries and after the loop assert that
manageApplicationsPage.isNoNetworkFoundDisplayed() is false (or explicitly fail)
so the test does not continue silently when uploads never succeed.
In `@ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinInfant.java`:
- Around line 505-515: The retry loop around
pendingApproval.clickOnAuthenticateButton() and
pendingApproval.isSupervisorAuthenticationTitleDisplayed() is a hot loop; after
each click add a short bounded wait/poll before re-checking (e.g., sleep
500–1000ms or use the existing UI wait/poll util) to allow the Supervisor
Authentication UI to appear, and keep the retry count/timeout bounded; update
the logic that sets isPageDisplayed accordingly so the assertion remains
meaningful if the page never appears.
- Around line 541-548: The retry loop using
manageApplicationsPage.clickOnUploadButton() checks
manageApplicationsPage.isNoNetworkFoundDisplayed() but never asserts outcome;
after the loop (following clickOnSearchCheckBox and the for-loop), add a final
assertion that verifies the upload succeeded or the "no network" error is gone
(e.g., assertFalse(manageApplicationsPage.isNoNetworkFoundDisplayed()) or
assertTrue(manageApplicationsPage.isUploadSuccessful()/equivalent). Keep the
check against the existing methods clickOnUploadButton and
isNoNetworkFoundDisplayed (or add a new isUploadSuccessful method on
manageApplicationsPage if needed) so the test fails if retries do not resolve
the error.
In `@ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinMinor.java`:
- Around line 675-682: The retry loop using
manageApplicationsPage.clickOnUploadButton() checks
manageApplicationsPage.isNoNetworkFoundDisplayed() but never asserts the final
state, so add a post-retry assertion after the for-loop that fails the test if
isNoNetworkFoundDisplayed() still returns true; locate the block around
manageApplicationsPage.clickOnSearchCheckBox(), the for-loop that calls
clickOnUploadButton(), and add an assertion (e.g., Assert.assertFalse or similar
in your test framework) referencing isNoNetworkFoundDisplayed() with a clear
failure message indicating uploads still report "No Network" after retries.
In
`@ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinUpdateBiometrics.java`:
- Around line 551-558: The retry loop for upload in UpdateMyUinUpdateBiometrics
uses manageApplicationsPage.clickOnUploadButton() and checks
manageApplicationsPage.isNoNetworkFoundDisplayed() but never records or asserts
that an upload succeeded; modify the loop to set a boolean (e.g.,
uploadSucceeded) to true when isNoNetworkFoundDisplayed() is false (or when an
explicit success indicator from the page appears), break out, and after the loop
assert that uploadSucceeded is true (use your test framework's assertion) so the
test fails if all retries show "No Network"; ensure you reference the existing
methods manageApplicationsPage.clickOnUploadButton() and
manageApplicationsPage.isNoNetworkFoundDisplayed() when implementing the check.
- Around line 512-524: The test currently calls
pendingApproval.clickOnAuthenticateButton() on every retry which can
double-submit or hit a stale element; change the flow to call
pendingApproval.clickOnAuthenticateButton() once, then poll up to 3 times using
pendingApproval.isSupervisorAuthenticationTitleDisplayed() with a short
sleep/wait between attempts, breaking when true, and then assert the result
before calling
pendingApproval.enterUserName(KeycloakUserManager.moduleSpecificUser). Ensure
only the initial click is performed and the loop only checks
isSupervisorAuthenticationTitleDisplayed().
In
`@ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinUpdateDocuments.java`:
- Around line 535-542: The retry loop that calls
manageApplicationsPage.clickOnUploadButton() and checks
manageApplicationsPage.isNoNetworkFoundDisplayed() should fail the test if all
retries still show the "no network" banner; update the logic to track success
(e.g., a boolean) when isNoNetworkFoundDisplayed() returns false (meaning upload
started) and after the loop assert that the upload did start (or throw an
assertion/exception) so the test fails when the banner persists; keep the
existing methods clickOnUploadButton(), isNoNetworkFoundDisplayed(), and
clickOnSearchCheckBox() but add the post-loop assertion to enforce failure on
repeated network errors.
In `@ui-test/src/main/java/regclient/utils/TestRunner.java`:
- Line 47: The TestRunner references a non-existing class name
"regclient.androidTestCases.LoginTest" in the XmlClass instantiation inside
TestRunner.java; update the reference to match the actual test class filename or
rename the file: either rename the existing logintest.java to LoginTest.java
(capitalized class name) so the JVM can load
regclient.androidTestCases.LoginTest, or change the XmlClass argument in
TestRunner.java to "regclient.androidTestCases.logintest" to match the current
class name, ensuring the class declaration and filename use identical casing.
♻️ Duplicate comments (3)
ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinInfant.java (1)
426-438: Retry loop is too “hot”; add wait/backoff or explicit wait.Three immediate clicks can complete before the authentication page renders, so the retry doesn’t actually help and may double-submit. Consider a short wait/poll between attempts or a single click followed by a bounded wait using existing BasePage wait/retry helpers.
ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinUpdateBiometrics.java (1)
429-439: Avoid repeated Continue clicks in the retry loop.Line 431 re-clicks Continue each iteration, which can double-submit once navigation starts and still misses a wait between checks. Click once, then poll with a short wait/backoff.
✅ Suggested change
- boolean isAuthenticationPageDisplayed = false; - - for (int i = 0; i < 3; i++) { - previewPage.clickOnContinueButton(); - - if (authenticationPage.isAuthenticationPageDisplayed()) { - isAuthenticationPageDisplayed = true; - break; - } - } + previewPage.clickOnContinueButton(); + boolean isAuthenticationPageDisplayed = false; + for (int i = 0; i < 3; i++) { + Thread.sleep(2000); + if (authenticationPage.isAuthenticationPageDisplayed()) { + isAuthenticationPageDisplayed = true; + break; + } + }ui-test/src/main/java/regclient/page/CameraPage.java (1)
43-52: Remove the stubbed coordinate check (always true) to avoid misleading logic.
isCoordinatesDisplayed()always returnstrue, so the coordinate click is always attempted first and theokButtonpath is delayed regardless of actual UI state. This undermines the intended branching and can hide failures.🛠️ Suggested fix (remove stub and prioritize okButton)
public void clickOkButton() { - - boolean coordinateClicked = false; - for (int i = 0; i < 3; i++) { - - if (!coordinateClicked && isCoordinatesDisplayed(43, 78)) { - clickAtCoordinates(43, 78); - coordinateClicked = true; - } else if (isElementDisplayed(okButton)) { - clickOnElement(okButton); - } + if (isElementDisplayed(okButton)) { + clickOnElement(okButton); + } else { + clickAtCoordinates(43, 78); + } if (isElementDisplayed(retakeButton, 2)) { break; } } } - -private boolean isCoordinatesDisplayed(int x, int y) { - try { - return true; - } catch (Exception e) { - return false; - } -}Also applies to: 78-84
🧹 Nitpick comments (20)
ui-test/src/main/java/regclient/androidTestCases/UpdateMyUINUpdateDemographicDetails.java (2)
405-415: Consider replacing retry-clicks with explicit wait for deterministic behavior.The retry loop without
Thread.sleepis an improvement, but clicking the continue button multiple times could still cause issues like duplicate form submissions or inconsistent state. A single click followed by an explicitWebDriverWaitwould be more reliable:♻️ Suggested refactor using explicit wait
- 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"); + previewPage.clickOnContinueButton(); + boolean isAuthenticationPageDisplayed = + new WebDriverWait(driver, Duration.ofSeconds(10)) + .until(d -> authenticationPage.isAuthenticationPageDisplayed()); + assertTrue(isAuthenticationPageDisplayed, "Authentication page not displayed after wait");Note: This would require adding
import java.time.Duration;andimport org.openqa.selenium.support.ui.WebDriverWait;if not already present.
535-541: Add wait between upload retries to avoid rapid repeated clicks.If the network error is displayed, the loop immediately retries without any delay. This could cause rapid repeated clicks on the upload button, potentially causing UI instability or race conditions.
♻️ Suggested refactor with wait between retries
for (int i = 0; i < 3; i++) { manageApplicationsPage.clickOnUploadButton(); if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) { break; } + // Wait before retry if network error occurred + Thread.sleep(2000); }Alternatively, consider using an explicit wait for a network-ready condition if available, or adding a log statement to indicate retry attempts for debugging purposes.
ui-test/src/main/java/regclient/pages/english/DemographicDetailsPageEnglish.java (2)
242-243: Remove commented-out code.The commented-out line is dead code. If the new
nonForeignerOptionclick is the intended replacement, the old code should be removed entirely rather than left as a comment.♻️ Proposed fix
if (!isElementDisplayed(dropdownElement)) { - // clickOnElement(findElement(By.className("android.view.View"))); clickOnElement(nonForeignerOption);
141-141: Inconsistent wait times across methods.The
fillDemographicDetailsPagemethod now useswaitTime(1)while other methods likeeditDemographicDetailsPage(line 304, 317),fillIntroducerDetailsInDemographicDetailsPage(line 419, 437), andfillRemainDemographicDetailsPage(line 581, 593) still usewaitTime(2)orwaitTime(3).This inconsistency could lead to:
- Flaky tests if 1 second is insufficient on slower devices/emulators
- Confusion about the expected timing behavior
Consider either:
- Applying the reduced wait times consistently across all methods, or
- Extracting the wait duration to a constant for easier tuning
ui-test/src/main/java/regclient/androidTestCases/NewRegistrationMinor.java (2)
478-491: Consider adding a delay between retry attempts.The retry loop repeatedly clicks the continue button without any wait between attempts. If the UI needs time to respond or transition, rapid successive clicks may cause unintended behavior or false negatives.
♻️ Suggested improvement
boolean isAuthenticationPageDisplayed = false; for (int i = 0; i < 3; i++) { previewPage.clickOnContinueButton(); if (authenticationPage.isAuthenticationPageDisplayed()) { isAuthenticationPageDisplayed = true; break; } + Thread.sleep(1000); // Allow UI to settle before retry } assertTrue(isAuthenticationPageDisplayed, "Authentication page not displayed after retries");
559-569: Same retry pattern repeated—consider extracting to a helper and adding delay.This is the second occurrence of the same retry pattern. Similar to the authentication page retry, there's no delay between attempts.
♻️ Suggested helper extraction and delay addition
Consider creating a reusable retry helper in
BasePageor a utility class:// In a utility class or BasePage public static boolean retryUntilTrue(Runnable action, Supplier<Boolean> condition, int maxAttempts, long delayMs) throws InterruptedException { for (int i = 0; i < maxAttempts; i++) { action.run(); if (condition.get()) { return true; } if (i < maxAttempts - 1) { Thread.sleep(delayMs); } } return false; }Then usage becomes:
boolean isPageDisplayed = retryUntilTrue( () -> pendingApproval.clickOnAuthenticateButton(), () -> pendingApproval.isSupervisorAuthenticationTitleDisplayed(), 3, 1000); assertTrue(isPageDisplayed, "Supervisor Authentication page not displayed after retries");ui-test/src/main/java/regclient/page/BasePage.java (3)
124-132: Consider the return value semantics on exception.Returning
true(element is disabled) when an exception occurs might mask actual failures. If the element doesn't exist, that's different from being disabled.♻️ Suggested improvement
protected boolean isElementDisabled(WebElement element) { try { waitForElementToBeVisible(element); return !element.isEnabled() || "false".equalsIgnoreCase(element.getAttribute("clickable")); } catch (Exception e) { - return true; + // Element not found or not visible - consider logging or throwing + return false; // Or handle differently based on use case } }
833-844: Consolidate duplicate methods with inconsistent naming.Two methods perform similar operations:
clickAndsendKeysToTextBoxByLocator(line 833) - uses explicit waitclickAndSendKeysToTextBox(line 892) - useswaitTime(1)(Thread.sleep)The naming is inconsistent (
sendKeysvsSendKeys), and the implementations differ in their wait strategies. Consider consolidating into one method with the explicit wait approach.♻️ Suggested consolidation
-public void clickAndsendKeysToTextBoxByLocator(By locator, String value) { +public void clickAndSendKeysToTextBox(By locator, String value) { WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(20)); wait.ignoring(StaleElementReferenceException.class); - wait.until(Webdriver -> { - WebElement element = Webdriver.findElement(locator); + wait.until(webDriver -> { + WebElement element = webDriver.findElement(locator); element.click(); element.clear(); element.sendKeys(value); + ((HidesKeyboard) driver).hideKeyboard(); return true; }); }Then remove the duplicate method at lines 892-904.
Also applies to: 892-904
837-837: Use consistent camelCase for lambda parameters.The lambda parameter
Webdrivershould follow Java naming conventions aswebDriveror simplydriver.♻️ Suggested fix
- wait.until(Webdriver -> { - WebElement element = Webdriver.findElement(locator); + wait.until(webDriver -> { + WebElement element = webDriver.findElement(locator);Also applies to: 851-851
ui-test/src/main/java/regclient/pages/arabic/LoginPageArabic.java (1)
11-59: Consider documenting the mixed locator pattern.The class now uses both
@AndroidFindBy(for elements likeuserNameTextBox,nextButton) and rawBylocators (forpasswordTextBox,loginButton). This mixed approach may confuse future maintainers. Consider adding a brief comment explaining why certain elements useBylocators (e.g., for explicit timing control or keyboard handling).ui-test/src/main/java/regclient/androidTestCases/PreRegFetchingPacket.java (5)
445-456: Consider adding a delay between retry attempts.The retry loop clicks
Continueup to 3 times without any delay between attempts. Rapid-fire clicks without waiting for UI transitions can cause flaky tests if the page is still transitioning.Additionally, consider extracting the retry count (3) to a constant for maintainability.
♻️ Suggested improvement
+ private static final int MAX_RETRIES = 3; + private static final int RETRY_DELAY_MS = 500;- for (int i = 0; i < 3; i++) { + for (int i = 0; i < MAX_RETRIES; i++) { previewPage.clickOnContinueButton(); - + Thread.sleep(RETRY_DELAY_MS); if (authenticationPage.isAuthenticationPageDisplayed()) { isAuthenticationPageDisplayed = true; break; } }
573-579: Consider handling persistent network unavailability.If the network remains unavailable after all 3 attempts, the test continues without explicit failure handling. This could lead to misleading test results if subsequent assertions pass for unrelated reasons.
Consider adding a warning log or assertion after the loop if all retries are exhausted:
♻️ Suggested improvement
+ boolean uploadSuccessful = false; for (int i = 0; i < 3; i++) { manageApplicationsPage.clickOnUploadButton(); if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) { + uploadSuccessful = true; break; } } + // Optionally log or soft-assert if upload was not successful + if (!uploadSuccessful) { + System.out.println("Warning: Upload may have failed due to network unavailability"); + }
426-426: Unused variableAid.The variable
Aidis assigned but never used. The commented-out linevalidatePreRegAndApplicationIdMatchsuggests this was intended for validation. Either remove the unused variable or implement the intended validation.♻️ Suggested fix
If the validation is not needed:
- String Aid = previewPage.getAID(); - -// previewPage.validatePreRegAndApplicationIdMatch("adult"); + // Remove or implement: previewPage.validatePreRegAndApplicationIdMatch("adult");
154-168: Significant code duplication: Consider using a factory pattern for page object instantiation.The language-based if-else chain for page object creation is repeated 15+ times per test method (LoginPage, RegistrationTasksPage, SelectLanguagePage, ConsentPage, etc.). This pattern is duplicated across all three test methods, resulting in ~45 identical patterns.
This violates the DRY principle and makes maintenance difficult—adding a new language would require changes in 45+ places.
♻️ Suggested refactor using factory pattern
Create a
PageFactoryclass:public class PageFactory { private final AppiumDriver driver; private final String language; public PageFactory(AppiumDriver driver, String language) { this.driver = driver; this.language = language; } public LoginPage createLoginPage() { return switch (language.toLowerCase()) { case "eng" -> new LoginPageEnglish(driver); case "hin" -> new LoginPageHindi(driver); case "fra" -> new LoginPageFrench(driver); case "kan" -> new LoginPageKannada(driver); case "tam" -> new LoginPageTamil(driver); case "ara" -> new LoginPageArabic(driver); default -> throw new IllegalStateException("Unsupported language: " + language); }; } public RegistrationTasksPage createRegistrationTasksPage() { // Similar pattern } // ... other page creation methods }Then in tests:
PageFactory factory = new PageFactory(driver, language); LoginPage loginPage = factory.createLoginPage(); RegistrationTasksPage registrationTasksPage = factory.createRegistrationTasksPage();
1013-1024: Duplicate retry pattern in minor flow.This retry pattern duplicates the one in
adultPreRegFetching. Consider extracting this to a helper method to reduce duplication:♻️ Suggested helper method
private boolean waitForAuthenticationPage(PreviewPage previewPage, AuthenticationPage authenticationPage, int maxRetries) throws InterruptedException { for (int i = 0; i < maxRetries; i++) { previewPage.clickOnContinueButton(); Thread.sleep(500); // Allow UI transition if (authenticationPage.isAuthenticationPageDisplayed()) { return true; } } return false; }Then in tests:
boolean isAuthenticationPageDisplayed = waitForAuthenticationPage(previewPage, authenticationPage, 3); assertTrue(isAuthenticationPageDisplayed, "Authentication page not displayed after retries");ui-test/src/main/java/regclient/utils/TestRunner.java (1)
148-148: Pre-existing typo:outpurshould beoutput.This appears to be a typo in the existing code that may cause the system property to not be recognized correctly.
🔤 Proposed fix
- System.getProperties().setProperty("testng.outpur.dir", "testng-report"); + System.getProperties().setProperty("testng.output.dir", "testng-report");ui-test/src/main/java/regclient/androidTestCases/BiometricCorrection.java (1)
1847-1861: Consider a factory pattern to reduce language-switch duplication.This if/else-if chain for language-specific page instantiation is repeated ~20+ times in this file alone. A factory utility would centralize the logic and improve maintainability:
♻️ Example factory approach
// PageFactory.java public class PageFactory { `@SuppressWarnings`("unchecked") public static <T> T createPage(Class<T> pageInterface, AndroidDriver driver, String language) { String langPackage = getLanguagePackage(language); String implClassName = pageInterface.getSimpleName() + getLanguageSuffix(language); // ... instantiate via reflection or use a registry map } } // Usage: ProfilePage profilePage = PageFactory.createPage(ProfilePage.class, driver, language);This would replace repetitive blocks throughout the test suite.
ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinMinor.java (2)
545-556: Avoid tight retry loop without a wait between navigation attempts.Line 547–552 retries immediately after a click; if navigation is still in progress, rapid re-clicks can cause flakiness or duplicate actions. Consider adding a small wait/poll (e.g., via existing BasePage wait helpers) before the next retry.
632-643: Add a short wait/poll between authenticate retries.Line 634–640 re-clicks without any wait. This can spam the UI while the supervisor auth screen is still loading and make the test flaky. A brief wait/poll between retries will stabilize this flow.
ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinUpdateDocuments.java (1)
403-415: Add a short wait/backoff between authentication retries.The loop clicks Continue three times back-to-back; if the transition is slow, you can trigger rapid duplicate clicks or hit stale elements. Consider adding a small wait or a wait-for-visible helper between attempts to reduce flakiness.
| throw new IllegalStateException("Unsupported language in testdata.json: " + language); | ||
| } | ||
| profilePage.clickOnLogoutButton(); | ||
| assertTrue(loginPage.isLoginPageLoaded(), "verify if login page is displayeded in Selected language"); |
There was a problem hiding this comment.
Typo in assertion message: "displayeded" → "displayed".
- assertTrue(loginPage.isLoginPageLoaded(), "verify if login page is displayeded in Selected language");
+ assertTrue(loginPage.isLoginPageLoaded(), "verify if login page is displayed in selected language");📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| assertTrue(loginPage.isLoginPageLoaded(), "verify if login page is displayeded in Selected language"); | |
| assertTrue(loginPage.isLoginPageLoaded(), "verify if login page is displayed in selected language"); |
🤖 Prompt for AI Agents
In `@ui-test/src/main/java/regclient/androidTestCases/BiometricCorrection.java` at
line 1863, Fix the typo in the assertion message for the call to
loginPage.isLoginPageLoaded(): replace "displayeded" with "displayed" so the
assertion reads "verify if login page is displayed in Selected language" to
ensure the message is correct and readable.
| for (int i = 0; i < 3; i++) { | ||
| manageApplicationsPage.clickOnUploadButton(); | ||
| Thread.sleep(2000); | ||
| if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) | ||
|
|
||
| if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) { | ||
| break; | ||
| } | ||
| } |
There was a problem hiding this comment.
Add a post-retry assertion so upload failures don’t pass silently.
Currently the loop exits after 3 attempts even if “No Network Found” persists, so the test can pass without a successful upload. Consider asserting success after retries.
✅ Suggested guard (apply to both loops)
- for (int i = 0; i < 3; i++) {
- manageApplicationsPage.clickOnUploadButton();
-
- if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) {
- break;
- }
- }
+ boolean uploadSucceeded = false;
+ for (int i = 0; i < 3; i++) {
+ manageApplicationsPage.clickOnUploadButton();
+ if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) {
+ uploadSucceeded = true;
+ break;
+ }
+ }
+ assertTrue(uploadSucceeded, "Upload failed after retries (No Network Found)");Also applies to: 1323-1329
🤖 Prompt for AI Agents
In `@ui-test/src/main/java/regclient/androidTestCases/NewRegistrationAdult.java`
around lines 598 - 604, The retry loop around
manageApplicationsPage.clickOnUploadButton currently gives up after 3 attempts
without failing the test; after the loop (for both occurrences) add a post-retry
assertion that verifies the upload succeeded by asserting
manageApplicationsPage.isNoNetworkFoundDisplayed() is false (or that a success
indicator is present) and fail the test if the “No Network Found” message still
persists so failures don’t pass silently.
| // @Test(priority = 1, description = "Verify adult new registration") | ||
| public void newRegistrationAdultUploadMultipleDoccuments() throws InterruptedException { |
There was a problem hiding this comment.
The test is now disabled—please confirm intent.
Commenting out @Test removes coverage for multi-document uploads. If this is intentional, add an explicit disable with a ticket reference; otherwise re-enable the test.
🔧 Suggested fix (re-enable test)
-// `@Test`(priority = 1, description = "Verify adult new registration")
+@Test(priority = 1, description = "Verify adult new registration")📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // @Test(priority = 1, description = "Verify adult new registration") | |
| public void newRegistrationAdultUploadMultipleDoccuments() throws InterruptedException { | |
| `@Test`(priority = 1, description = "Verify adult new registration") | |
| public void newRegistrationAdultUploadMultipleDoccuments() throws InterruptedException { |
🤖 Prompt for AI Agents
In `@ui-test/src/main/java/regclient/androidTestCases/NewRegistrationAdult.java`
around lines 631 - 632, The method newRegistrationAdultUploadMultipleDoccuments
currently has its `@Test` annotation commented out, which silently disables the
test; either re-enable the test by restoring the `@Test` annotation above
newRegistrationAdultUploadMultipleDoccuments so it runs as part of the suite, or
explicitly disable it with a clear `@Test`(enabled = false, description = "...",
groups = {...}) or a TestNG `@Disabled` equivalent and include a ticket/reference
ID and reason; update the method's annotation accordingly and ensure the method
name newRegistrationAdultUploadMultipleDoccuments is left unchanged.
| for (int i = 0; i < 3; i++) { | ||
| manageApplicationsPage.clickOnUploadButton(); | ||
|
|
||
| if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) { | ||
| break; | ||
| } | ||
| } |
There was a problem hiding this comment.
Upload retry loop lacks delay and doesn't assert on failure.
Unlike the previous retry loops, this one has no assertion if all retries fail. If the network issue persists after 3 attempts, the test silently continues, which may lead to confusing failures downstream.
🐛 Suggested fix
+boolean uploadSuccessful = false;
for (int i = 0; i < 3; i++) {
manageApplicationsPage.clickOnUploadButton();
if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) {
+ uploadSuccessful = true;
break;
}
+ Thread.sleep(1000); // Allow network recovery time
}
+assertTrue(uploadSuccessful, "Upload failed after retries due to network issues");🤖 Prompt for AI Agents
In `@ui-test/src/main/java/regclient/androidTestCases/NewRegistrationMinor.java`
around lines 595 - 601, The retry loop around
manageApplicationsPage.clickOnUploadButton() needs a short delay between
attempts and a final assertion to fail the test if the "no network" condition
persists; modify the loop to sleep (e.g., Thread.sleep or a test util wait)
between retries and after the loop assert that
manageApplicationsPage.isNoNetworkFoundDisplayed() is false (or explicitly fail)
so the test does not continue silently when uploads never succeed.
| boolean isPageDisplayed = false; | ||
|
|
||
| for (int i = 0; i < 3; i++) { | ||
| pendingApproval.clickOnAuthenticateButton(); | ||
| Thread.sleep(2000); | ||
| if (pendingApproval.isSupervisorAuthenticationTitleDisplayed()) { | ||
| isPageDisplayed = true; | ||
| break; | ||
| } | ||
| pendingApproval.clickOnAuthenticateButton(); | ||
|
|
||
| if (pendingApproval.isSupervisorAuthenticationTitleDisplayed()) { | ||
| isPageDisplayed = true; | ||
| break; | ||
| } | ||
| } | ||
| assertTrue(isPageDisplayed, "Supervisor Authentication page not displayed after retries"); |
There was a problem hiding this comment.
Same hot-loop issue in supervisor auth retry.
This loop also retries without any wait/poll, so it can fail even when the UI would appear moments later. Add a short backoff or a bounded wait after clicking Authenticate.
🤖 Prompt for AI Agents
In `@ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinInfant.java`
around lines 505 - 515, The retry loop around
pendingApproval.clickOnAuthenticateButton() and
pendingApproval.isSupervisorAuthenticationTitleDisplayed() is a hot loop; after
each click add a short bounded wait/poll before re-checking (e.g., sleep
500–1000ms or use the existing UI wait/poll util) to allow the Supervisor
Authentication UI to appear, and keep the retry count/timeout bounded; update
the logic that sets isPageDisplayed accordingly so the assertion remains
meaningful if the page never appears.
| manageApplicationsPage.clickOnSearchCheckBox(); | ||
| manageApplicationsPage.clickOnUploadButton(); | ||
| for (int i = 0; i < 3; i++) { | ||
| manageApplicationsPage.clickOnUploadButton(); | ||
|
|
||
| // assertTrue(manageApplicationsPage.isPacketUploadDone(Aid), "Verify if packet | ||
| // upload is done"); | ||
| if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) { | ||
| break; | ||
| } | ||
| } |
There was a problem hiding this comment.
Fail fast if upload still reports “No Network” after retries.
Line 675–681 retries but never asserts success, so the test can pass even when uploads never complete. Add a post-retry assertion to avoid false positives.
Proposed fix
- manageApplicationsPage.clickOnSearchCheckBox();
- for (int i = 0; i < 3; i++) {
- manageApplicationsPage.clickOnUploadButton();
-
- if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) {
- break;
- }
- }
+ manageApplicationsPage.clickOnSearchCheckBox();
+ boolean uploadSucceeded = false;
+ for (int i = 0; i < 3; i++) {
+ manageApplicationsPage.clickOnUploadButton();
+
+ if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) {
+ uploadSucceeded = true;
+ break;
+ }
+ }
+ assertTrue(uploadSucceeded, "Upload failed: No network after retries");📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| manageApplicationsPage.clickOnSearchCheckBox(); | |
| manageApplicationsPage.clickOnUploadButton(); | |
| for (int i = 0; i < 3; i++) { | |
| manageApplicationsPage.clickOnUploadButton(); | |
| // assertTrue(manageApplicationsPage.isPacketUploadDone(Aid), "Verify if packet | |
| // upload is done"); | |
| if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) { | |
| break; | |
| } | |
| } | |
| manageApplicationsPage.clickOnSearchCheckBox(); | |
| boolean uploadSucceeded = false; | |
| for (int i = 0; i < 3; i++) { | |
| manageApplicationsPage.clickOnUploadButton(); | |
| if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) { | |
| uploadSucceeded = true; | |
| break; | |
| } | |
| } | |
| assertTrue(uploadSucceeded, "Upload failed: No network after retries"); |
🤖 Prompt for AI Agents
In `@ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinMinor.java`
around lines 675 - 682, The retry loop using
manageApplicationsPage.clickOnUploadButton() checks
manageApplicationsPage.isNoNetworkFoundDisplayed() but never asserts the final
state, so add a post-retry assertion after the for-loop that fails the test if
isNoNetworkFoundDisplayed() still returns true; locate the block around
manageApplicationsPage.clickOnSearchCheckBox(), the for-loop that calls
clickOnUploadButton(), and add an assertion (e.g., Assert.assertFalse or similar
in your test framework) referencing isNoNetworkFoundDisplayed() with a clear
failure message indicating uploads still report "No Network" after retries.
| boolean isPageDisplayed = false; | ||
|
|
||
| for (int i = 0; i < 3; i++) { | ||
| pendingApproval.clickOnAuthenticateButton(); | ||
| Thread.sleep(2000); | ||
| if (pendingApproval.isSupervisorAuthenticationTitleDisplayed()) { | ||
| isPageDisplayed = true; | ||
| break; | ||
| } | ||
| pendingApproval.clickOnAuthenticateButton(); | ||
|
|
||
| if (pendingApproval.isSupervisorAuthenticationTitleDisplayed()) { | ||
| isPageDisplayed = true; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| assertTrue(isPageDisplayed, "Verify if Supervisor Authentication page displayed after retries"); | ||
| assertTrue(isPageDisplayed, "Verify if Supervisor Authentication page not displayed after retries"); | ||
| pendingApproval.enterUserName(KeycloakUserManager.moduleSpecificUser); |
There was a problem hiding this comment.
Click Authenticate once, then poll for the supervisor page.
Line 515 clicks Authenticate on every retry, which can double-submit or hit a stale element. Click once and then poll with a short wait.
✅ Suggested change
- boolean isPageDisplayed = false;
- for (int i = 0; i < 3; i++) {
- pendingApproval.clickOnAuthenticateButton();
-
- if (pendingApproval.isSupervisorAuthenticationTitleDisplayed()) {
- isPageDisplayed = true;
- break;
- }
- }
+ pendingApproval.clickOnAuthenticateButton();
+ boolean isPageDisplayed = false;
+ for (int i = 0; i < 3; i++) {
+ Thread.sleep(2000);
+ if (pendingApproval.isSupervisorAuthenticationTitleDisplayed()) {
+ isPageDisplayed = true;
+ break;
+ }
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| boolean isPageDisplayed = false; | |
| for (int i = 0; i < 3; i++) { | |
| pendingApproval.clickOnAuthenticateButton(); | |
| Thread.sleep(2000); | |
| if (pendingApproval.isSupervisorAuthenticationTitleDisplayed()) { | |
| isPageDisplayed = true; | |
| break; | |
| } | |
| pendingApproval.clickOnAuthenticateButton(); | |
| if (pendingApproval.isSupervisorAuthenticationTitleDisplayed()) { | |
| isPageDisplayed = true; | |
| break; | |
| } | |
| } | |
| assertTrue(isPageDisplayed, "Verify if Supervisor Authentication page displayed after retries"); | |
| assertTrue(isPageDisplayed, "Verify if Supervisor Authentication page not displayed after retries"); | |
| pendingApproval.enterUserName(KeycloakUserManager.moduleSpecificUser); | |
| pendingApproval.clickOnAuthenticateButton(); | |
| boolean isPageDisplayed = false; | |
| for (int i = 0; i < 3; i++) { | |
| Thread.sleep(2000); | |
| if (pendingApproval.isSupervisorAuthenticationTitleDisplayed()) { | |
| isPageDisplayed = true; | |
| break; | |
| } | |
| } | |
| assertTrue(isPageDisplayed, "Verify if Supervisor Authentication page not displayed after retries"); | |
| pendingApproval.enterUserName(KeycloakUserManager.moduleSpecificUser); |
🤖 Prompt for AI Agents
In
`@ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinUpdateBiometrics.java`
around lines 512 - 524, The test currently calls
pendingApproval.clickOnAuthenticateButton() on every retry which can
double-submit or hit a stale element; change the flow to call
pendingApproval.clickOnAuthenticateButton() once, then poll up to 3 times using
pendingApproval.isSupervisorAuthenticationTitleDisplayed() with a short
sleep/wait between attempts, breaking when true, and then assert the result
before calling
pendingApproval.enterUserName(KeycloakUserManager.moduleSpecificUser). Ensure
only the initial click is performed and the loop only checks
isSupervisorAuthenticationTitleDisplayed().
| manageApplicationsPage.clickOnSearchCheckBox(); | ||
| manageApplicationsPage.clickOnUploadButton(); | ||
| for (int i = 0; i < 3; i++) { | ||
| manageApplicationsPage.clickOnUploadButton(); | ||
|
|
||
| if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) { | ||
| break; | ||
| } | ||
| } |
There was a problem hiding this comment.
Assert upload success after retries to avoid false positives.
Lines 552-558 retry uploads but never assert success; the test can pass even if “No Network” persists. Track success and assert after retries.
✅ Suggested change
manageApplicationsPage.clickOnSearchCheckBox();
- for (int i = 0; i < 3; i++) {
- manageApplicationsPage.clickOnUploadButton();
-
- if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) {
- break;
- }
- }
+ boolean uploadSucceeded = false;
+ for (int i = 0; i < 3; i++) {
+ manageApplicationsPage.clickOnUploadButton();
+ if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) {
+ uploadSucceeded = true;
+ break;
+ }
+ Thread.sleep(2000);
+ }
+ assertTrue(uploadSucceeded, "Upload failed after retries (No Network still displayed)");📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| manageApplicationsPage.clickOnSearchCheckBox(); | |
| manageApplicationsPage.clickOnUploadButton(); | |
| for (int i = 0; i < 3; i++) { | |
| manageApplicationsPage.clickOnUploadButton(); | |
| if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) { | |
| break; | |
| } | |
| } | |
| manageApplicationsPage.clickOnSearchCheckBox(); | |
| boolean uploadSucceeded = false; | |
| for (int i = 0; i < 3; i++) { | |
| manageApplicationsPage.clickOnUploadButton(); | |
| if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) { | |
| uploadSucceeded = true; | |
| break; | |
| } | |
| Thread.sleep(2000); | |
| } | |
| assertTrue(uploadSucceeded, "Upload failed after retries (No Network still displayed)"); |
🤖 Prompt for AI Agents
In
`@ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinUpdateBiometrics.java`
around lines 551 - 558, The retry loop for upload in UpdateMyUinUpdateBiometrics
uses manageApplicationsPage.clickOnUploadButton() and checks
manageApplicationsPage.isNoNetworkFoundDisplayed() but never records or asserts
that an upload succeeded; modify the loop to set a boolean (e.g.,
uploadSucceeded) to true when isNoNetworkFoundDisplayed() is false (or when an
explicit success indicator from the page appears), break out, and after the loop
assert that uploadSucceeded is true (use your test framework's assertion) so the
test fails if all retries show "No Network"; ensure you reference the existing
methods manageApplicationsPage.clickOnUploadButton() and
manageApplicationsPage.isNoNetworkFoundDisplayed() when implementing the check.
| manageApplicationsPage.clickOnSearchCheckBox(); | ||
| manageApplicationsPage.clickOnUploadButton(); | ||
| for (int i = 0; i < 3; i++) { | ||
| manageApplicationsPage.clickOnUploadButton(); | ||
|
|
||
| // assertTrue(manageApplicationsPage.isPacketUploadDone(Aid), "Verify if packet | ||
| // upload is done"); | ||
| if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) { | ||
| break; | ||
| } | ||
| } |
There was a problem hiding this comment.
Fail the test if upload never starts after retries.
If the “no network” banner keeps appearing, the test currently proceeds without asserting that upload actually started, which can mask failures in a documents-update flow.
🔧 Proposed fix
manageApplicationsPage.clickOnSearchCheckBox();
+boolean isUploadTriggered = false;
for (int i = 0; i < 3; i++) {
manageApplicationsPage.clickOnUploadButton();
if (!manageApplicationsPage.isNoNetworkFoundDisplayed()) {
+ isUploadTriggered = true;
break;
}
}
+assertTrue(isUploadTriggered, "Upload not started after retries (network still unavailable)");
manageApplicationsPage.clickOnBackButton();🤖 Prompt for AI Agents
In
`@ui-test/src/main/java/regclient/androidTestCases/UpdateMyUinUpdateDocuments.java`
around lines 535 - 542, The retry loop that calls
manageApplicationsPage.clickOnUploadButton() and checks
manageApplicationsPage.isNoNetworkFoundDisplayed() should fail the test if all
retries still show the "no network" banner; update the logic to track success
(e.g., a boolean) when isNoNetworkFoundDisplayed() returns false (meaning upload
started) and after the loop assert that the upload did start (or throw an
assertion/exception) so the test fails when the banner persists; keep the
existing methods clickOnUploadButton(), isNoNetworkFoundDisplayed(), and
clickOnSearchCheckBox() but add the post-loop assertion to enforce failure on
repeated network errors.
| XmlClass addMachineDetails = new XmlClass("regclient.androidTestCases.AddMachineDetails"); | ||
| XmlClass initialLaunch = new XmlClass("regclient.androidTestCases.InitialLaunch"); | ||
| XmlClass logintest = new XmlClass("regclient.androidTestCases.Logintest"); | ||
| XmlClass loginTest = new XmlClass("regclient.androidTestCases.LoginTest"); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Search for LoginTest.java file
fd -t f "LoginTest.java"Repository: mosip/android-registration-client
Length of output: 59
🏁 Script executed:
# Read the TestRunner.java file to see lines 47, 80-81
cat -n ui-test/src/main/java/regclient/utils/TestRunner.java | sed -n '40,85p'Repository: mosip/android-registration-client
Length of output: 3034
🏁 Script executed:
# Also check if old reference "Logintest" or "logintest" still exists in TestRunner.java
rg -i "logintest|Logintest" ui-test/src/main/java/regclient/utils/TestRunner.javaRepository: mosip/android-registration-client
Length of output: 235
🏁 Script executed:
# Search for the androidTestCases directory
fd -t d "androidTestCases"Repository: mosip/android-registration-client
Length of output: 126
🏁 Script executed:
# List all test classes in the androidTestCases directory if it exists
fd -t f "\.java$" | grep -i "androidTestCases" | head -20Repository: mosip/android-registration-client
Length of output: 1477
🏁 Script executed:
# Specifically search for any class named "LoginTest" (case-insensitive)
fd -t f -i "logintest.java"Repository: mosip/android-registration-client
Length of output: 140
TestRunner.java line 47 references regclient.androidTestCases.LoginTest, but the actual test class file is named logintest.java (lowercase). The old file was not renamed—both names currently do not match. This will cause a ClassNotFoundException at runtime when the test suite tries to load the class.
Either rename logintest.java to LoginTest.java or update line 47 to reference the correct class name.
🤖 Prompt for AI Agents
In `@ui-test/src/main/java/regclient/utils/TestRunner.java` at line 47, The
TestRunner references a non-existing class name
"regclient.androidTestCases.LoginTest" in the XmlClass instantiation inside
TestRunner.java; update the reference to match the actual test class filename or
rename the file: either rename the existing logintest.java to LoginTest.java
(capitalized class name) so the JVM can load
regclient.androidTestCases.LoginTest, or change the XmlClass argument in
TestRunner.java to "regclient.androidTestCases.logintest" to match the current
class name, ensuring the class declaration and filename use identical casing.
MOSIP-44176:ARC - Run the ARC UI automation in Arab language
Summary by CodeRabbit
New Features
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.