Skip to content

MOSIP-45334 - Automated the testcases of the story ES-2058 - #2304

Merged
zesu22 merged 3 commits into
mosip:developfrom
mohanachandran-s:develop
Aug 6, 2026
Merged

zesu22 merged 3 commits into
mosip:developfrom
mohanachandran-s:develop

Conversation

@mohanachandran-s

@mohanachandran-s mohanachandran-s commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Automated the testcases of the story ES-2058

Summary by CodeRabbit

  • New Features

    • Added knowledge-based authentication coverage with localized, schema-driven forms, validation, dropdowns, and network recovery.
    • Added Sunbird RC policy creation, deletion, and authentication scenarios.
    • Added expanded OIDC client test coverage and automatic plugin detection.
  • Bug Fixes

    • Improved handling of unsupported authentication scenarios and environment-specific execution.
    • Added retries and health checks for transient service failures.
  • Documentation

    • Added comprehensive UI automation setup, execution, configuration, and troubleshooting guidance.

Signed-off-by: Mohanachandran S <mohanachandran.s@technoforte.co.in>

# Conflicts:
#	ui-test/src/main/java/base/BaseTest.java
#	ui-test/src/main/java/utils/EsignetUtil.java
@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The UI test suite now detects plugins from the eSignet actuator, supports Sunbird RC client and policy flows, and adds schema-driven KBI browser tests with localization, validation, offline recovery, and authentication coverage.

Changes

UI test runtime and Sunbird RC flows

Layer / File(s) Summary
Plugin detection and request routing
ui-test/...
Plugin detection and language handling now use runtime actuator and application data. Sunbird RC requests support configured endpoints, health checks, retries, generated fixtures, and identifier extraction.
Sunbird RC prerequisite and cleanup pipeline
ui-test/src/main/resources/esignetUI/..., ui-test/testNgXmlFiles/..., ui-test/src/main/java/.../DeleteWithParam.java
Added OIDC client and policy creation scenarios, policy deletion, Handlebars templates, YAML definitions, and TestNG wiring.
Schema-driven KBI authentication
ui-test/src/main/java/pages/..., ui-test/src/main/java/stepdefinitions/KbiStepDefinition.java, ui-test/src/main/resources/featurefiles/KbiForm.feature
Added KBI page interactions and Cucumber coverage for schema fields, validation, localization, fallback labels, network recovery, and authentication.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Runner
  participant BaseTest
  participant EsignetUtil
  participant LoginOptionsPage
  participant KbiPage
  Runner->>BaseTest: execute `@kbi` scenario
  BaseTest->>EsignetUtil: resolve KBI ACR and ui_locales
  BaseTest->>LoginOptionsPage: open KBI login option
  LoginOptionsPage->>KbiPage: click KBI
  KbiPage->>EsignetUtil: read transaction KBI schema
  KbiPage->>KbiPage: validate fields and submit login
Loading

Possibly related PRs

  • mosip/esignet#1708: Both changes modify PAR and authorization URL generation in BaseTest and EsignetUtil.
  • mosip/esignet#2173: Both changes modify plugin-aware UI test execution and authorization flows.
  • mosip/esignet#2210: Both changes modify the UI test authorization flow, including BaseTest, EsignetUtil, and consent handling.

Suggested reviewers: bhuvanashreebs, zesu22

Poem

Actuator selects the route,
KBI fields render and validate.
Sunbird creates, then deletes,
Locales guide each login step.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.24% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the tracked issue and states that the pull request automates the test cases for story ES-2058.
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: 9

🤖 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/AGENTS.md`:
- Line 77: Add a single trailing newline at the end of ui-test/AGENTS.md,
preserving all existing content and formatting.
- Around line 19-23: Correct the launch command in AGENTS.md by placing
-Denv.endpoint="$ENV_ENDPOINT" before -jar, and update the README.md tag example
to invoke the suite through runners.Runner.main() rather than mvn test,
consistent with Surefire’s skipTests=true configuration.

In
`@ui-test/src/main/java/io/mosip/testrig/apirig/esignetUI/testscripts/SimplePostForAutoGenId.java`:
- Around line 161-166: Update the successful-response branch in
SimplePostForAutoGenId around extractSunbirdOsid so a null osid immediately
throws AdminTestException instead of silently continuing. Keep
writeAutoGeneratedId unchanged for valid identifiers, ensuring failed extraction
prevents the suite from proceeding to deletion.
- Around line 143-152: Update the retry loop in SimplePostForAutoGenId around
postWithBodyAndBearerToken so repeated Sunbird RC policy-creation requests are
idempotent by using a supported idempotency key or resolving the existing osid
before retrying. Add bounded backoff between UNSUCCESSFUL retries while
preserving the existing maximum retry limit and success exit behavior.

In `@ui-test/src/main/java/pages/KbiPage.java`:
- Around line 235-237: Update clickLoginButton to replace the exact English-text
XPath with a language-independent, stable locator for the KBI submit button,
such as its ID, test attribute, or form-scoped submit selector. Keep the
interaction routed through clickOnElement and preserve the existing report
message.

In `@ui-test/src/main/java/stepdefinitions/KbiStepDefinition.java`:
- Around line 320-328: The dropdown validation in the relevant KBI step
currently checks only for nonempty text, allowing English values in non-English
runs. Update the loop over dropdownFields to obtain each field’s expected option
values from the schema for lang, then compare the rendered options from
getDropdownOptionTexts against those values and add mismatches to problems while
preserving the existing assertion and reporting.
- Around line 495-515: Update resolveKnownSunBirdRValue to use an explicit
mapping of exact schema field IDs to their corresponding EsignetUtil fixture
values, including policyName mapped to the fixture value “Start Insurance Gold
Premium.” Remove partial lower-case matching and return null for unsupported
field IDs.

In `@ui-test/src/main/java/utils/EsignetUtil.java`:
- Around line 215-221: Update getPluginName to validate the value returned by
getIdentityPluginNameFromEsignetActuator() before assigning pluginName: when the
authenticator property is null, blank, or otherwise unavailable, reject it
without caching the mosipid fallback. Preserve mock detection for values
containing mockauthenticationservice or sunbirdrcauthenticationservice, and only
cache the appropriate plugin name when a valid authenticator value is available.

In `@ui-test/src/main/resources/featurefiles/KbiForm.feature`:
- Around line 68-93: Add distinct Cucumber tags to the four KBI scenarios in the
feature file, with each tag identifying its required schema variant (default,
added-field, removed-field, or single-field). Ensure the corresponding
environment or prerequisite setup selects that schema before execution, and
document or configure runs to execute only the scenario tag matching the active
schema.
🪄 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 Plus

Run ID: cea8b3e5-29ab-4a03-a243-b8bd3eeed15a

📥 Commits

Reviewing files that changed from the base of the PR and between 1569bf2 and 93367b7.

📒 Files selected for processing (31)
  • ui-test/AGENTS.md
  • ui-test/README.md
  • ui-test/src/main/java/base/BaseTest.java
  • ui-test/src/main/java/constants/ESignetConstants.java
  • ui-test/src/main/java/io/mosip/testrig/apirig/esignetUI/testscripts/AddIdentity.java
  • ui-test/src/main/java/io/mosip/testrig/apirig/esignetUI/testscripts/DeleteWithParam.java
  • ui-test/src/main/java/io/mosip/testrig/apirig/esignetUI/testscripts/SimplePostForAutoGenId.java
  • ui-test/src/main/java/pages/ConsentPage.java
  • ui-test/src/main/java/pages/KbiPage.java
  • ui-test/src/main/java/pages/LoginOptionsPage.java
  • ui-test/src/main/java/runners/Runner.java
  • ui-test/src/main/java/stepdefinitions/KbiStepDefinition.java
  • ui-test/src/main/java/utils/ClaimsUtil.java
  • ui-test/src/main/java/utils/EsignetConfigManager.java
  • ui-test/src/main/java/utils/EsignetUtil.java
  • ui-test/src/main/java/utils/UINManager.java
  • ui-test/src/main/resources/config.properties
  • ui-test/src/main/resources/esignetUI/CreateClientMock/CreateOIDCClient.yml
  • ui-test/src/main/resources/esignetUI/CreateClientMock/CreateOIDCClientV2SunBird/CreateOIDCClientV2SunBird.hbs
  • ui-test/src/main/resources/esignetUI/CreateClientMock/CreateOIDCClientV2SunBird/CreateOIDCClientV2SunBird.yml
  • ui-test/src/main/resources/esignetUI/CreateClientMock/CreateOIDCClientV2SunBird/CreateOIDCClientV2SunBirdResult.hbs
  • ui-test/src/main/resources/esignetUI/SunBirdR/CreatePolicySunBirdR/CreatePolicySunBirdR.hbs
  • ui-test/src/main/resources/esignetUI/SunBirdR/CreatePolicySunBirdR/CreatePolicySunBirdR.yml
  • ui-test/src/main/resources/esignetUI/SunBirdR/CreatePolicySunBirdR/CreatePolicySunBirdRResult.hbs
  • ui-test/src/main/resources/esignetUI/SunBirdR/DeletePolicySunBirdR/DeletePolicySunBirdR.hbs
  • ui-test/src/main/resources/esignetUI/SunBirdR/DeletePolicySunBirdR/DeletePolicySunBirdR.yml
  • ui-test/src/main/resources/esignetUI/SunBirdR/DeletePolicySunBirdR/DeletePolicySunBirdRResult.hbs
  • ui-test/src/main/resources/featurefiles/KbiForm.feature
  • ui-test/testNgXmlFiles/MasterTestSuite.xml
  • ui-test/testNgXmlFiles/esignetPostrequisiteSuite.xml
  • ui-test/testNgXmlFiles/esignetPrerequisiteSuite.xml
💤 Files with no reviewable changes (1)
  • ui-test/src/main/resources/config.properties

Comment thread ui-test/AGENTS.md Resolved
Comment thread ui-test/AGENTS.md Resolved
Signed-off-by: Mohanachandran S <mohanachandran.s@technoforte.co.in>

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
ui-test/src/main/java/io/mosip/testrig/apirig/esignetUI/testscripts/SimplePostForAutoGenId.java (1)

149-164: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Fail explicitly when all Sunbird create attempts return no response.

postWithBodyAndBearerToken returns null after a transport exception. If every retry does this, Line 202 dereferences response and hides the registry failure behind a NullPointerException.

Throw AdminTestException after the retry loop when response is null.

Proposed fix
 					} while (currLoopCount < SUNBIRD_CREATE_MAX_RETRIES);
+					if (response == null) {
+						throw new AdminTestException(
+								"Sunbird RC create request returned no response after " + currLoopCount + " attempts");
+					}
 				} else {
🤖 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/io/mosip/testrig/apirig/esignetUI/testscripts/SimplePostForAutoGenId.java`
around lines 149 - 164, After the Sunbird retry loop in the flow using
postWithBodyAndBearerToken, explicitly check whether response is still null and
throw AdminTestException before any later response dereference. Preserve the
existing retry and interruption behavior, and only add this failure path for
exhausted attempts with no response.
ui-test/src/main/java/pages/KbiPage.java (1)

