Skip to content

Conversation

paula-stacho
Copy link
Collaborator

@paula-stacho paula-stacho commented Jul 30, 2025

Description

Adding an e2e test which covers the relationship management via the side drawer:

  • Click on a collection - sidebar opens
  • Click on add relationship
  • Fill in the form
    --> Verify that the relationship is visible (on a collection AND on the diagram)
  • Click edit relationship
  • Make changes
    --> Verify that the relationship has been updated (on a collection AND on the diagram)
  • Delete the relationship
    --> Verify that the relationship has been removed (from a collection AND from the diagram)

One interaction that we don't cover is the click directly on a relationship edge - which should open the relationship drawer. It would be nice to have this covered with the e2e test. Unfortunately, depending on the initial layout, the edge is too small to be reliably clickable by webdriver io. And moving the edges is problematic on it's own - so this test would just be awfully flaky.

Note:
When possible, I've tried to lean into the "how would the user interact" approach, instead of relying on testids. This is recommended by webdriverio https://webdriver.io/docs/selectors/.

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@paula-stacho paula-stacho marked this pull request as ready for review July 31, 2025 12:06
@Copilot Copilot AI review requested due to automatic review settings July 31, 2025 12:06
@paula-stacho paula-stacho requested a review from a team as a code owner July 31, 2025 12:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive e2e tests for relationship management in the data modeling tab via the side drawer. The tests cover the complete relationship lifecycle: creating, editing, and deleting relationships between collections.

Key changes:

  • Added new e2e test suite for relationship management functionality
  • Refactored selectOption helper to support both text-based and index-based selection
  • Added helper functions for interacting with diagram elements and form inputs

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
data-modeling-tab.test.ts Adds comprehensive e2e test for relationship management via sidebar
select-option.ts Refactors selectOption command to support both text and index-based selection
get-input-by-label.ts Adds new helper function to find inputs by their associated labels
selectors.ts Adds new selectors for data model relationship UI elements
multiple test files Updates existing tests to use refactored selectOption API
package.json Adds compass-components dependency for drawer utilities
leafygreen.tsx Exports drawer utility functions
compass.ts Minor type assertion fix

@paula-stacho paula-stacho merged commit aab5ef3 into main Aug 4, 2025
59 checks passed
@paula-stacho paula-stacho deleted the COMPASS-9479-e2e branch August 4, 2025 08:30
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