Skip to content

SDKS-5281 Test new DaVinci components - #233

Merged
spetrov merged 3 commits into
developfrom
SDKS-5281
Aug 7, 2026
Merged

SDKS-5281 Test new DaVinci components#233
spetrov merged 3 commits into
developfrom
SDKS-5281

Conversation

@spetrov

@spetrov spetrov commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

JIRA Ticket

SDKS-5281 Test new DaVinci components

Description

  • Adds MetadataCollectorE2ETest with 10 instrumented tests covering the DaVinci SDK Connector (exchangeCustomMetadata capability): collector shape, payload integrity, setResult success path, setError error path, validation gating, loop state isolation, and session recovery.
  • Adds ImageCollectorE2ETest with 7 tests covering ImageCollector.
  • Wires DAVINCI_METADATA_ACR_VALUES and DAVINCI_IMAGE_ACR_VALUES into davinci_test_config.properties and DaVinciTestConfig to support the dedicated test flow.

Summary by CodeRabbit

  • New Features
    • Expanded DaVinci authentication-flow coverage with metadata and image collector experiences.
    • Added configurable authentication context values for metadata and image interactions.
  • Tests
    • Added end-to-end validation for metadata collection, including success, error, structured payloads, and repeated-flow behavior.
    • Added end-to-end validation for image collection, including node configuration, image content, and rich labels.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds metadata and image ACR configuration, a miscellaneous collector flow fixture, and Android end-to-end tests for metadata and image collector behavior.

Changes

DaVinci collector E2E coverage

Layer / File(s) Summary
Collector test configuration
davinci/src/androidTest/kotlin/com/pingidentity/davinci/DaVinciTestConfig.kt, davinci/src/main/assets/davinci_test_config.properties
Adds metadata and image ACR-value properties and loads their test asset values.
Miscellaneous collector flow
davinci/src/androidTest/kotlin/com/pingidentity/davinci/Misc-Collectors-Flow.json
Defines collector selection, metadata success and error branches, image display, flow variables, and result forms.
Metadata collector validation
davinci/src/androidTest/kotlin/com/pingidentity/davinci/MetadataCollectorE2ETest.kt
Tests metadata collector shape, payload state, validation, result and error handling, navigation, and repeated traversal state.
Image collector validation
davinci/src/androidTest/kotlin/com/pingidentity/davinci/ImageCollectorE2ETest.kt
Tests image collector naming, identity, content fields, URLs, identifier behavior, and label rich content.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MetadataCollectorE2ETest
  participant ImageCollectorE2ETest
  participant DaVinciFlow
  participant MetadataCollector
  participant ImageCollector
  participant ResultForm
  MetadataCollectorE2ETest->>DaVinciFlow: Navigate to metadata node
  DaVinciFlow->>MetadataCollector: Create metadata collector
  MetadataCollectorE2ETest->>MetadataCollector: Set result or error
  MetadataCollector->>ResultForm: Advance to success or error branch
  ImageCollectorE2ETest->>DaVinciFlow: Navigate to image node
  DaVinciFlow->>ImageCollector: Create image collector
  ImageCollectorE2ETest->>ImageCollector: Inspect image properties
Loading

Possibly related PRs

Suggested reviewers: vahancouver, witrisna

Poem

A rabbit checks each collector path,
Metadata moves through flow and form.
Images carry keys and links,
Errors use structured envelopes.
New traversals start clean.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the addition of tests for new DaVinci components and includes the related ticket identifier.
Description check ✅ Passed The description includes the JIRA ticket, test coverage details, and configuration changes required for review and testing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch SDKS-5281

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
Contributor

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 (3)
davinci/src/androidTest/kotlin/com/pingidentity/davinci/MetadataCollectorE2ETest.kt (3)

129-132: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Assert the validation error by type, not by toString().

validateRequiresResponseBeforeSubmit asserts errors[0].toString() equals "Required". Required is a public data object; keep the test focused on the validation contract instead of the object’s string representation.

♻️ Proposed fix
         val errors = collector.validate()
         assertTrue(errors.isNotEmpty())
