-
Notifications
You must be signed in to change notification settings - Fork 231
chore: add e2e tests for relationship management COMPASS-9479 #7154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 |
Description
Adding an e2e test which covers the relationship management via the side drawer:
--> Verify that the relationship is visible (on a collection AND on the diagram)
--> Verify that the relationship has been updated (on a collection AND on the diagram)
--> 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
Motivation and Context
Open Questions
Dependents
Types of changes