Skip to content

Conversation

@spike-rabbit
Copy link
Member

@spike-rabbit spike-rabbit commented Jan 23, 2026

The root problem is, that after creation the modal is not immediately at the correct location.
Probably due CDK that needs to calculate first.
By adding an expect that ensures that the modal is at the correct location we solve the issue.
In addition we also need to verify the location of the cdk-drag-preview to make sure it is updated before
the screenshot is taken.


@gemini-code-assist
Copy link

Summary of Changes

Hello @spike-rabbit, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on enhancing the stability of end-to-end tests for modal dialogs, particularly resolving flakiness encountered during drag-and-drop interactions. The changes involve refining the test steps to ensure more robust and consistent simulation of user actions, leading to more reliable test outcomes and updated snapshots.

Highlights

  • Flaky E2E Test Fix: Addressed flakiness in the si-modal-dialogs e2e test, specifically related to the drag-and-drop functionality of modal dialogs.
  • Enhanced Drag-and-Drop Stability: Improved the reliability of the drag-and-drop test sequence by introducing additional mouse movements and an explicit assertion to verify the cdk-drag-preview element's bounding box position, ensuring consistent behavior.
  • Snapshot Updates: Updated visual and accessibility tree snapshots (.png and .yaml files) to reflect the more stable test behavior and potentially minor adjustments in the modal dialogs' rendering or accessibility structure.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to fix a flaky end-to-end test for modal dialogs by adjusting the mouse movements during a drag-and-drop operation and adding an assertion to verify the element's final position. While the added assertion is a good step towards making the test more robust, the use of mouse 'jiggling' is a workaround that should be avoided. My feedback focuses on improving the test's stability and maintainability by removing this workaround and addressing the use of magic numbers.

@github-actions
Copy link

@spike-rabbit spike-rabbit force-pushed the test/modals/flaky-e2e-fix branch 2 times, most recently from c8a129f to 0de65e2 Compare January 23, 2026 15:33
@spike-rabbit
Copy link
Member Author

/gemini review

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request aims to fix a flaky E2E test for modals by ensuring elements are in their correct positions before interactions and assertions. The approach involves adding a new custom Playwright matcher, toHaveBoundingBox, to poll for an element's position. The changes are logical and should resolve the flakiness. I've provided a couple of suggestions to improve the new test helper's robustness and to address the maintainability of using hardcoded coordinates in the test.

@spike-rabbit spike-rabbit force-pushed the test/modals/flaky-e2e-fix branch from 0de65e2 to 727e006 Compare January 23, 2026 15:44
The root problem is, that after creation the modal is not immediately at the correct location.
Probably due CDK that needs to calculate first.
By adding an expect that ensures that the modal is at the correct location we solve the issue.
In addition, we also need to verify the location of the cdk-drag-preview to make sure it is updated before
the screenshot is taken.
@spike-rabbit spike-rabbit force-pushed the test/modals/flaky-e2e-fix branch from 727e006 to c0d8846 Compare January 23, 2026 15:46
@github-actions
Copy link

Code Coverage

@spike-rabbit spike-rabbit marked this pull request as ready for review January 23, 2026 15:59
@spike-rabbit spike-rabbit requested review from a team as code owners January 23, 2026 15:59
await page.getByText('Many columns').first().click();
await expect(page.locator('.modal-body')).toBeVisible();
// Ensure everything is in place for the mouse interactions.
await expect(page.locator('.modal-body')).toHaveBoundingBox({ x: 274, y: 116 });
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a pain to maintain and write tests for as you need to know the exact box. So this is a no-no for me

Can't this be instead something more generic? I.e. what is the initial incorrect position so we can test for not being that

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really. On my machine the initial coordinates were varying.

In the end we need to wait here until the modal reached its position.
Usually I would say just disabling the animation and checking for visibility should also be fine. But I did not get this working. Maybe you find something better?

Copy link
Member Author

Choose a reason for hiding this comment

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

Playwright let you know the correct numbers in case those are off. So maintenance is not hard.

Unless you find better way, I would be in favor of just merging it. In my opinion this is at least an improvement to before.

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