75-131: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Log KBI field interactions through the shared reporting helper.

enterFieldValue, blurField, and touchThenClearField change browser state without an Extent report entry. Add BasePage.logStep calls after successful actions. Log field IDs only. Do not log field values.

Proposed fix
 		if (dateInput != null) {
 			setNativeInputValue(dateInput, value);
+			logStep("Entered KBI date field '" + fieldId + "'", dateInput);
 			return;
 		}
 		WebElement el = driver.findElement(fieldInputLocator(fieldId));
 		clearField(el);
 		if (!value.isEmpty()) {
 			el.sendKeys(value);
 		}
+		logStep("Entered KBI field '" + fieldId + "'", el);

As per coding guidelines, “every interaction helper must log to the Extent report.”

🤖 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/KbiPage.java` around lines 75 - 131, Update
KbiPage methods enterFieldValue, blurField, and touchThenClearField to call the
shared BasePage.logStep helper after each successful browser interaction,
logging only the fieldId and never the field value. Ensure both date and
ordinary-field branches log exactly once after completion, while preserving the
existing early returns and behavior.

Source: Coding guidelines

🤖 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/utils/EsignetUtil.java`:
- Around line 224-230: Update the actuator fallback in EsignetUtil’s
plugin-resolution flow to assign the fallback value to the local pluginName
before returning, while keeping it uncached for subsequent calls. Ensure
isTestCaseValidForExecution() can safely perform its pluginName.equals
comparisons during transient actuator failures.

