MOSIP-45321: Fixed the signup issue and added specific feature file to execute the required test scenarios. - #2196
Conversation
… execute the required test scenarios. Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
WalkthroughSignup UI tests now support configured feature-file selection, metadata-driven exact-length identifier generation, wrapped form-control matching, and blank configuration placeholders. ChangesFeature execution filtering
Signup input generation and matching
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant TestNG
participant Runner
participant Config
participant PickleWrapper
TestNG->>Runner: request scenarios
Runner->>Config: read featureFilesToExecute
Runner->>PickleWrapper: inspect scenario URI
Runner-->>TestNG: return selected scenarios
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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: 5
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/pages/SignupFormDynamicFiller.java (1)
45-58: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winFilter wrapper descendants by
controlTypebefore selecting one.The expanded XPath can return a hidden input plus a visible control, or multiple control types.
matchingElements.get(0)may therefore select the wrong element, causing the hidden-field skip at Line [86],Selectfailures, or an invalid random checkbox click. Filter the results by control type and exclude hidden descendants before using the first/random element; re-check for an empty list afterward.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ui-test/src/main/java/pages/SignupFormDynamicFiller.java` around lines 45 - 58, Update the matchingElements selection in SignupFormDynamicFiller to filter wrapper descendants by the expected controlType and exclude hidden inputs or controls before selecting an element. Re-check the filtered list for emptiness and continue when no valid controls remain, then use the filtered list for the existing first/random selection paths.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ui-test/src/main/java/runners/Runner.java`:
- Around line 125-145: The feature-filtering logic in the requestedFeatures path
must not return an empty scenario array when no configured feature matches.
After building filtered in Runner, return the original scenarios and log a
warning when filtered is empty; retain the existing filtered result and info log
when matches are found.
- Line 121: Update feature-name normalization in Runner to use Locale.ROOT when
lowercasing trimmed configuration values and URI-derived file names. Apply the
same locale-independent folding to the .feature suffix check and
requestedFeatures lookup, adding the necessary Locale import.
In `@ui-test/src/main/java/stepdefinitions/ConsentStepDefinition.java`:
- Around line 62-68: Remove the unused lastGeneratedIdentifier field and its
assignment in userEnterValidMobileNumber, since
RegisteredDetails.setMobileNumber(value) already preserves the generated value
for later steps; do not add a new consumer unless an existing assertion
explicitly requires it.
In `@ui-test/src/main/java/utils/EsignetUtil.java`:
- Around line 789-792: Update the candidate generation logic around the
leading-digit handling in EsignetUtil so regex validation is the contract:
generate or retry candidates until they match the supplied regex, preserving
valid zero-prefixed patterns such as ^0[0-9]{8}$. Only replace a leading zero
when the configured regex explicitly requires a non-zero first digit, rather
than applying the rule to every numeric candidate.
- Around line 747-750: Update generateValueFromRegex in EsignetUtil so null or
empty regex inputs with a requested exactLength fail fast instead of returning
"defaultValue"; preserve the existing fallback only when no exact length is
requested. Ensure the failure is explicit and prevents the invalid value from
reaching the signup/OTP flow.
---
Outside diff comments:
In `@ui-test/src/main/java/pages/SignupFormDynamicFiller.java`:
- Around line 45-58: Update the matchingElements selection in
SignupFormDynamicFiller to filter wrapper descendants by the expected
controlType and exclude hidden inputs or controls before selecting an element.
Re-check the filtered list for emptiness and continue when no valid controls
remain, then use the filtered list for the existing first/random selection
paths.
🪄 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: c9f31dd2-cbfd-424f-a9ff-f87019fb8249
📒 Files selected for processing (5)
ui-test/src/main/java/pages/SignupFormDynamicFiller.javaui-test/src/main/java/runners/Runner.javaui-test/src/main/java/stepdefinitions/ConsentStepDefinition.javaui-test/src/main/java/utils/EsignetUtil.javaui-test/src/main/resources/config.properties
… execute the required test scenarios. Signed-off-by: damodarguru <damodar.g@cyberpwn.com>
zesu22
left a comment
There was a problem hiding this comment.
approving because @mohanachandran-s already approved it
MOSIP-45321: Fixed the signup issue and added specific feature file to execute the required test scenarios.
Summary by CodeRabbit
New Features
Bug Fixes
Configuration
config.properties.