-        assertEquals("Required", errors[0].toString())
+        assertIs<Required>(errors[0])

Add the imports:

import com.pingidentity.davinci.collector.Required
import kotlin.test.assertIs
🤖 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
`@davinci/src/androidTest/kotlin/com/pingidentity/davinci/MetadataCollectorE2ETest.kt`
around lines 129 - 132, Update validateRequiresResponseBeforeSubmit to assert
the first validation error is of type Required using assertIs, replacing the
errors[0].toString() equality check while retaining the non-empty assertion.

21-22: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Install the TestRail watcher rule and label the tests.

MetadataCollectorE2ETest imports TestRailWatcher/Rule/TestWatcher and TestRailCase, but it declares no watcher rule and its @Test functions lack @TestRailCase. As a result, these tests do not report TestRail results. Add the watcher rule and annotate the test methods, or remove the unused imports if reporting is not required.

🤖 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
`@davinci/src/androidTest/kotlin/com/pingidentity/davinci/MetadataCollectorE2ETest.kt`
around lines 21 - 22, Update MetadataCollectorE2ETest to install a TestRail
watcher rule using the imported TestRailWatcher/Rule/TestWatcher types and
annotate each `@Test` method with TestRailCase so results are reported; if
reporting is intentionally not required, remove the unused TestRail imports
instead.

Source: Learnings


58-61: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Use type-based collector lookup for e2e form assertions.

LABEL_INDEX = 0 and SUBMIT_INDEX = 1 match this form only because ERROR_DISPLAY does not create a collector in the current registry. If that behavior changes, these casts fail. Look up collectors by type, such as node.collectors.filterIsInstance<LabelCollector>().first() or filterIsInstance<SubmitCollector>().first(), before asserting values.

🤖 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
`@davinci/src/androidTest/kotlin/com/pingidentity/davinci/MetadataCollectorE2ETest.kt`
around lines 58 - 61, Update the e2e form assertions in MetadataCollectorE2ETest
to stop relying on LABEL_INDEX and SUBMIT_INDEX. Retrieve the relevant
collectors from node.collectors using filterIsInstance<LabelCollector>() and
filterIsInstance<SubmitCollector>(), then assert their values while preserving
the existing expectations.
🤖 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
`@davinci/src/androidTest/kotlin/com/pingidentity/davinci/MetadataCollectorE2ETest.kt`:
- Line 48: Replace the `@SmallTest` annotation on MetadataCollectorE2ETest with
`@LargeTest` so this live-network E2E suite is classified for the appropriate test
execution path.

---

Nitpick comments:
In
`@davinci/src/androidTest/kotlin/com/pingidentity/davinci/MetadataCollectorE2ETest.kt`:
- Around line 129-132: Update validateRequiresResponseBeforeSubmit to assert the
first validation error is of type Required using assertIs, replacing the
errors[0].toString() equality check while retaining the non-empty assertion.
- Around line 21-22: Update MetadataCollectorE2ETest to install a TestRail
watcher rule using the imported TestRailWatcher/Rule/TestWatcher types and
annotate each `@Test` method with TestRailCase so results are reported; if
reporting is intentionally not required, remove the unused TestRail imports
instead.
- Around line 58-61: Update the e2e form assertions in MetadataCollectorE2ETest
to stop relying on LABEL_INDEX and SUBMIT_INDEX. Retrieve the relevant
collectors from node.collectors using filterIsInstance<LabelCollector>() and
filterIsInstance<SubmitCollector>(), then assert their values while preserving
the existing expectations.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 15779947-5e0b-4032-b969-310145254dff

📥 Commits

Reviewing files that changed from the base of the PR and between eaf5417 and 9b6ba10.

📒 Files selected for processing (4)
  • davinci/src/androidTest/kotlin/com/pingidentity/davinci/DaVinciTestConfig.kt
  • davinci/src/androidTest/kotlin/com/pingidentity/davinci/MetadataCollectorE2ETest.kt
  • davinci/src/androidTest/kotlin/com/pingidentity/davinci/Misc-Collectors-Flow.json
  • davinci/src/main/assets/davinci_test_config.properties

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

