Skip to content

MOSIP-45321: Fixed the signup issue and added specific feature file to execute the required test scenarios. - #2196

Merged
zesu22 merged 2 commits into
mosip:developfrom
damodarguru:develop
Jul 22, 2026
Merged

MOSIP-45321: Fixed the signup issue and added specific feature file to execute the required test scenarios.#2196
zesu22 merged 2 commits into
mosip:developfrom
damodarguru:develop

Conversation

@damodarguru

@damodarguru damodarguru commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

MOSIP-45321: Fixed the signup issue and added specific feature file to execute the required test scenarios.

Summary by CodeRabbit

  • New Features

    • Added support for running only a configured subset of Cucumber feature files during test execution.
    • Enhanced signup mobile number generation using identifier/regex requirements with exact-length output.
  • Bug Fixes

    • Improved signup form field detection to work when identifiers are applied to surrounding wrapper elements.
    • Numeric values generated from regex now avoid invalid leading zeros and support exact-length constraints.
  • Configuration

    • Standardized empty configuration placeholders for URLs, credentials, OTP settings, and feature selection in config.properties.

… execute the required test scenarios.

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

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 428b0c8a-ca71-4532-851c-bc0c68722815

📥 Commits

Reviewing files that changed from the base of the PR and between 9f4ba4e and c33fbd0.

📒 Files selected for processing (3)
  • ui-test/src/main/java/runners/Runner.java
  • ui-test/src/main/java/stepdefinitions/ConsentStepDefinition.java
  • ui-test/src/main/java/utils/EsignetUtil.java
💤 Files with no reviewable changes (1)
  • ui-test/src/main/java/stepdefinitions/ConsentStepDefinition.java

Walkthrough

Signup UI tests now support configured feature-file selection, metadata-driven exact-length identifier generation, wrapped form-control matching, and blank configuration placeholders.

Changes

Feature execution filtering

Layer / File(s) Summary
Configured feature scenario filtering
ui-test/src/main/java/runners/Runner.java, ui-test/src/main/resources/config.properties
Runner filters scenarios by case-insensitive feature filename before browser and language expansion; blank, invalid, or unmatched configuration preserves all scenarios.

Signup input generation and matching

Layer / File(s) Summary
Metadata-driven signup input and matching
ui-test/src/main/java/utils/EsignetUtil.java, ui-test/src/main/java/stepdefinitions/ConsentStepDefinition.java, ui-test/src/main/java/pages/SignupFormDynamicFiller.java
Identifier values use signup field metadata and exact-length regex generation, numeric values avoid leading zeroes, and XPath matching supports controls nested inside matching wrappers.

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
Loading

Suggested reviewers: mohanachandran-s, mohanachandran-s

Poem

Features gather in a queue,
Identifiers gain digits anew,
Wrapped fields reveal
Controls ready to feel—
Signup tests march cleanly through.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: a signup fix and targeted execution of specific test scenarios.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 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 win

Filter wrapper descendants by controlType before 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], Select failures, 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

📥 Commits

Reviewing files that changed from the base of the PR and between d1521ca and 9f4ba4e.

📒 Files selected for processing (5)
  • ui-test/src/main/java/pages/SignupFormDynamicFiller.java
  • ui-test/src/main/java/runners/Runner.java
  • ui-test/src/main/java/stepdefinitions/ConsentStepDefinition.java
  • ui-test/src/main/java/utils/EsignetUtil.java
  • ui-test/src/main/resources/config.properties

Comment thread ui-test/src/main/java/runners/Runner.java Outdated
Comment thread ui-test/src/main/java/runners/Runner.java
Comment thread ui-test/src/main/java/stepdefinitions/ConsentStepDefinition.java Outdated
Comment thread ui-test/src/main/java/utils/EsignetUtil.java
Comment thread ui-test/src/main/java/utils/EsignetUtil.java
… execute the required test scenarios.

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

@zesu22 zesu22 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

approving because @mohanachandran-s already approved it

@zesu22
zesu22 merged commit 4edbe7e into mosip:develop Jul 22, 2026
29 checks passed
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.

3 participants