Skip to content

Conversation

@akhil-testsigma
Copy link
Contributor

@akhil-testsigma akhil-testsigma commented Jan 13, 2026

Publish this addon as public

Addon Name: Validate Order
Jarvis Link: https://jarvis.testsigma.com/ui/tenants/30397/addons
Jira : https://testsigma.atlassian.net/browse/CUS-10043
Optimised the already present code

Publish this addon as public (IN Region)

Addon Name: Validate Order
Jarvis Link: https://jarvis-in.testsigma.com/ui/tenants/3/addons
Jira : https://testsigma.atlassian.net/browse/CUS-10043
Migrated to IN region

Summary by CodeRabbit

  • Chores

    • Project version upgraded to 1.0.7
    • Updated Selenium, Appium, Lombok, and related dependencies to latest versions
  • Bug Fixes

    • Improved sorting validation with enhanced error handling and element checks

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

The pull request updates project dependencies in the Maven configuration with major version upgrades for Selenium (3.x to 4.x) and Appium (7.x to 9.x) libraries, adds Apache Commons Lang utility library, and refactors the sorting verification logic in Sorting.java to simplify the control flow with improved error handling.

Changes

Cohort / File(s) Summary
Dependency & Version Management
validate_order/pom.xml
Project version bumped to 1.0.7; TestSigma SDK downgraded to 1.0.0.rc1; Lombok updated to 1.18.30; Selenium upgraded from 3.141.59 to 4.33.0; Appium Java client upgraded from 7.0.0 to 9.4.0; added Apache Commons Lang 3.17.0 dependency
Sorting Logic Refactoring
validate_order/src/main/java/com/testsigma/addons/web/Sorting.java
Consolidated branched sorting verification into unified flow; added null/empty element validation; introduced extractText helper method; replaced per-branch exception handling with streamlined try/catch structure; expanded imports (ExceptionUtils, NoSuchElementException, WebElement, Assert); restructured annotation formatting

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • Ganesh-Testsigma
  • vigneshtestsigma

Poem