---

Outside diff comments:
In
`@ui-test/src/main/java/io/mosip/testrig/apirig/esignetUI/testscripts/SimplePostForAutoGenId.java`:
- Around line 149-164: After the Sunbird retry loop in the flow using
postWithBodyAndBearerToken, explicitly check whether response is still null and
throw AdminTestException before any later response dereference. Preserve the
existing retry and interruption behavior, and only add this failure path for
exhausted attempts with no response.

In `@ui-test/src/main/java/pages/KbiPage.java`:
- Around line 75-131: Update KbiPage methods enterFieldValue, blurField, and
touchThenClearField to call the shared BasePage.logStep helper after each
successful browser interaction, logging only the fieldId and never the field
value. Ensure both date and ordinary-field branches log exactly once after
completion, while preserving the existing early returns and behavior.
🪄 Autofix

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 Plus

Run ID: d21b4595-7348-4543-ad2d-e9b7b1ae28e8

📥 Commits

Reviewing files that changed from the base of the PR and between 93367b7 and 4f01d55.

📒 Files selected for processing (7)
  • ui-test/AGENTS.md
  • ui-test/README.md
  • ui-test/src/main/java/io/mosip/testrig/apirig/esignetUI/testscripts/SimplePostForAutoGenId.java
  • ui-test/src/main/java/pages/KbiPage.java
  • ui-test/src/main/java/stepdefinitions/KbiStepDefinition.java
  • ui-test/src/main/java/utils/EsignetUtil.java
  • ui-test/src/main/resources/featurefiles/KbiForm.feature

Signed-off-by: Mohanachandran S <mohanachandran.s@technoforte.co.in>

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (6)
ui-test/src/main/java/io/mosip/testrig/apirig/esignetUI/testscripts/SimplePostForAutoGenId.java (2)

136-138: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Validate the Sunbird base URL before the retry loop.

When sunBirdBaseURL is unset, getSunBirdBaseURL() returns an empty value. The code then builds an invalid request and consumes the retry budget. Reject a blank base URL before the first attempt.

Proposed fix
 tempUrl = EsignetConfigManager.getSunBirdBaseURL();
+if (tempUrl == null || tempUrl.isBlank()) {
+	throw new AdminTestException("sunBirdBaseURL is required for Sunbird RC tests");
+}
🤖 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/io/mosip/testrig/apirig/esignetUI/testscripts/SimplePostForAutoGenId.java`
around lines 136 - 138, Validate the value returned by
EsignetConfigManager.getSunBirdBaseURL() before entering the retry loop in the
request setup flow. Reject blank or unset sunBirdBaseURL immediately and prevent
endpoint construction or retry attempts; retain the existing behavior for a
nonblank URL.

149-163: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Make retry decisions status-aware and fail cleanly after exhaustion.

The loop retries only when the raw body contains uppercase UNSUCCESSFUL. It misses HTTP 5xx responses without that text and can retry a successful response that contains it. If every attempt returns null, later output validation dereferences response. Use null, HTTP 5xx, and the structured Sunbird failure status to decide retries. Throw AdminTestException when no response remains.

Proposed fix
-						if (response != null && !response.asString().contains("UNSUCCESSFUL")) {
+						boolean retryable = response == null
+								|| response.getStatusCode() >= 500
+								|| isSunbirdUnsuccessful(response);
+						if (!retryable) {
 							break;
 						}
...
 					} while (currLoopCount < SUNBIRD_CREATE_MAX_RETRIES);
+
+					if (response == null) {
+						throw new AdminTestException(
+								"Sunbird RC create returned no response after " + SUNBIRD_CREATE_MAX_RETRIES
+										+ " attempts");
+					}
🤖 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/io/mosip/testrig/apirig/esignetUI/testscripts/SimplePostForAutoGenId.java`
around lines 149 - 163, Update the retry loop in the flow around
EsignetUtil.postWithBodyAndBearerToken to base retry decisions on a null
response, HTTP 5xx status, or the structured Sunbird failure status rather than
raw body text, while allowing successful responses even if their body contains
“UNSUCCESSFUL.” After SUNBIRD_CREATE_MAX_RETRIES is exhausted without a usable
response, throw AdminTestException before any later response validation
dereferences response.
ui-test/src/main/java/pages/KbiPage.java (3)

