Skip to content

MOSIP-44541:Automated the test cases of consentscreen#1672

Open
rohithgoudbuyyani wants to merge 7 commits intomosip:developfrom
rohithgoudbuyyani:develop
Open

MOSIP-44541:Automated the test cases of consentscreen#1672
rohithgoudbuyyani wants to merge 7 commits intomosip:developfrom
rohithgoudbuyyani:develop

Conversation

@rohithgoudbuyyani
Copy link

@rohithgoudbuyyani rohithgoudbuyyani commented Mar 17, 2026

Automated the 4 test cases of consentscreen

Summary by CodeRabbit

  • Tests
    • Added UI visibility checks and test steps for essential claims header, essential claims list, action message, and consent timer on the consent screen.
    • Added step definitions to assert those elements during test runs.
    • Added an end-to-end consent scenario covering language selection, authentication, verification steps, camera preview, return to consent, and assertions for unavailable voluntary claims and related UI elements.

Signed-off-by: Rohith Goud <buyyanirohithgoud@gmail.com>
Signed-off-by: Rohith Goud <buyyanirohithgoud@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds three UI element fields and four visibility-check methods to ConsentPage, four new @Then step definitions asserting those checks in ConsentStepDefinition, and a new end-to-end scenario in ConsentPage.feature validating consent-screen elements and a timer.

Changes

Cohort / File(s) Summary
Consent page elements & checks
ui-test/src/main/java/pages/ConsentPage.java
Added WebElement fields: essentialClaimsHeader (public), essentialClaimsList (public), actionMessage (private). Added visibility-check methods: isEssentialClaimsHeaderDisplayed(), isEssentialClaimsListDisplayed(), isActionMessageDisplayed(), and isTimerDisplayed() (uses existing consentTimer).
Step definitions
ui-test/src/main/java/stepdefinitions/ConsentStepDefinition.java
Added four @Then step methods asserting visibility: verifyTheEssentialClaimsHeader(), verifyTheEssentialClaimsList(), verifyTheActionMessage(), verifyTheTimerInConsentScreen().
Feature: consent screen scenario
ui-test/src/main/resources/featurefiles/ConsentPage.feature
Added a new scenario covering language selection, OTP login, E‑KYC, terms/camera preview, navigation back to consent, and assertions for essential/voluntary claims, action message, and timer. Minor whitespace adjustment elsewhere.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped into tests with ears up high,

Found headers, lists, and a timer nearby.
A quiet action message, soft and bright,
I checked each line and kept the flow light.
Nibbles of code—now the consent screen’s right.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly references the main objective of automating consent screen test cases, which aligns with the changeset containing new test verifications and step definitions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ui-test/src/main/java/stepdefinitions/ConsentStepDefinition.java`:
- Around line 333-336: The step text and assertion disagree: the step method
verifyTheEssentialClaimsList calls consentPage.isEssentialClaimsListDisplayed()
but the Gherkin step says "voluntary claims"; pick one and make them consistent
— either rename the Java method to verifyTheVoluntaryClaimsList and call
consentPage.isVoluntaryClaimsListDisplayed(), or change the Gherkin step text in
ConsentPage.feature to "verify list of essential claims are present" so it
matches verifyTheEssentialClaimsList and
consentPage.isEssentialClaimsListDisplayed(); update the corresponding glue
mapping so the feature and step definition remain aligned.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 5c2d4eca-264d-4bdb-9d8b-2697d3a41a47

📥 Commits

Reviewing files that changed from the base of the PR and between 2fa9c2c and 64f18f2.

📒 Files selected for processing (3)
  • ui-test/src/main/java/pages/ConsentPage.java
  • ui-test/src/main/java/stepdefinitions/ConsentStepDefinition.java
  • ui-test/src/main/resources/featurefiles/ConsentPage.feature

Signed-off-by: Rohith Goud <buyyanirohithgoud@gmail.com>
Copy link

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ui-test/src/main/resources/featurefiles/ConsentPage.feature`:
- Around line 73-99: Add an explicit assertion that voluntary claims are absent
by extending the feature with a step like "And user verify voluntary claims are
not present" and implement its step definition to call a page-check method
(e.g., consentPage.areVoluntaryClaimsPresent()) and assert false (e.g.,
assertFalse or equivalent). Add or update the ConsentPage object with an
areVoluntaryClaimsPresent() method that inspects the consent DOM for
voluntary-claim elements (class/id/selector used elsewhere) and returns a
boolean so the step definition can fail the scenario when voluntary claims are
present.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 277e6ccc-802a-43ab-8d6e-6b478988cdb5