Actionable comments posted: 1

🤖 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
`@davinci/src/androidTest/kotlin/com/pingidentity/davinci/ImageCollectorE2ETest.kt`:
- Line 55: Align EXPECTED_HYPERLINK_URL with the current
Misc-Collectors-Flow.json fixture by setting it to the empty string, or update
the fixture to enable the hyperlink with the existing URL; keep the test
documentation and assertion behavior consistent with that choice.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d8f512e-ca51-4bc2-8d11-06e235da9355

📥 Commits

Reviewing files that changed from the base of the PR and between 9b6ba10 and c1f9051.

📒 Files selected for processing (3)
  • davinci/src/androidTest/kotlin/com/pingidentity/davinci/DaVinciTestConfig.kt
  • davinci/src/androidTest/kotlin/com/pingidentity/davinci/ImageCollectorE2ETest.kt
  • davinci/src/main/assets/davinci_test_config.properties
🚧 Files skipped from review as they are similar to previous changes (2)
  • davinci/src/androidTest/kotlin/com/pingidentity/davinci/DaVinciTestConfig.kt
  • davinci/src/main/assets/davinci_test_config.properties

@spetrov spetrov changed the title SDKS-5281 Added MetadataCollector e2e tests SDKS-5281 Test new DaVinci components Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@spetrov
spetrov requested a review from vibhorgoswami August 6, 2026 20:20

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

I think the comment from Coderabbit is good. Otherwise all good.

@spetrov
spetrov merged commit 261ca89 into develop Aug 7, 2026
13 of 19 checks passed
@spetrov
spetrov deleted the SDKS-5281 branch August 7, 2026 21:55

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

🧹 Nitpick comments (1)
davinci/src/androidTest/kotlin/com/pingidentity/davinci/MetadataCollectorE2ETest.kt (1)

80-87: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Handle every Node path before casting to ContinueNode.

navigateToMetadataNode() casts daVinci.start() and both node.next() calls unconditionally. Add a local helper that handles ContinueNode, SuccessNode, ErrorNode, and FailureNode, reports the non-ContinueNode outcome with its details, then uses the safe result for the subsequent collector/field checks. Apply the same pattern to the remaining node.next() as ContinueNode sequences in the test.

🤖 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
`@davinci/src/androidTest/kotlin/com/pingidentity/davinci/MetadataCollectorE2ETest.kt`
around lines 80 - 87, Update navigateToMetadataNode and all remaining
node.next() sequences to avoid unconditional ContinueNode casts. Add a local
helper that accepts each Node outcome type (ContinueNode, SuccessNode,
ErrorNode, and FailureNode), reports non-Continue outcomes with their details,
and returns only a safe ContinueNode for collector and field assertions; use it
for daVinci.start() and every subsequent transition.

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.

Nitpick comments:
In
`@davinci/src/androidTest/kotlin/com/pingidentity/davinci/MetadataCollectorE2ETest.kt`:
- Around line 80-87: Update navigateToMetadataNode and all remaining node.next()
sequences to avoid unconditional ContinueNode casts. Add a local helper that
accepts each Node outcome type (ContinueNode, SuccessNode, ErrorNode, and
FailureNode), reports non-Continue outcomes with their details, and returns only
a safe ContinueNode for collector and field assertions; use it for
daVinci.start() and every subsequent transition.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9c8fb3ef-67f1-4545-a582-28eea5d2006c

📥 Commits

Reviewing files that changed from the base of the PR and between bfd8d79 and 4f0f8ca.

📒 Files selected for processing (2)
  • davinci/src/androidTest/kotlin/com/pingidentity/davinci/ImageCollectorE2ETest.kt
  • davinci/src/androidTest/kotlin/com/pingidentity/davinci/MetadataCollectorE2ETest.kt
💤 Files with no reviewable changes (1)
  • davinci/src/androidTest/kotlin/com/pingidentity/davinci/ImageCollectorE2ETest.kt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants