Skip to content

Initial WPF test#711

Closed
imalcolm1 wants to merge 15 commits intoian/uitests-reviewedfrom
ian/uitest-wpf-initial
Closed

Initial WPF test#711
imalcolm1 wants to merge 15 commits intoian/uitests-reviewedfrom
ian/uitest-wpf-initial

Conversation

@imalcolm1
Copy link
Contributor

@imalcolm1 imalcolm1 commented Jan 27, 2026

This pull request only includes WPF Scale Line tests to make sure I'm on the right track. Converted old tests to MSTest and created a new puppet app separate from the Samples.

Building requires installing Appium: https://appium.io/docs/en/latest/quickstart/install/
And the windows driver here: https://appium.io/docs/en/latest/ecosystem/drivers/#windows
Make sure appium is running before starting the tests.

@imalcolm1
Copy link
Contributor Author

imalcolm1 commented Jan 27, 2026

Building this branch is not 100% necessary if anyone wants to drop by my office instead for a demonstration. I mostly want confirmation that I'm on the right track before I go much further (though WinUI is already done to mostly the same state as WPF here)

Copy link
Member

@dotMorten dotMorten left a comment

Choose a reason for hiding this comment

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

Great start! Let's change the Puppet name though :)

Comment on lines +31 to +42
var dpi = VisualTreeHelper.GetDpi(this);
ScreenDensityTextBlock.Text = dpi.DpiScaleX.ToString();

NetVersionTextBlock.Text = Environment.Version.ToString();

var runtimeTypeInfo = typeof(ArcGISRuntimeEnvironment).GetTypeInfo();
var runtimeVersion = FileVersionInfo.GetVersionInfo(runtimeTypeInfo.Assembly.Location);
RuntimeVersionTextBlock.Text = runtimeVersion.FileVersion;

var toolkitTypeInfo = typeof(Esri.ArcGISRuntime.Toolkit.UI.Controls.ScaleLine).GetTypeInfo();
var toolkitVersion = FileVersionInfo.GetVersionInfo(runtimeTypeInfo.Assembly.Location);
ToolkitVersionTextBlock.Text = toolkitVersion.FileVersion;
Copy link
Member

Choose a reason for hiding this comment

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

What is this needed for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screen density is used when making sure widths are correct even if screen dpis change. The others are just a means for users to visual confirm that the correct versions of .NET, Runtime, and the Toolkit are being used, like we do in the Maui runtime UI tests


driver = MakeWindowsDriver(wpfSamplesApp);

driver.Manage().Window.Maximize();
Copy link
Member

Choose a reason for hiding this comment

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

Do you also need to ensure it's on the primary display to get consistent screen coordinates?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe. Using find element means we shouldn't need to use manual coordinates, and the app displays the screen dpi so that we can adjust expected ui element dimensions

@mstefarov mstefarov closed this Mar 4, 2026
@imalcolm1 imalcolm1 deleted the ian/uitest-wpf-initial branch March 5, 2026 00:26
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