Skip to content

MOSIP-44875- Automated 17 new test cases for window reg client #772

Open
jayesh12234 wants to merge 13 commits into
mosip:developfrom
jayesh12234:develop
Open

MOSIP-44875- Automated 17 new test cases for window reg client #772
jayesh12234 wants to merge 13 commits into
mosip:developfrom
jayesh12234:develop

Conversation

@jayesh12234
Copy link
Copy Markdown

@jayesh12234 jayesh12234 commented Apr 22, 2026

MOSIP-44875- Automated 17 new test cases for window reg client

Summary by CodeRabbit

  • New Features

    • Added button interaction controls for next button and submit button state verification
    • Added login validation test scenarios including invalid credentials and missing field handling
    • Added back button functionality verification
  • Tests

    • Enhanced test data with invalid credential scenarios
    • Expanded test utilities for node presence validation and assertion handling

Jayesh Kharode added 11 commits March 2, 2026 17:37
Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Warning

Rate limit exceeded

@jayesh12234 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 32 minutes and 32 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 32 minutes and 32 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 43cd23b0-adff-455a-9a90-002c96a1923c

📥 Commits

Reviewing files that changed from the base of the PR and between f66bd1a and 0639230.

📒 Files selected for processing (6)
  • registration/registration-test/src/main/java/registrationtest/controls/Buttons.java
  • registration/registration-test/src/main/java/registrationtest/testcases/BioCorrectionReg.java
  • registration/registration-test/src/main/java/registrationtest/testcases/LostReg.java
  • registration/registration-test/src/main/java/registrationtest/testcases/NewReg.java
  • registration/registration-test/src/main/java/registrationtest/testcases/UpdateReg.java
  • registration/registration-test/src/main/java/registrationtest/utility/JsonUtil.java

Walkthrough

The changes extend the test automation framework by adding new button controls, validation test methods for login scenarios, JSON parsing utilities, and assertion helpers for waiting and verifying node states. A test data configuration file is updated with invalid credentials.

Changes

Cohort / File(s) Summary
Test Controls
registration/registration-test/src/main/java/registrationtest/controls/Buttons.java
Added nextbtn selector and three new public methods: clickNextBtn() for interacting with the next button, plus verifySubmitButtonDisabled() and verifySubmitButtonEnabled() for asserting submit button state.
Test Pages
registration/registration-test/src/main/java/registrationtest/pages/LoginPage.java
Added six new test methods covering invalid/empty userid/password scenarios and back button verification. Refactored verifyOnbard() signature to remove password parameter. New methods include explicit exception handling with assertion vs. general exception branching.
Test Utilities
registration/registration-test/src/main/java/registrationtest/utility/WaitsUtil.java, registration/registration-test/src/main/java/registrationtest/utility/JsonUtil.java
Extended utilities with new methods: waitForNodePresent(), assertNodeDisabled(), and assertNodeEnabled() in WaitsUtil; getIdentityValue() in JsonUtil for JSON field extraction using Jackson's ObjectMapper.
Test Data
registration/registration-test/src/main/resources/repository_eng/2operatoronboard.json
Updated configuration to include invalid username and password test values under the identity object.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Buttons now jump with purpose bright,
Login tests validate with all their might,
JSON fields parsed, assertions stand tall,
With invalid credentials—we test it all! 🎯

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% 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 references automating 17 new test cases for a Windows registration client, which aligns with the changes across multiple test utility and page classes adding new test methods and verification helpers.
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.


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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
registration/registration-test/src/main/java/registrationtest/pages/LoginPage.java (1)

378-398: ⚠️ Potential issue | 🔴 Critical

Fix method signature mismatch causing compile failure.

verifyOnbard() in LoginPage.java (line 378) now accepts only identity, but NewReg.java (line 172) still calls it with verifyOnbard(operatorPwd, jsoncontent). This will fail compilation.