📥 Commits

Reviewing files that changed from the base of the PR and between 64f18f2 and e2a9da5.

📒 Files selected for processing (2)
  • ui-test/src/main/java/stepdefinitions/ConsentStepDefinition.java
  • ui-test/src/main/resources/featurefiles/ConsentPage.feature

Signed-off-by: Rohith Goud <buyyanirohithgoud@gmail.com>
Signed-off-by: Rohith Goud <buyyanirohithgoud@gmail.com>
Copy link

@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: 1

♻️ Duplicate comments (1)
ui-test/src/main/resources/featurefiles/ConsentPage.feature (1)

73-98: ⚠️ Potential issue | 🟠 Major

Scenario title still overstates what this flow validates.

The assertions on Line 94 through Line 98 only check the essential-claims header/list, action message, and timer. Nothing here fails if voluntary claims are still rendered, so the unavailable voluntary claims behavior remains untested. Please either add an explicit negative step for voluntary claims or rename the scenario to match the current coverage.

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

In `@ui-test/src/main/resources/featurefiles/ConsentPage.feature` around lines 73
- 98, The Scenario Outline titled "Verifying Consent Screen changes to handle
unavailable voluntary claims" overstates coverage because the existing
assertions (the steps that verify essential-claims header/list, action message,
and timer) do not assert voluntary claims are absent; either add an explicit
negative check such as a step (e.g., "And user verify voluntary claims are not
displayed" or "And verify voluntary claims are not present on consent screen")
placed after the existing consent verifications, or rename the Scenario Outline
title to accurately reflect the checks performed (e.g., remove the "unavailable
voluntary claims" phrase); ensure references to the Scenario Outline title and
the steps that verify essential-claims header/list, action message, and timer
are updated accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ui-test/src/main/java/stepdefinitions/ConsentStepDefinition.java`:
- Around line 333-336: The current verifyTheEssentialClaimsList method only
checks visibility via consentPage.isEssentialClaimsListDisplayed(), which can
pass for an empty container; update verifyTheEssentialClaimsList to assert
actual items: call the page object method that returns claim items (e.g.,
consentPage.getEssentialClaims() or consentPage.getEssentialClaimCount()) and
assert count > 0, or reuse an existing stronger check such as
consentPage.isEssentialClaimPresent(<expectedClaim>) to verify at least one real
claim is rendered instead of only the container visibility.

---

Duplicate comments:
In `@ui-test/src/main/resources/featurefiles/ConsentPage.feature`:
- Around line 73-98: The Scenario Outline titled "Verifying Consent Screen
changes to handle unavailable voluntary claims" overstates coverage because the
existing assertions (the steps that verify essential-claims header/list, action
message, and timer) do not assert voluntary claims are absent; either add an
explicit negative check such as a step (e.g., "And user verify voluntary claims
are not displayed" or "And verify voluntary claims are not present on consent
screen") placed after the existing consent verifications, or rename the Scenario
Outline title to accurately reflect the checks performed (e.g., remove the
"unavailable voluntary claims" phrase); ensure references to the Scenario
Outline title and the steps that verify essential-claims header/list, action
message, and timer are updated accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 157ee022-59ac-45f6-9f85-b5f90b26b10c

📥 Commits

Reviewing files that changed from the base of the PR and between e2a9da5 and 679ac29.

📒 Files selected for processing (2)
  • ui-test/src/main/java/stepdefinitions/ConsentStepDefinition.java
  • ui-test/src/main/resources/featurefiles/ConsentPage.feature

Signed-off-by: Rohith Goud <buyyanirohithgoud@gmail.com>
Signed-off-by: Rohith Goud <buyyanirohithgoud@gmail.com>
Comment on lines +75 to +77
When Click on Language selection option
And Select the mandatory language
And user click on Login with Otp
Copy link
Contributor

Choose a reason for hiding this comment

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

Still i can see inconsistency in camelcase

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