🐰 Dependencies dance in the pom so bright,
Selenium leaps to version four with might,
Sorting now flows in a unified way,
Refactored with grace, no branching dismay,
Commons and clarity join the array! 🌟

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions code optimization and IN region migration, which partially aligns with the changes, but the primary focus of the changeset is dependency updates and sorting logic refactoring, not regional migration. Consider revising the title to better reflect the main technical changes, such as updating dependencies and refactoring the Sorting class, rather than emphasizing region migration.
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 (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing touches
  • 📝 Generate docstrings

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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

🤖 Fix all issues with AI agents
In @validate_order/pom.xml:
- Line 16: The pom property testsigma.sdk.version is set to a non-published
pre-release value; update the <testsigma.sdk.version> property to a valid
released version (e.g., 1.0.1 or later) so Maven can resolve the dependency;
locate the testsigma.sdk.version entry in the POM and replace "1.0.0.rc1" with
the chosen stable release string, then run a mvn dependency:resolve or build to
verify resolution.

In @validate_order/src/main/java/com/testsigma/addons/web/Sorting.java:
- Around line 40-41: The current code calls operator.getValue().toString() which
can NPE if getValue() is null; update the Sorting.java code around the operator
usage to guard against null by capturing the value into a variable (e.g., Object
val = operator.getValue()) and compute the order as either an empty string or
the lower-cased toString (e.g., String order = val == null ? "" :
val.toString().toLowerCase()), then log using logger.info("Sorting order
selected: " + order); this prevents NullPointerException while preserving the
logged output.
🧹 Nitpick comments (2)
validate_order/pom.xml (1)

43-45: TestNG version 6.14.3 is outdated.

Consider updating to a newer TestNG version (7.x) for compatibility with Java 11+ and to receive bug fixes and improvements.

validate_order/src/main/java/com/testsigma/addons/web/Sorting.java (1)

92-98: Potential NPE if getText() returns null.

While uncommon, WebElement.getText() can return null for certain element states. Calling .trim() on null will throw a NullPointerException.

Defensive null handling
 private List<String> extractText(List<WebElement> elements) {
     List<String> data = new ArrayList<>();
     for (WebElement element : elements) {
-        data.add(element.getText().trim());
+        String text = element.getText();
+        data.add(text != null ? text.trim() : "");
     }
     return data;
 }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2112143 and 5ce02a2.

📒 Files selected for processing (2)
  • validate_order/pom.xml
  • validate_order/src/main/java/com/testsigma/addons/web/Sorting.java
🔇 Additional comments (7)
validate_order/src/main/java/com/testsigma/addons/web/Sorting.java (5)

55-56: Lexicographic sorting may not work for numeric columns.

Collections.sort(expectedList) performs lexicographic string comparison, so numeric data will sort incorrectly (e.g., "10" < "2" < "9"). If the column contains numeric data, this validation will produce false negatives.

Is this addon intended only for text columns, or should it also handle numeric data? If numeric support is needed, consider detecting numeric patterns and using a numeric comparator.


20-24: LGTM!

The reformatted annotations improve readability and clearly document the action's purpose and allowed test data values.

Also applies to: 27-30


45-49: LGTM!

Good addition of the empty elements check with appropriate error messaging and logging before returning FAILED.


76-88: LGTM!

The structured exception handling properly distinguishes between assertion failures and unexpected exceptions, providing clear error messages for each case.


37-37: No action required — the exception declaration is compatible.

The execute() method signature correctly declares throws NoSuchElementException. Since NoSuchElementException is an unchecked exception (extends RuntimeException), it can be declared in an overriding method without violating Java's method override rules. Only checked exceptions are constrained by the Liskov Substitution Principle; unchecked exceptions may be thrown or declared freely. Testsigma's documentation and examples confirm this pattern is correct and will compile without errors.

Likely an incorrect or invalid review comment.

validate_order/pom.xml (2)

57-57: Version 9.4.0 is a valid published release.

Appium java-client 9.4.0 is available on Maven Central (published January 21, 2025). No action needed.


51-51: No changes needed. Selenium version 4.33.0 is a valid release published to Maven Central (May 25, 2025) and will not cause build failures.

Likely an incorrect or invalid review comment.

<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<testsigma.sdk.version>1.2.2_cloud</testsigma.sdk.version>
<testsigma.sdk.version>1.0.0.rc1</testsigma.sdk.version>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

testsigma SDK java version 1.0.0.rc1 stable release

💡 Result:

I couldn't find a stable release named "1.0.0.rc1" for the Testsigma Java SDK. The official GitHub repo for testsigma-java-sdk shows no published releases/tags, and Maven listings show published stable versions such as 1.0.1 (and later cloud versions). [1][2]

Sources:

  • testsigma-java-sdk GitHub repository (no releases/tags published). [1]
  • Maven / mvnrepository entry for com.testsigma:testsigma-java-sdk (example stable version 1.0.1). [2]

Replace testsigma.sdk.version with a valid published release.

Version 1.0.0.rc1 does not appear to exist as a published release on Maven repositories. Use a stable version such as 1.0.1 or later.

🤖 Prompt for AI Agents
In @validate_order/pom.xml at line 16, The pom property testsigma.sdk.version is
set to a non-published pre-release value; update the <testsigma.sdk.version>
property to a valid released version (e.g., 1.0.1 or later) so Maven can resolve
the dependency; locate the testsigma.sdk.version entry in the POM and replace
"1.0.0.rc1" with the chosen stable release string, then run a mvn
dependency:resolve or build to verify resolution.

Comment on lines +40 to +41
String order = operator.getValue().toString().toLowerCase();
logger.info("Sorting order selected: " + order);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Potential NPE if operator.getValue() returns null.

If the test data value is not provided or is null, calling toString() will throw a NullPointerException. Consider adding a null check or using String.valueOf().

Proposed fix
-            String order = operator.getValue().toString().toLowerCase();
+            Object value = operator.getValue();
+            if (value == null) {
+                setErrorMessage("Sorting order (ascending/descending) must be provided.");
+                return Result.FAILED;
+            }
+            String order = value.toString().toLowerCase();
🤖 Prompt for AI Agents
In @validate_order/src/main/java/com/testsigma/addons/web/Sorting.java around
lines 40 - 41, The current code calls operator.getValue().toString() which can
NPE if getValue() is null; update the Sorting.java code around the operator
usage to guard against null by capturing the value into a variable (e.g., Object
val = operator.getValue()) and compute the order as either an empty string or
the lower-cased toString (e.g., String order = val == null ? "" :
val.toString().toLowerCase()), then log using logger.info("Sorting order
selected: " + order); this prevents NullPointerException while preserving the
logged output.

@akhil-testsigma akhil-testsigma merged commit c946903 into dev Jan 13, 2026
2 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