Additionally, the method body clicks #sub2 without populating the password field. Either restore the two-parameter signature and password entry logic, or update the call site to pass only identity and handle password entry separately.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@registration/registration-test/src/main/java/registrationtest/pages/LoginPage.java`
around lines 378 - 398, The method verifyOnbard currently takes a single
parameter (identity) but NewReg calls verifyOnbard(operatorPwd, jsoncontent);
restore the original two-parameter signature or change the caller—fix by
updating LoginPage.verifyOnbard to accept (String operatorPwd, String identity)
and reintroduce the password-entry logic before clicking "#sub2" (e.g., populate
the password field using the appropriate waitsUtil or input method), then
proceed with the existing clicks and the call to verifyOnboardBio(identity);
ensure the method name verifyOnbard and inner uses of
waitsUtil.clickNodeAssert("#sub2"), waitsUtil.clickNodeAssert("#homeImgView")
and verifyOnboardBio(identity) remain consistent so NewReg.java compiles.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@registration/registration-test/src/main/java/registrationtest/controls/Buttons.java`:
- Line 14: In Buttons.java remove the duplicate selector by either deleting the
redundant field nextbtn or assigning it to the correct unique selector instead
of "#next" (inspect the intent for a distinct element), update all usages
accordingly (e.g., use next or nextbtn consistently), and consolidate/remove the
duplicated methods clickNextBtn() / clicknextBtn(); ensure the remaining
method's logger message matches the method name (replace the incorrect
"clickContinueBtn" log label with "clickNextBtn" or the correct method name) and
apply the same cleanup to the other duplicate declarations/usages referenced
around lines 40-44.

In
`@registration/registration-test/src/main/java/registrationtest/pages/LoginPage.java`:
- Around line 143-147: The test is asserting only that the input field
(userIdTextField) contains the typed value after
waitsUtil.waitForNode("#context"), which can be fooled by unrelated popups;
update the invalid-login flow to wait for and assert the actual visible error
message or element (e.g., an error node with id/class shown in the UI) instead
of or in addition to checking userIdTextField.getText(), and only log
non-sensitive info via ExtentReportUtil.test1 (do not log password candidates or
secret values). Specifically, replace the current check around
waitsUtil.waitForNode("#context")/userIdTextField.getText() and the
ExtentReportUtil.test1.info call with logic that waitsForNode the explicit
invalid-login error selector, asserts its text matches the expected error, call
ExtentReportUtil.test1.pass() only after that assertion, and remove any logging
of credential values; apply the same change to the other flow at the lines noted
(283-287).
- Around line 187-243: The debug helper printAllIds()/printIdsFromNode() is
dumping UI text (including TextInputControl contents) to stdout which may expose
secrets; remove this helper before merging or modify printIdsFromNode(Node) to
never print raw text: for TextInputControl and any node whose id or type
suggests secrets (e.g., PasswordField, fields with "password"|"secret"|"token"
in the id) replace the text with a masked value like "<redacted>" or show only
length (e.g., "<redacted:5>"), and ensure logger.error is used instead of
System.out where appropriate, keep traversal logic (Window.getWindows()/Parent
children) but redact or omit sensitive text before printing.
- Around line 151-154: The catch blocks in LoginPage.java catch Exception and
rethrow it (e.g., in the blocks around lines handling logger.error(...) and
ExtentReportUtil.test1.fail(...)), but the methods do not declare throws
Exception, causing compile errors; modify each catch(Exception e) handler in
methods of class LoginPage (the ones that call logger.error("", e) and
ExtentReportUtil.test1.fail(...)) to either wrap and rethrow as an unchecked
exception (for example throw new RuntimeException(e)) or change the method
signatures to declare the specific checked exception(s) thrown; ensure you
update all affected catch sites (the blocks at the reported locations)
consistently and keep the logging/reporting calls unchanged.

In
`@registration/registration-test/src/main/java/registrationtest/utility/JsonUtil.java`:
- Around line 57-66: The method getIdentityValue currently creates a new
ObjectMapper and returns an empty string when the requested key is missing;
change it to use the shared ObjectMapper instance used elsewhere in the class
(instead of new ObjectMapper()), parse the JSON with that mapper, then
explicitly check that rootNode.get("identity") and the requested child node (by
key) are present and not missing/NullNode (e.g., node.get("identity") != null &&
node.get("identity").has(key) or node.get(key) != null); if the identity object
or key is absent throw a clear unchecked exception (IllegalArgumentException)
with a message that includes the missing key and the original identity string,
and let JSON parsing errors propagate instead of swallowing them with
logger.error.

---

Outside diff comments:
In
`@registration/registration-test/src/main/java/registrationtest/pages/LoginPage.java`:
- Around line 378-398: The method verifyOnbard currently takes a single
parameter (identity) but NewReg calls verifyOnbard(operatorPwd, jsoncontent);
restore the original two-parameter signature or change the caller—fix by
updating LoginPage.verifyOnbard to accept (String operatorPwd, String identity)
and reintroduce the password-entry logic before clicking "#sub2" (e.g., populate
the password field using the appropriate waitsUtil or input method), then
proceed with the existing clicks and the call to verifyOnboardBio(identity);
ensure the method name verifyOnbard and inner uses of
waitsUtil.clickNodeAssert("#sub2"), waitsUtil.clickNodeAssert("#homeImgView")
and verifyOnboardBio(identity) remain consistent so NewReg.java compiles.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 7ec6ffa3-c01d-4794-b155-655431c15efb

📥 Commits

Reviewing files that changed from the base of the PR and between ab362c1 and f66bd1a.

📒 Files selected for processing (5)
  • registration/registration-test/src/main/java/registrationtest/controls/Buttons.java
  • registration/registration-test/src/main/java/registrationtest/pages/LoginPage.java
  • registration/registration-test/src/main/java/registrationtest/utility/JsonUtil.java
  • registration/registration-test/src/main/java/registrationtest/utility/WaitsUtil.java
  • registration/registration-test/src/main/resources/repository_eng/2operatoronboard.json

Jayesh Kharode added 2 commits April 22, 2026 12:39
Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
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.

4 participants