Skip to content

MOSIP-44540:Automate the testcases of eKYC process steps#1671

Merged
zesu22 merged 7 commits intomosip:developfrom
rachanaspsoratur:develop
Mar 18, 2026
Merged

MOSIP-44540:Automate the testcases of eKYC process steps#1671
zesu22 merged 7 commits intomosip:developfrom
rachanaspsoratur:develop

Conversation

@rachanaspsoratur
Copy link

@rachanaspsoratur rachanaspsoratur commented Mar 16, 2026

Automate the 5 testcases of eKYC process steps

Summary by CodeRabbit

  • Tests
    • Added UI test coverage for the eKYC process with a new page object to verify five on-screen labels, titles, and subtitles.
    • Added end-to-end step definitions to validate navigation to the eKYC Process Steps screen and assert displayed step content.
    • Added a Gherkin feature (Scenario Outline) driving the eKYC workflow—language selection, OTP login/verification (example OTP provided), and process-steps verifications—tagged for smoke/regression.

@coderabbitai
Copy link

coderabbitai bot commented Mar 16, 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 eKYC UI tests: new Page Object EkycPage with visibility helpers, new Cucumber step definitions EkycStepDefinition that assert those helpers, and a Gherkin feature EkycPage.feature that exercises the eKYC process steps including OTP login and element verifications.

Changes

Cohort / File(s) Summary
Page Object
ui-test/src/main/java/pages/EkycPage.java
New public EkycPage class extending BasePage, initialized with PageFactory; declares five @FindBy WebElements and exposes five public boolean visibility helper methods delegating to inherited isElementVisible.
Step Definitions
ui-test/src/main/java/stepdefinitions/EkycStepDefinition.java
New EkycStepDefinition class constructed with BaseTest to obtain WebDriver, instantiates EkycPage, and adds five @Then step methods that assert screen label, step titles, and subtitles using JUnit assertions.
Feature File
ui-test/src/main/resources/featurefiles/EkycPage.feature
New Gherkin feature tagged for smoke/regression with a Scenario Outline "Verify eKYC process steps screen content" covering language selection, OTP login/verification, navigation to eKYC steps screen, and verification of step titles/subtitles; includes an Examples table with OTP 111111.

Sequence Diagram(s)

sequenceDiagram
    participant Feature as "Gherkin Feature"
    participant Steps as "EkycStepDefinition"
    participant Page as "EkycPage (PageObject)"
    participant Browser as "WebDriver / Browser"

    Feature->>Steps: run scenario steps (language, login, OTP, navigate)
    Steps->>Browser: perform UI actions (select language, enter OTP, navigate)
    Browser-->>Steps: page loads / elements rendered
    Steps->>Page: invoke visibility/title helper methods
    Page->>Browser: locate elements via `@FindBy`
    Browser-->>Page: return element visibility/status
    Page-->>Steps: return boolean results
    Steps-->>Feature: assert results (pass/fail)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped to check each title and line,
Found steps and subtags all in a line,
Elements visible, assertions bright,
I thumped my foot—tests passed tonight,
A tiny rabbit, happy and fine.

🚥 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 PR title clearly describes the main change: automating test cases for the eKYC process steps. It directly relates to the primary objective of adding UI tests (EkycPage, EkycStepDefinition, and feature file) for eKYC process steps verification.

✏️ 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.

Tip

CodeRabbit can use Trivy to scan for security misconfigurations and secrets in Infrastructure as Code files.

Add a .trivyignore file to your project to customize which findings Trivy reports.

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: 3

🧹 Nitpick comments (1)
ui-test/src/main/java/stepdefinitions/EkycStepDefinition.java (1)

41-64: Add assertion messages to improve failure diagnostics.

Current assertTrue(...) calls fail without context, which slows triage in CI logs.

🧪 Suggested improvement
 	`@Then`("Verify user navigate to eKYC Process Steps screen")
 	public void verifyUserNavigateToEKycProcessStepsScreen() {
-	    assertTrue(ekycPage.isEkycProcessStepsScreenLabelDisplayed());
+	    assertTrue("eKYC Process Steps screen label is not visible",
+	            ekycPage.isEkycProcessStepsScreenLabelDisplayed());
 	}
@@
 	public void verifyTheTitleOfStep1IsChooseEkycProvider() {
-	assertTrue(ekycPage.isVerifyStep1TitleChooseEkycProvider());
+	assertTrue("Step 1 title is missing or incorrect",
+	        ekycPage.isVerifyStep1TitleChooseEkycProvider());
 	}
@@
 	public void verifyTheSubtitleOfStep1() {
-	assertTrue(ekycPage.isVerifyStep1Subtitle());
+	assertTrue("Step 1 subtitle is not visible", ekycPage.isVerifyStep1Subtitle());
 	}	
@@
 	public void verifyTheTitleOfStep2IsChooseEkycProvider() {
-	assertTrue(ekycPage.isVerifyStep2TitleChooseEkycProvider());
+	assertTrue("Step 2 title is missing or incorrect",
+	        ekycPage.isVerifyStep2TitleChooseEkycProvider());
 	}
@@
 	public void verifyTheSubtitleOfStep2() {
-	assertTrue(ekycPage.isVerifyStep2Subtitle());
+	assertTrue("Step 2 subtitle is not visible", ekycPage.isVerifyStep2Subtitle());
 	}	
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui-test/src/main/java/stepdefinitions/EkycStepDefinition.java` around lines
41 - 64, Add informative assertion messages to each assertTrue call so failures
include context; update the methods verifyUserNavigateToEKycProcessStepsScreen,
verifyTheTitleOfStep1IsChooseEkycProvider, verifyTheSubtitleOfStep1,
verifyTheTitleOfStep2IsChooseEkycProvider, and verifyTheSubtitleOfStep2 to pass
a descriptive message as the first parameter to assertTrue (e.g., "Expected eKYC
Process Steps screen to be displayed", "Expected step 1 title to be 'Choose an
eKYC provider'", etc.) while keeping the existing predicate calls
(ekycPage.isEkycProcessStepsScreenLabelDisplayed(),
ekycPage.isVerifyStep1TitleChooseEkycProvider(),
ekycPage.isVerifyStep1Subtitle(),
ekycPage.isVerifyStep2TitleChooseEkycProvider(),
ekycPage.isVerifyStep2Subtitle()) as the boolean argument.
🤖 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/pages/EkycPage.java`:
- Around line 46-56: The three "verify" methods
(isVerifyStep1TitleChooseEkycProvider, isVerifyStep1Subtitle,
isVerifyStep2TitleChooseEkycProvider) only check visibility via
isElementDisplayed(step1Title/step1Subtitle/step2Title); change them to assert
exact text equality: read the element text (e.g., getText or textContent from
step1Title/step1Subtitle/step2Title) and compare against the expected literal or
a passed-in expected string, returning true only if visible AND
text.equals(expected). Update the methods to use the element text comparison and
keep visibility check to avoid false positives.
- Around line 42-60: Replace the timing-unsafe isElementDisplayed() calls in
EkycPage with the explicit-wait wrapper isElementVisible(): update
isEkycProcessStepsScreenLabelDisplayed(),
isVerifyStep1TitleChooseEkycProvider(), isVerifyStep1Subtitle(),
isVerifyStep2TitleChooseEkycProvider(), and isVerifyStep2Subtitle() to call
isElementVisible(...) instead of isElementDisplayed(...), leveraging the
BasePage/WaitUtil waitForVisibility behavior for consistent waits.

