-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Refactor integration test app paging #16551
Conversation
Use a `ListBox` to switch pages instead of a `TabControl`: the `TabControl` didn't adapt well to smaller screen sizes, and the `MainWindow` was getting unwieldy anyway.
Move logic for selecting the page to a base class as we may need to handle scrolling manually on macOS at some point (Appium on macOS doesn't scroll elements into view automatically).
You can test this PR using the following package version. |
You can test this PR using the following package version. |
8091168
to
0c4f6b5
Compare
This is needed in order for controls to be scrolled into view using WinAppDriver. The default is the same as WPF and the default value is overridden in the same controls as WPF (where present).
0c4f6b5
to
0e7aad2
Compare
You can test this PR using the following package version. |
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.
LGTM! Hopefully integration tests will be more stable with these changes.
A quick question about the AutomationProperties.IsOffscreenBehavior
property, as I noticed it's been overridden to FromClip
in several places. Why isn't FromClip
the default? It seems to represent "the right thing" when thinking about offscreen elements.
It's a very good question and I don't know the answer; WPF and UWP do it like this so I just copied them, which is what we generally do as a default these days. |
* Refactor IntegrationTestApp. Use a `ListBox` to switch pages instead of a `TabControl`: the `TabControl` didn't adapt well to smaller screen sizes, and the `MainWindow` was getting unwieldy anyway. * Update tests to use new pager. Move logic for selecting the page to a base class as we may need to handle scrolling manually on macOS at some point (Appium on macOS doesn't scroll elements into view automatically). * Add AutomationPeer.IsOffscreen. This is needed in order for controls to be scrolled into view using WinAppDriver. The default is the same as WPF and the default value is overridden in the same controls as WPF (where present). #Conflicts: # samples/IntegrationTestApp/App.axaml.cs # samples/IntegrationTestApp/MainWindow.axaml # samples/IntegrationTestApp/MainWindow.axaml.cs # samples/IntegrationTestApp/TopmostWindowTest.axaml.cs # src/Avalonia.Controls/TreeViewItem.cs # tests/Avalonia.IntegrationTests.Appium/ContextMenuTests.cs # tests/Avalonia.IntegrationTests.Appium/PointerTests.cs # tests/Avalonia.IntegrationTests.Appium/ScreenTests.cs # tests/Avalonia.IntegrationTests.Appium/TrayIconTests.cs # tests/Avalonia.IntegrationTests.Appium/WindowDecorationsTests.cs # tests/Avalonia.IntegrationTests.Appium/WindowTests.cs # tests/Avalonia.IntegrationTests.Appium/WindowTests_MacOS.cs
What does the pull request do?
#15542 started causing integration tests to fail on Windows and I had no idea why until I managed to get a screen recording (see #16546). Turns out that our integration tests run on a really small screen and adding the "Embedding" tab caused our tabs to expand to 3 columns, leaving little room for the content:
Besides that, all tabs being defined in the
MainWindow.xaml
file was getting a bit unwieldy anyway.This PR refactors the IntegrationTestApp to use a
ListBox
to handle the paging (which will ensure that the tabs don't grow horizontally) and moves each page into its own view (to ease of mantenence):Because paging now potentially requires scrolling to offscreen elements, I had to add support for the UIA
IsOffscreen
property in order for WinAppDriver to scroll elements into view.It also moves selecting the page in the test project to a base class as we may need to handle scrolling manually on macOS at some point (Appium on macOS doesn't scroll elements into view automatically) - this isn't a problem yet as the items fit comfortably on-screen on macOS.