MOSIP-44875- Automated 17 new test cases for window reg client #772
MOSIP-44875- Automated 17 new test cases for window reg client #772jayesh12234 wants to merge 13 commits into
Conversation
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>
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughThe 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
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 | 🔴 CriticalFix method signature mismatch causing compile failure.
verifyOnbard()inLoginPage.java(line 378) now accepts onlyidentity, butNewReg.java(line 172) still calls it withverifyOnbard(operatorPwd, jsoncontent). This will fail compilation.Additionally, the method body clicks
#sub2without populating the password field. Either restore the two-parameter signature and password entry logic, or update the call site to pass onlyidentityand 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
📒 Files selected for processing (5)
registration/registration-test/src/main/java/registrationtest/controls/Buttons.javaregistration/registration-test/src/main/java/registrationtest/pages/LoginPage.javaregistration/registration-test/src/main/java/registrationtest/utility/JsonUtil.javaregistration/registration-test/src/main/java/registrationtest/utility/WaitsUtil.javaregistration/registration-test/src/main/resources/repository_eng/2operatoronboard.json
Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
Signed-off-by: Jayesh Kharode <jayesh.kharode@technoforte.co.in>
MOSIP-44875- Automated 17 new test cases for window reg client
Summary by CodeRabbit
New Features
Tests