In `@ui-test/src/main/resources/featurefiles/EkycPage.feature`:
- Line 6: The scenario title "Scenario Outline: Verifying Toggle button in
consent screen" is misleading; update the Scenario Outline title in
EkycPage.feature to accurately reflect that the steps validate eKYC process-step
labels/subtitles (e.g., "Scenario Outline: Verifying eKYC process-step labels
and subtitles") so reports and failure triage match the test intent; locate the
Scenario Outline line and change only the title text while keeping the existing
steps and examples intact.

---

Nitpick comments:
In `@ui-test/src/main/java/stepdefinitions/EkycStepDefinition.java`:
- Around line 41-64: Add informative assertion messages to each assertTrue call
so failures include context; update the methods
verifyUserNavigateToEKycProcessStepsScreen,
verifyTheTitleOfStep1IsChooseEkycProvider, verifyTheSubtitleOfStep1,
verifyTheTitleOfStep2IsChooseEkycProvider, and verifyTheSubtitleOfStep2 to pass
a descriptive message as the first parameter to assertTrue (e.g., "Expected eKYC
Process Steps screen to be displayed", "Expected step 1 title to be 'Choose an
eKYC provider'", etc.) while keeping the existing predicate calls
(ekycPage.isEkycProcessStepsScreenLabelDisplayed(),
ekycPage.isVerifyStep1TitleChooseEkycProvider(),
ekycPage.isVerifyStep1Subtitle(),
ekycPage.isVerifyStep2TitleChooseEkycProvider(),
ekycPage.isVerifyStep2Subtitle()) as the boolean argument.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bfb4ca71-4e6a-464f-9d6a-a37ca45641aa

📥 Commits

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

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

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.

🧹 Nitpick comments (2)
ui-test/src/main/resources/featurefiles/EkycPage.feature (2)

1-1: Commented feature tag may cause confusion in test selection.

#@smokeAndRegression is inactive because it’s commented. If this tag is intended for suite filtering, it should be enabled or removed to avoid ambiguity.

✏️ Suggested cleanup
-#@smokeAndRegression
+@smokeAndRegression
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui-test/src/main/resources/featurefiles/EkycPage.feature` at line 1, The
commented feature tag '#@smokeAndRegression' in EkycPage.feature is inactive and
may confuse test selection; either uncomment the tag (remove the leading '#') to
enable suite filtering or delete the commented line entirely so it's not
ambiguous—look for the literal '#@smokeAndRegression' at the top of
EkycPage.feature and apply the chosen change.

6-25: Scenario Outline is optional overkill for a single dataset.

With one example row, a plain Scenario is simpler. Keep Scenario Outline only if you plan to add more OTP datasets soon.

✏️ Possible simplification
-  Scenario Outline: Verify eKYC process steps screen content
+  Scenario: Verify eKYC process steps screen content
@@
-   When user enters the "<correct Otp>"
+   When user enters the "111111"
@@
-Examples:
-  | correct Otp  |
-  | 111111       |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui-test/src/main/resources/featurefiles/EkycPage.feature` around lines 6 -
25, The feature uses a "Scenario Outline: Verify eKYC process steps screen
content" with a single Examples row; change it to a plain "Scenario" to simplify
the file by renaming the Scenario Outline to Scenario (e.g., replace the header
string "Scenario Outline: Verify eKYC process steps screen content" with
"Scenario: Verify eKYC process steps screen content") and remove the "Examples:"
block and its single example row (the "| correct Otp | 111111 |" table) while
keeping the step that currently references "<correct Otp>" updated to a concrete
value "111111" or a step that inputs that OTP directly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@ui-test/src/main/resources/featurefiles/EkycPage.feature`:
- Line 1: The commented feature tag '#@smokeAndRegression' in EkycPage.feature
is inactive and may confuse test selection; either uncomment the tag (remove the
leading '#') to enable suite filtering or delete the commented line entirely so
it's not ambiguous—look for the literal '#@smokeAndRegression' at the top of
EkycPage.feature and apply the chosen change.
- Around line 6-25: The feature uses a "Scenario Outline: Verify eKYC process
steps screen content" with a single Examples row; change it to a plain
"Scenario" to simplify the file by renaming the Scenario Outline to Scenario
(e.g., replace the header string "Scenario Outline: Verify eKYC process steps
screen content" with "Scenario: Verify eKYC process steps screen content") and
remove the "Examples:" block and its single example row (the "| correct Otp |
111111 |" table) while keeping the step that currently references "<correct
Otp>" updated to a concrete value "111111" or a step that inputs that OTP
directly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2c619fff-7c35-42ef-b781-9920fdbb426d

📥 Commits

Reviewing files that changed from the base of the PR and between d7b8ec9 and c305ce6.

📒 Files selected for processing (2)
  • ui-test/src/main/java/pages/EkycPage.java
  • ui-test/src/main/resources/featurefiles/EkycPage.feature
🚧 Files skipped from review as they are similar to previous changes (1)
  • ui-test/src/main/java/pages/EkycPage.java

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

🧹 Nitpick comments (2)
ui-test/src/main/resources/featurefiles/EkycPage.feature (1)

6-6: Consider using Scenario instead of Scenario Outline for a single OTP row.

With only one example row, this can be simplified for readability. Keep Scenario Outline only if more datasets are planned soon.

♻️ Optional simplification
-  Scenario Outline: Verify eKYC process steps screen content
+  Scenario: Verify eKYC process steps screen content
@@
-   When user enters the "<correct Otp>"
+   When user enters the "111111"
@@
-Examples:
-  | correct Otp  |
-  | 111111       |

Also applies to: 12-12, 23-25

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

In `@ui-test/src/main/resources/featurefiles/EkycPage.feature` at line 6, The
scenarios defined as "Scenario Outline: Verify eKYC process steps screen
content" (and the other two similar outline scenarios) use a Scenario Outline
but only have a single Examples row; replace "Scenario Outline" with "Scenario"
for each of these scenarios to simplify and improve readability, and remove the
associated Examples table (or keep it as inline steps with the single values) so
the feature file uses plain Scenario definitions instead of Outline when no
multiple datasets are required.
ui-test/src/main/java/stepdefinitions/EkycStepDefinition.java (1)

25-25: Add assertion messages to speed up failure triage.

Bare assertTrue(...) makes CI failures less actionable when any one of several checks fails.

🛠️ Suggested improvement
-	    assertTrue(ekycPage.isEkycProcessStepsScreenLabelDisplayed());
+	    assertTrue("eKYC Process Steps header is not displayed", ekycPage.isEkycProcessStepsScreenLabelDisplayed());
@@
-	assertTrue(ekycPage.isEkycStep1TitleChooseEkycProvider());
+	assertTrue("Step 1 title is not displayed", ekycPage.isEkycStep1TitleChooseEkycProvider());
@@
-	assertTrue(ekycPage.isEkycStep1Subtitle());
+	assertTrue("Step 1 subtitle is not displayed", ekycPage.isEkycStep1Subtitle());
@@
-	assertTrue(ekycPage.isEkycStep2TitleTermsAndConditions());
+	assertTrue("Step 2 title is not displayed", ekycPage.isEkycStep2TitleTermsAndConditions());
@@
-	assertTrue(ekycPage.isEkycStep2Subtitle());
+	assertTrue("Step 2 subtitle is not displayed", ekycPage.isEkycStep2Subtitle());

Also applies to: 30-30, 35-35, 40-40, 45-45

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

In `@ui-test/src/main/java/stepdefinitions/EkycStepDefinition.java` at line 25,
Replace bare assertTrue(...) calls with assertions that include a descriptive
message to make CI failures actionable; specifically update the assertions that
call ekycPage.isEkycProcessStepsScreenLabelDisplayed() (and the similar calls at
the other spots referenced) to use assertTrue("Descriptive message: expected
...", ekycPage.isEkycProcessStepsScreenLabelDisplayed()) so each check names
what failed (e.g., "EKYC process steps screen label not displayed") and do the
same pattern for the other asserts in EkycStepDefinition.java.
🤖 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/EkycPage.feature`:
- Line 1: Uncomment the feature-level regression tag so runners can filter on
it: in the EkycPage.feature file remove the leading '#' from the line
"#@smokeAndRegression" (make it "@smokeAndRegression") at the top of the file so
the tag is active for test selection; ensure the tag remains on its own line
above the Feature declaration.

---

Nitpick comments:
In `@ui-test/src/main/java/stepdefinitions/EkycStepDefinition.java`:
- Line 25: Replace bare assertTrue(...) calls with assertions that include a
descriptive message to make CI failures actionable; specifically update the
assertions that call ekycPage.isEkycProcessStepsScreenLabelDisplayed() (and the
similar calls at the other spots referenced) to use assertTrue("Descriptive
message: expected ...", ekycPage.isEkycProcessStepsScreenLabelDisplayed()) so
each check names what failed (e.g., "EKYC process steps screen label not
displayed") and do the same pattern for the other asserts in
EkycStepDefinition.java.

In `@ui-test/src/main/resources/featurefiles/EkycPage.feature`:
- Line 6: The scenarios defined as "Scenario Outline: Verify eKYC process steps
screen content" (and the other two similar outline scenarios) use a Scenario
Outline but only have a single Examples row; replace "Scenario Outline" with
"Scenario" for each of these scenarios to simplify and improve readability, and
remove the associated Examples table (or keep it as inline steps with the single
values) so the feature file uses plain Scenario definitions instead of Outline
when no multiple datasets are required.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 68f1ed7a-8a69-4b17-8404-ceec7c125948

📥 Commits

Reviewing files that changed from the base of the PR and between 98461a3 and eab6a82.

📒 Files selected for processing (3)
  • ui-test/src/main/java/pages/EkycPage.java
  • ui-test/src/main/java/stepdefinitions/EkycStepDefinition.java
  • ui-test/src/main/resources/featurefiles/EkycPage.feature
🚧 Files skipped from review as they are similar to previous changes (1)
  • ui-test/src/main/java/pages/EkycPage.java

Signed-off-by: Rachana S P <rachana.p@cyberpwn.com>
Signed-off-by: Rachana S P <rachana.p@cyberpwn.com>
Signed-off-by: Rachana S P <rachana.p@cyberpwn.com>
Signed-off-by: Rachana S P <rachana.p@cyberpwn.com>
Signed-off-by: Rachana S P <rachana.p@cyberpwn.com>
Signed-off-by: Rachana S P <rachana.p@cyberpwn.com>
Signed-off-by: Rachana S P <rachana.p@cyberpwn.com>
Copy link
Contributor

@zesu22 zesu22 left a comment

Choose a reason for hiding this comment

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

approving because @mohanachandran-s has already approved it

@zesu22 zesu22 merged commit a6c662e into mosip:develop Mar 18, 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.

5 participants