MOSIP-44540:Automate the testcases of eKYC process steps#1671
MOSIP-44540:Automate the testcases of eKYC process steps#1671zesu22 merged 7 commits intomosip:developfrom
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds eKYC UI tests: new Page Object Changes
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)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 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. |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
ui-test/src/main/java/pages/EkycPage.javaui-test/src/main/java/stepdefinitions/EkycStepDefinition.javaui-test/src/main/resources/featurefiles/EkycPage.feature
There was a problem hiding this comment.
🧹 Nitpick comments (2)
ui-test/src/main/resources/featurefiles/EkycPage.feature (2)
1-1: Commented feature tag may cause confusion in test selection.
#@smokeAndRegressionis 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
Scenariois simpler. KeepScenario Outlineonly 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
📒 Files selected for processing (2)
ui-test/src/main/java/pages/EkycPage.javaui-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
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
ui-test/src/main/resources/featurefiles/EkycPage.feature (1)
6-6: Consider usingScenarioinstead ofScenario Outlinefor a single OTP row.With only one example row, this can be simplified for readability. Keep
Scenario Outlineonly 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
📒 Files selected for processing (3)
ui-test/src/main/java/pages/EkycPage.javaui-test/src/main/java/stepdefinitions/EkycStepDefinition.javaui-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>
9ec5a2c to
49f909e
Compare
zesu22
left a comment
There was a problem hiding this comment.
approving because @mohanachandran-s has already approved it
Automate the 5 testcases of eKYC process steps
Summary by CodeRabbit