29-31: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Use the same field-key variants for all field assertions.

fieldInputLocator() supports id, name, and data-field-id. getFieldErrorMessage() and isFieldMarkedRequired() use only id, while getFieldLabel() also depends on id or for. A field with only name or data-field-id can be entered but can fail label, error, or required-marker assertions. Reuse one field-container locator based on the same field-key predicate.

Proposed direction
+private By fieldContainerLocator(String fieldId) {
+	return By.xpath(
+			"//*[self::input or self::select or self::textarea]"
+					+ "[`@id`='" + fieldId + "' or `@name`='" + fieldId
+					+ "' or `@data-field-id`='" + fieldId + "']"
+					+ "/ancestor::div[contains(`@class`,'form-field')][1]");
+}
+
-//*[`@id`='" + fieldId + "']/ancestor::div[contains(`@class`,'form-field')][1]
+fieldContainerLocator(fieldId)

Also applies to: 47-62, 133-141, 188-193

🤖 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/KbiPage.java` around lines 29 - 31, Update
KbiPage field assertion methods getFieldErrorMessage(), isFieldMarkedRequired(),
and getFieldLabel() to reuse a shared field-container locator with the same id,
name, and data-field-id predicate as fieldInputLocator(). Preserve the existing
label, error-message, and required-marker behavior while ensuring fields
identified only by name or data-field-id resolve consistently.

75-89: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Log field and network interactions to Extent reports.

enterFieldValue(), blurField(), touchThenClearField(), and setOffline() perform direct browser mutations without a report entry. This violates the page-object reporting rule and leaves validation failures without an action trace. Log the field ID and action, but do not log field values.

Proposed direction
 public void blurField(String fieldId) {
+	ExtentReportManager.logStep("Blurred KBI field '" + fieldId + "'");
 	driver.findElement(fieldInputLocator(fieldId)).sendKeys(Keys.TAB);
 }

Also applies to: 111-131, 201-205

🤖 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/KbiPage.java` around lines 75 - 89, Update
enterFieldValue(), blurField(), touchThenClearField(), and setOffline() to add
Extent report entries for each browser or network mutation, including the field
ID and action name where applicable but never the field value. Preserve the
existing mutation behavior and use the page object's established reporting
mechanism.

Source: Path instructions


75-89: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Handle non-text KBI controls explicitly.

enterFieldValue() and touchThenClearField() only branch for Date, but KBI supports Dropdown, Checkbox, and Radio as rendered control types. Required fields of those types skip form submission or validation because clearField() clicks a select and sends key-delete characters, while fixture values are text-based. Use native selection/clicking helpers for these controls at KbiPage.java:75-89 and KbiPage.java:119-131.

🤖 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/KbiPage.java` around lines 75 - 89, Update
enterFieldValue() and touchThenClearField() to explicitly handle Dropdown,
Checkbox, and Radio controls using the existing native selection/click helpers
rather than clearField() and text input. Preserve the current Date handling, and
ensure fixture text values are converted into the appropriate select choice or
control state before returning.

Source: Path instructions

ui-test/src/main/java/stepdefinitions/KbiStepDefinition.java (1)

450-452: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Preserve the failure cause when validating Try Again reload.

The catch (Exception e) block discards WebDriver wait/lookup errors and leaves reloaded = false, so the final assertion does not report why reloading failed. Catch only expected timeout conditions here, or rethrow as an assertion that includes the original cause.

🤖 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/stepdefinitions/KbiStepDefinition.java` around lines
450 - 452, Update the Try Again reload validation around the catch block in
KbiStepDefinition so expected timeout conditions still set reloaded to false,
while unexpected WebDriver wait or lookup failures are propagated as an
assertion retaining the original cause. Ensure the final assertion reports the
underlying reload failure instead of silently discarding it.

Source: Path instructions

🤖 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.

Outside diff comments:
In
`@ui-test/src/main/java/io/mosip/testrig/apirig/esignetUI/testscripts/SimplePostForAutoGenId.java`:
- Around line 136-138: Validate the value returned by
EsignetConfigManager.getSunBirdBaseURL() before entering the retry loop in the
request setup flow. Reject blank or unset sunBirdBaseURL immediately and prevent
endpoint construction or retry attempts; retain the existing behavior for a
nonblank URL.
- Around line 149-163: Update the retry loop in the flow around
EsignetUtil.postWithBodyAndBearerToken to base retry decisions on a null
response, HTTP 5xx status, or the structured Sunbird failure status rather than
raw body text, while allowing successful responses even if their body contains
“UNSUCCESSFUL.” After SUNBIRD_CREATE_MAX_RETRIES is exhausted without a usable
response, throw AdminTestException before any later response validation
dereferences response.

In `@ui-test/src/main/java/pages/KbiPage.java`:
- Around line 29-31: Update KbiPage field assertion methods
getFieldErrorMessage(), isFieldMarkedRequired(), and getFieldLabel() to reuse a
shared field-container locator with the same id, name, and data-field-id
predicate as fieldInputLocator(). Preserve the existing label, error-message,
and required-marker behavior while ensuring fields identified only by name or
data-field-id resolve consistently.
- Around line 75-89: Update enterFieldValue(), blurField(),
touchThenClearField(), and setOffline() to add Extent report entries for each
browser or network mutation, including the field ID and action name where
applicable but never the field value. Preserve the existing mutation behavior
and use the page object's established reporting mechanism.
- Around line 75-89: Update enterFieldValue() and touchThenClearField() to
explicitly handle Dropdown, Checkbox, and Radio controls using the existing
native selection/click helpers rather than clearField() and text input. Preserve
the current Date handling, and ensure fixture text values are converted into the
appropriate select choice or control state before returning.

In `@ui-test/src/main/java/stepdefinitions/KbiStepDefinition.java`:
- Around line 450-452: Update the Try Again reload validation around the catch
block in KbiStepDefinition so expected timeout conditions still set reloaded to
false, while unexpected WebDriver wait or lookup failures are propagated as an
assertion retaining the original cause. Ensure the final assertion reports the
underlying reload failure instead of silently discarding it.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 673ffa5a-af25-4048-a580-7beeb67c4ec6

📥 Commits

Reviewing files that changed from the base of the PR and between 4f01d55 and 4cbd4a1.

📒 Files selected for processing (6)
  • ui-test/src/main/java/io/mosip/testrig/apirig/esignetUI/testscripts/SimplePostForAutoGenId.java
  • ui-test/src/main/java/pages/KbiPage.java
  • ui-test/src/main/java/runners/Runner.java
  • ui-test/src/main/java/stepdefinitions/KbiStepDefinition.java
  • ui-test/src/main/java/utils/EsignetUtil.java
  • ui-test/src/main/resources/featurefiles/KbiForm.feature

@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.

merging because it is already approved

@zesu22
zesu22 merged commit 85710e4 into mosip:develop Aug 6, 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.

4 participants