Skip to content

Conversation

@Cosifne
Copy link
Member

@Cosifne Cosifne commented Jun 21, 2022

Tracking issue: #55714
Add 4 tests to cover the important scenarios of Inheritance margin.

  1. Navigate from file to file
  2. Navigate from file to metadata
  3. Navigate from project to project.
  4. Multiple members on the same line.

There is one remaining thing for this test, right now I simulate the mouse click by creating a WPF event, and ideally, I feel it would be better to simulate the click by real moving the mouse.
I talked to Sam about this and the correct way seems to be to have a separate InputSimulator class to do that. And I feels it would be a separate PR work, even WPF event is not perfect, these tests should be good to prevent many regressions.

@Cosifne Cosifne requested a review from a team as a code owner June 21, 2022 05:24
@ghost ghost added the Area-IDE label Jun 21, 2022
@Cosifne Cosifne requested a review from sharwell June 21, 2022 05:25
Copy link
Contributor

@sharwell sharwell left a comment

Choose a reason for hiding this comment

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

Since this is a test for a UI layer, I can help update this today to use the mouse instead of bypassing the UI layer.

@Cosifne Cosifne requested a review from a team as a code owner June 21, 2022 23:30
@sharwell
Copy link
Contributor

Rewrote portions of this:

  • Simplified a bunch of code
  • Migrate new integration tests from SendKeys to InputSimulatorPlus
  • Use mouse instead of WPF events for testing interaction logic

@Cosifne Cosifne removed the request for review from a team June 22, 2022 04:27
}
var horizontalResolution = NativeMethods.GetSystemMetrics(NativeMethods.SM_CXSCREEN);
var verticalResolution = NativeMethods.GetSystemMetrics(NativeMethods.SM_CYSCREEN);
var virtualPoint = new ScaleTransform(65535.0 / horizontalResolution, 65535.0 / verticalResolution).Transform(point);
Copy link
Member Author

Choose a reason for hiding this comment

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

@sharwell could you give a brief explanation of these magic numbers?

Copy link
Contributor

Choose a reason for hiding this comment

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

See here:
https://github.com/TChatzigiannakis/InputSimulatorPlus/blob/af96f2a453d48f632a5c98153a6aa87fb1a26012/WindowsInput/MouseSimulator.cs#L71-L105

The current implementation won't work in multi-monitor configurations where the test VS instance is not on the primary display device. This isn't something we have to worry about in CI but hopefully we can fix it later by switching from MoveMouseTo to MoveMouseToPositionOnVirtualDesktop.

@sharwell sharwell force-pushed the dev/shech/InheritanceMarginIntegrationTest branch from 91eb839 to f44920c Compare June 22, 2022 20:33
@Cosifne Cosifne merged commit 883d2ff into dotnet:main Jun 27, 2022
@ghost ghost added this to the Next milestone Jun 27, 2022
@RikkiGibson RikkiGibson modified the milestones: Next, 17.3 P3 Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants